Lines Matching +full:osc +full:- +full:bypass
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 #include <linux/clk-provider.h>
73 struct clk_main_osc *osc = to_clk_main_osc(hw); in clk_main_osc_prepare() local
74 struct regmap *regmap = osc->regmap; in clk_main_osc_prepare()
96 struct clk_main_osc *osc = to_clk_main_osc(hw); in clk_main_osc_unprepare() local
97 struct regmap *regmap = osc->regmap; in clk_main_osc_unprepare()
113 struct clk_main_osc *osc = to_clk_main_osc(hw); in clk_main_osc_is_prepared() local
114 struct regmap *regmap = osc->regmap; in clk_main_osc_is_prepared()
128 struct clk_main_osc *osc = to_clk_main_osc(hw); in clk_main_osc_save_context() local
130 osc->pms.status = clk_main_osc_is_prepared(hw); in clk_main_osc_save_context()
137 struct clk_main_osc *osc = to_clk_main_osc(hw); in clk_main_osc_restore_context() local
139 if (osc->pms.status) in clk_main_osc_restore_context()
156 bool bypass) in at91_clk_register_main_osc() argument
158 struct clk_main_osc *osc; in at91_clk_register_main_osc() local
164 return ERR_PTR(-EINVAL); in at91_clk_register_main_osc()
166 osc = kzalloc(sizeof(*osc), GFP_KERNEL); in at91_clk_register_main_osc()
167 if (!osc) in at91_clk_register_main_osc()
168 return ERR_PTR(-ENOMEM); in at91_clk_register_main_osc()
179 osc->hw.init = &init; in at91_clk_register_main_osc()
180 osc->regmap = regmap; in at91_clk_register_main_osc()
182 if (bypass) in at91_clk_register_main_osc()
188 hw = &osc->hw; in at91_clk_register_main_osc()
189 ret = clk_hw_register(NULL, &osc->hw); in at91_clk_register_main_osc()
191 kfree(osc); in at91_clk_register_main_osc()
209 struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); in clk_main_rc_osc_prepare() local
210 struct regmap *regmap = osc->regmap; in clk_main_rc_osc_prepare()
228 struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); in clk_main_rc_osc_unprepare() local
229 struct regmap *regmap = osc->regmap; in clk_main_rc_osc_unprepare()
243 struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); in clk_main_rc_osc_is_prepared() local
244 struct regmap *regmap = osc->regmap; in clk_main_rc_osc_is_prepared()
256 struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); in clk_main_rc_osc_recalc_rate() local
258 return osc->frequency; in clk_main_rc_osc_recalc_rate()
264 struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); in clk_main_rc_osc_recalc_accuracy() local
266 return osc->accuracy; in clk_main_rc_osc_recalc_accuracy()
271 struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); in clk_main_rc_osc_save_context() local
273 osc->pms.status = clk_main_rc_osc_is_prepared(hw); in clk_main_rc_osc_save_context()
280 struct clk_main_rc_osc *osc = to_clk_main_rc_osc(hw); in clk_main_rc_osc_restore_context() local
282 if (osc->pms.status) in clk_main_rc_osc_restore_context()
301 struct clk_main_rc_osc *osc; in at91_clk_register_main_rc_osc() local
307 return ERR_PTR(-EINVAL); in at91_clk_register_main_rc_osc()
309 osc = kzalloc(sizeof(*osc), GFP_KERNEL); in at91_clk_register_main_rc_osc()
310 if (!osc) in at91_clk_register_main_rc_osc()
311 return ERR_PTR(-ENOMEM); in at91_clk_register_main_rc_osc()
319 osc->hw.init = &init; in at91_clk_register_main_rc_osc()
320 osc->regmap = regmap; in at91_clk_register_main_rc_osc()
321 osc->frequency = frequency; in at91_clk_register_main_rc_osc()
322 osc->accuracy = accuracy; in at91_clk_register_main_rc_osc()
324 hw = &osc->hw; in at91_clk_register_main_rc_osc()
327 kfree(osc); in at91_clk_register_main_rc_osc()
351 return -ETIMEDOUT; in clk_main_probe_frequency()
374 return clk_main_probe_frequency(clkmain->regmap); in clk_rm9200_main_prepare()
382 regmap_read(clkmain->regmap, AT91_CKGR_MCFR, &status); in clk_rm9200_main_is_prepared()
392 return clk_main_recalc_rate(clkmain->regmap, parent_rate); in clk_rm9200_main_recalc_rate()
413 return ERR_PTR(-EINVAL); in at91_clk_register_rm9200_main()
416 return ERR_PTR(-EINVAL); in at91_clk_register_rm9200_main()
420 return ERR_PTR(-ENOMEM); in at91_clk_register_rm9200_main()
431 clkmain->hw.init = &init; in at91_clk_register_rm9200_main()
432 clkmain->regmap = regmap; in at91_clk_register_rm9200_main()
434 hw = &clkmain->hw; in at91_clk_register_rm9200_main()
435 ret = clk_hw_register(NULL, &clkmain->hw); in at91_clk_register_rm9200_main()
456 struct regmap *regmap = clkmain->regmap; in clk_sam9x5_main_prepare()
468 return clk_sam9x5_main_ready(clkmain->regmap); in clk_sam9x5_main_is_prepared()
476 return clk_main_recalc_rate(clkmain->regmap, parent_rate); in clk_sam9x5_main_recalc_rate()
482 struct regmap *regmap = clkmain->regmap; in clk_sam9x5_main_set_parent()
486 return -EINVAL; in clk_sam9x5_main_set_parent()
512 regmap_read(clkmain->regmap, AT91_CKGR_MOR, &status); in clk_sam9x5_main_get_parent()
521 clkmain->pms.status = clk_main_rc_osc_is_prepared(&clkmain->hw); in clk_sam9x5_main_save_context()
522 clkmain->pms.parent = clk_sam9x5_main_get_parent(&clkmain->hw); in clk_sam9x5_main_save_context()
532 ret = clk_sam9x5_main_set_parent(hw, clkmain->pms.parent); in clk_sam9x5_main_restore_context()
536 if (clkmain->pms.status) in clk_sam9x5_main_restore_context()
565 return ERR_PTR(-EINVAL); in at91_clk_register_sam9x5_main()
568 return ERR_PTR(-EINVAL); in at91_clk_register_sam9x5_main()
572 return ERR_PTR(-ENOMEM); in at91_clk_register_sam9x5_main()
583 clkmain->hw.init = &init; in at91_clk_register_sam9x5_main()
584 clkmain->regmap = regmap; in at91_clk_register_sam9x5_main()
585 regmap_read(clkmain->regmap, AT91_CKGR_MOR, &status); in at91_clk_register_sam9x5_main()
586 clkmain->parent = clk_main_parent_select(status); in at91_clk_register_sam9x5_main()
588 hw = &clkmain->hw; in at91_clk_register_sam9x5_main()
589 ret = clk_hw_register(NULL, &clkmain->hw); in at91_clk_register_sam9x5_main()