Lines Matching refs:afe_priv
76 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_set_audio_int_bus_parent() local
79 ret = clk_set_parent(afe_priv->clk[CLK_MUX_AUDIOINTBUS], in mt8186_set_audio_int_bus_parent()
80 afe_priv->clk[clk_id]); in mt8186_set_audio_int_bus_parent()
93 struct mt8186_afe_private *afe_priv = afe->platform_priv; in apll1_mux_setting() local
97 ret = clk_prepare_enable(afe_priv->clk[CLK_TOP_MUX_AUD_1]); in apll1_mux_setting()
103 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_1], in apll1_mux_setting()
104 afe_priv->clk[CLK_TOP_APLL1_CK]); in apll1_mux_setting()
113 ret = clk_prepare_enable(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1]); in apll1_mux_setting()
119 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1], in apll1_mux_setting()
120 afe_priv->clk[CLK_TOP_APLL1_D8]); in apll1_mux_setting()
128 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1], in apll1_mux_setting()
129 afe_priv->clk[CLK_CLK26M]); in apll1_mux_setting()
136 clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1]); in apll1_mux_setting()
138 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_1], in apll1_mux_setting()
139 afe_priv->clk[CLK_CLK26M]); in apll1_mux_setting()
146 clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]); in apll1_mux_setting()
154 struct mt8186_afe_private *afe_priv = afe->platform_priv; in apll2_mux_setting() local
158 ret = clk_prepare_enable(afe_priv->clk[CLK_TOP_MUX_AUD_2]); in apll2_mux_setting()
164 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_2], in apll2_mux_setting()
165 afe_priv->clk[CLK_TOP_APLL2_CK]); in apll2_mux_setting()
174 ret = clk_prepare_enable(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2]); in apll2_mux_setting()
180 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2], in apll2_mux_setting()
181 afe_priv->clk[CLK_TOP_APLL2_D8]); in apll2_mux_setting()
189 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2], in apll2_mux_setting()
190 afe_priv->clk[CLK_CLK26M]); in apll2_mux_setting()
197 clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2]); in apll2_mux_setting()
199 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_2], in apll2_mux_setting()
200 afe_priv->clk[CLK_CLK26M]); in apll2_mux_setting()
207 clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_2]); in apll2_mux_setting()
215 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_enable_cgs() local
220 ret = clk_prepare_enable(afe_priv->clk[i]); in mt8186_afe_enable_cgs()
233 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_disable_cgs() local
237 clk_disable_unprepare(afe_priv->clk[i]); in mt8186_afe_disable_cgs()
242 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_enable_clock() local
245 ret = clk_prepare_enable(afe_priv->clk[CLK_INFRA_SYS_AUDIO]); in mt8186_afe_enable_clock()
252 ret = clk_prepare_enable(afe_priv->clk[CLK_INFRA_AUDIO_26M]); in mt8186_afe_enable_clock()
259 ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIO]); in mt8186_afe_enable_clock()
265 ret = clk_set_parent(afe_priv->clk[CLK_MUX_AUDIO], in mt8186_afe_enable_clock()
266 afe_priv->clk[CLK_CLK26M]); in mt8186_afe_enable_clock()
274 ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_enable_clock()
285 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUDIO_H], in mt8186_afe_enable_clock()
286 afe_priv->clk[CLK_TOP_APLL2_CK]); in mt8186_afe_enable_clock()
294 ret = clk_prepare_enable(afe_priv->clk[CLK_AFE]); in mt8186_afe_enable_clock()
304 clk_disable_unprepare(afe_priv->clk[CLK_AFE]); in mt8186_afe_enable_clock()
309 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_enable_clock()
311 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIO]); in mt8186_afe_enable_clock()
313 clk_disable_unprepare(afe_priv->clk[CLK_INFRA_SYS_AUDIO]); in mt8186_afe_enable_clock()
315 clk_disable_unprepare(afe_priv->clk[CLK_INFRA_AUDIO_26M]); in mt8186_afe_enable_clock()
322 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_disable_clock() local
324 clk_disable_unprepare(afe_priv->clk[CLK_AFE]); in mt8186_afe_disable_clock()
326 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_disable_clock()
327 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIO]); in mt8186_afe_disable_clock()
328 clk_disable_unprepare(afe_priv->clk[CLK_INFRA_AUDIO_26M]); in mt8186_afe_disable_clock()
329 clk_disable_unprepare(afe_priv->clk[CLK_INFRA_SYS_AUDIO]); in mt8186_afe_disable_clock()
334 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_suspend_clock() local
338 ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_suspend_clock()
348 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_suspend_clock()
355 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_suspend_clock()
361 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_resume_clock() local
365 ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_resume_clock()
376 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_resume_clock()
383 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_resume_clock()
389 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_apll1_enable() local
395 ret = clk_prepare_enable(afe_priv->clk[CLK_APLL22M]); in mt8186_apll1_enable()
402 ret = clk_prepare_enable(afe_priv->clk[CLK_APLL1_TUNER]); in mt8186_apll1_enable()
418 clk_disable_unprepare(afe_priv->clk[CLK_APLL1_TUNER]); in mt8186_apll1_enable()
420 clk_disable_unprepare(afe_priv->clk[CLK_APLL22M]); in mt8186_apll1_enable()
427 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_apll1_disable() local
434 clk_disable_unprepare(afe_priv->clk[CLK_APLL1_TUNER]); in mt8186_apll1_disable()
435 clk_disable_unprepare(afe_priv->clk[CLK_APLL22M]); in mt8186_apll1_disable()
442 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_apll2_enable() local
448 ret = clk_prepare_enable(afe_priv->clk[CLK_APLL24M]); in mt8186_apll2_enable()
455 ret = clk_prepare_enable(afe_priv->clk[CLK_APLL2_TUNER]); in mt8186_apll2_enable()
471 clk_disable_unprepare(afe_priv->clk[CLK_APLL2_TUNER]); in mt8186_apll2_enable()
473 clk_disable_unprepare(afe_priv->clk[CLK_APLL24M]); in mt8186_apll2_enable()
480 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_apll2_disable() local
487 clk_disable_unprepare(afe_priv->clk[CLK_APLL2_TUNER]); in mt8186_apll2_disable()
488 clk_disable_unprepare(afe_priv->clk[CLK_APLL24M]); in mt8186_apll2_disable()
542 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_mck_enable() local
552 ret = clk_prepare_enable(afe_priv->clk[m_sel_id]); in mt8186_mck_enable()
558 ret = clk_set_parent(afe_priv->clk[m_sel_id], in mt8186_mck_enable()
559 afe_priv->clk[apll_clk_id]); in mt8186_mck_enable()
569 ret = clk_prepare_enable(afe_priv->clk[div_clk_id]); in mt8186_mck_enable()
575 ret = clk_set_rate(afe_priv->clk[div_clk_id], rate); in mt8186_mck_enable()
587 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_mck_disable() local
591 clk_disable_unprepare(afe_priv->clk[div_clk_id]); in mt8186_mck_disable()
593 clk_disable_unprepare(afe_priv->clk[m_sel_id]); in mt8186_mck_disable()
598 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_init_clock() local
604 afe_priv->clk = devm_kcalloc(afe->dev, CLK_NUM, sizeof(*afe_priv->clk), in mt8186_init_clock()
606 if (!afe_priv->clk) in mt8186_init_clock()
610 afe_priv->clk[i] = devm_clk_get(afe->dev, aud_clks[i]); in mt8186_init_clock()
611 if (IS_ERR(afe_priv->clk[i])) { in mt8186_init_clock()
614 aud_clks[i], PTR_ERR(afe_priv->clk[i])); in mt8186_init_clock()
615 afe_priv->clk[i] = NULL; in mt8186_init_clock()
619 afe_priv->apmixedsys = syscon_regmap_lookup_by_phandle(of_node, in mt8186_init_clock()
621 if (IS_ERR(afe_priv->apmixedsys)) { in mt8186_init_clock()
623 __func__, PTR_ERR(afe_priv->apmixedsys)); in mt8186_init_clock()
624 return PTR_ERR(afe_priv->apmixedsys); in mt8186_init_clock()
627 afe_priv->topckgen = syscon_regmap_lookup_by_phandle(of_node, in mt8186_init_clock()
629 if (IS_ERR(afe_priv->topckgen)) { in mt8186_init_clock()
631 __func__, PTR_ERR(afe_priv->topckgen)); in mt8186_init_clock()
632 return PTR_ERR(afe_priv->topckgen); in mt8186_init_clock()
635 afe_priv->infracfg = syscon_regmap_lookup_by_phandle(of_node, in mt8186_init_clock()
637 if (IS_ERR(afe_priv->infracfg)) { in mt8186_init_clock()
639 __func__, PTR_ERR(afe_priv->infracfg)); in mt8186_init_clock()
640 return PTR_ERR(afe_priv->infracfg); in mt8186_init_clock()