Lines Matching +full:sys +full:- +full:syscon

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 #include <linux/clk-provider.h>
10 #include <linux/mfd/syscon.h>
43 struct clk_system *sys = to_clk_system(hw); in clk_system_prepare() local
45 regmap_write(sys->regmap, AT91_PMC_SCER, 1 << sys->id); in clk_system_prepare()
47 if (!is_pck(sys->id)) in clk_system_prepare()
50 while (!clk_system_ready(sys->regmap, sys->id)) in clk_system_prepare()
58 struct clk_system *sys = to_clk_system(hw); in clk_system_unprepare() local
60 regmap_write(sys->regmap, AT91_PMC_SCDR, 1 << sys->id); in clk_system_unprepare()
65 struct clk_system *sys = to_clk_system(hw); in clk_system_is_prepared() local
68 regmap_read(sys->regmap, AT91_PMC_SCSR, &status); in clk_system_is_prepared()
70 if (!(status & (1 << sys->id))) in clk_system_is_prepared()
73 if (!is_pck(sys->id)) in clk_system_is_prepared()
76 regmap_read(sys->regmap, AT91_PMC_SR, &status); in clk_system_is_prepared()
78 return !!(status & (1 << sys->id)); in clk_system_is_prepared()
83 struct clk_system *sys = to_clk_system(hw); in clk_system_save_context() local
85 sys->pms.status = clk_system_is_prepared(hw); in clk_system_save_context()
92 struct clk_system *sys = to_clk_system(hw); in clk_system_restore_context() local
94 if (sys->pms.status) in clk_system_restore_context()
95 clk_system_prepare(&sys->hw); in clk_system_restore_context()
111 struct clk_system *sys; in at91_clk_register_system() local
117 return ERR_PTR(-EINVAL); in at91_clk_register_system()
119 sys = kzalloc(sizeof(*sys), GFP_KERNEL); in at91_clk_register_system()
120 if (!sys) in at91_clk_register_system()
121 return ERR_PTR(-ENOMEM); in at91_clk_register_system()
132 sys->id = id; in at91_clk_register_system()
133 sys->hw.init = &init; in at91_clk_register_system()
134 sys->regmap = regmap; in at91_clk_register_system()
136 hw = &sys->hw; in at91_clk_register_system()
137 ret = clk_hw_register(NULL, &sys->hw); in at91_clk_register_system()
139 kfree(sys); in at91_clk_register_system()