Lines Matching refs:afe_priv
78 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_set_audio_int_bus_parent() local
81 ret = clk_set_parent(afe_priv->clk[CLK_MUX_AUDIOINTBUS], in mt8186_set_audio_int_bus_parent()
82 afe_priv->clk[clk_id]); in mt8186_set_audio_int_bus_parent()
95 struct mt8186_afe_private *afe_priv = afe->platform_priv; in apll1_mux_setting() local
99 ret = clk_prepare_enable(afe_priv->clk[CLK_TOP_MUX_AUD_1]); in apll1_mux_setting()
105 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_1], in apll1_mux_setting()
106 afe_priv->clk[CLK_TOP_APLL1_CK]); in apll1_mux_setting()
115 ret = clk_prepare_enable(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1]); in apll1_mux_setting()
121 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1], in apll1_mux_setting()
122 afe_priv->clk[CLK_TOP_APLL1_D8]); in apll1_mux_setting()
130 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1], in apll1_mux_setting()
131 afe_priv->clk[CLK_CLK26M]); in apll1_mux_setting()
138 clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG1]); in apll1_mux_setting()
140 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_1], in apll1_mux_setting()
141 afe_priv->clk[CLK_CLK26M]); in apll1_mux_setting()
148 clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_1]); in apll1_mux_setting()
156 struct mt8186_afe_private *afe_priv = afe->platform_priv; in apll2_mux_setting() local
160 ret = clk_prepare_enable(afe_priv->clk[CLK_TOP_MUX_AUD_2]); in apll2_mux_setting()
166 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_2], in apll2_mux_setting()
167 afe_priv->clk[CLK_TOP_APLL2_CK]); in apll2_mux_setting()
176 ret = clk_prepare_enable(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2]); in apll2_mux_setting()
182 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2], in apll2_mux_setting()
183 afe_priv->clk[CLK_TOP_APLL2_D8]); in apll2_mux_setting()
191 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2], in apll2_mux_setting()
192 afe_priv->clk[CLK_CLK26M]); in apll2_mux_setting()
199 clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_ENG2]); in apll2_mux_setting()
201 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUD_2], in apll2_mux_setting()
202 afe_priv->clk[CLK_CLK26M]); in apll2_mux_setting()
209 clk_disable_unprepare(afe_priv->clk[CLK_TOP_MUX_AUD_2]); in apll2_mux_setting()
217 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_enable_cgs() local
222 ret = clk_prepare_enable(afe_priv->clk[i]); in mt8186_afe_enable_cgs()
235 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_disable_cgs() local
239 clk_disable_unprepare(afe_priv->clk[i]); in mt8186_afe_disable_cgs()
244 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_enable_clock() local
247 ret = clk_prepare_enable(afe_priv->clk[CLK_INFRA_SYS_AUDIO]); in mt8186_afe_enable_clock()
254 ret = clk_prepare_enable(afe_priv->clk[CLK_INFRA_AUDIO_26M]); in mt8186_afe_enable_clock()
261 ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIO]); in mt8186_afe_enable_clock()
267 ret = clk_set_parent(afe_priv->clk[CLK_MUX_AUDIO], in mt8186_afe_enable_clock()
268 afe_priv->clk[CLK_CLK26M]); in mt8186_afe_enable_clock()
276 ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_enable_clock()
287 ret = clk_set_parent(afe_priv->clk[CLK_TOP_MUX_AUDIO_H], in mt8186_afe_enable_clock()
288 afe_priv->clk[CLK_TOP_APLL2_CK]); in mt8186_afe_enable_clock()
296 ret = clk_prepare_enable(afe_priv->clk[CLK_AFE]); in mt8186_afe_enable_clock()
306 clk_disable_unprepare(afe_priv->clk[CLK_AFE]); in mt8186_afe_enable_clock()
311 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_enable_clock()
313 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIO]); in mt8186_afe_enable_clock()
315 clk_disable_unprepare(afe_priv->clk[CLK_INFRA_SYS_AUDIO]); in mt8186_afe_enable_clock()
317 clk_disable_unprepare(afe_priv->clk[CLK_INFRA_AUDIO_26M]); in mt8186_afe_enable_clock()
324 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_disable_clock() local
326 clk_disable_unprepare(afe_priv->clk[CLK_AFE]); in mt8186_afe_disable_clock()
328 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_disable_clock()
329 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIO]); in mt8186_afe_disable_clock()
330 clk_disable_unprepare(afe_priv->clk[CLK_INFRA_AUDIO_26M]); in mt8186_afe_disable_clock()
331 clk_disable_unprepare(afe_priv->clk[CLK_INFRA_SYS_AUDIO]); in mt8186_afe_disable_clock()
336 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_suspend_clock() local
340 ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_suspend_clock()
350 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_suspend_clock()
357 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_suspend_clock()
363 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_afe_resume_clock() local
367 ret = clk_prepare_enable(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_resume_clock()
378 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_resume_clock()
385 clk_disable_unprepare(afe_priv->clk[CLK_MUX_AUDIOINTBUS]); in mt8186_afe_resume_clock()
391 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_apll1_enable() local
397 ret = clk_prepare_enable(afe_priv->clk[CLK_APLL22M]); in mt8186_apll1_enable()
404 ret = clk_prepare_enable(afe_priv->clk[CLK_APLL1_TUNER]); in mt8186_apll1_enable()
420 clk_disable_unprepare(afe_priv->clk[CLK_APLL1_TUNER]); in mt8186_apll1_enable()
422 clk_disable_unprepare(afe_priv->clk[CLK_APLL22M]); in mt8186_apll1_enable()
429 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_apll1_disable() local
436 clk_disable_unprepare(afe_priv->clk[CLK_APLL1_TUNER]); in mt8186_apll1_disable()
437 clk_disable_unprepare(afe_priv->clk[CLK_APLL22M]); in mt8186_apll1_disable()
444 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_apll2_enable() local
450 ret = clk_prepare_enable(afe_priv->clk[CLK_APLL24M]); in mt8186_apll2_enable()
457 ret = clk_prepare_enable(afe_priv->clk[CLK_APLL2_TUNER]); in mt8186_apll2_enable()
473 clk_disable_unprepare(afe_priv->clk[CLK_APLL2_TUNER]); in mt8186_apll2_enable()
475 clk_disable_unprepare(afe_priv->clk[CLK_APLL24M]); in mt8186_apll2_enable()
482 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_apll2_disable() local
489 clk_disable_unprepare(afe_priv->clk[CLK_APLL2_TUNER]); in mt8186_apll2_disable()
490 clk_disable_unprepare(afe_priv->clk[CLK_APLL24M]); in mt8186_apll2_disable()
544 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_mck_enable() local
554 ret = clk_prepare_enable(afe_priv->clk[m_sel_id]); in mt8186_mck_enable()
560 ret = clk_set_parent(afe_priv->clk[m_sel_id], in mt8186_mck_enable()
561 afe_priv->clk[apll_clk_id]); in mt8186_mck_enable()
571 ret = clk_prepare_enable(afe_priv->clk[div_clk_id]); in mt8186_mck_enable()
577 ret = clk_set_rate(afe_priv->clk[div_clk_id], rate); in mt8186_mck_enable()
589 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_mck_disable() local
593 clk_disable_unprepare(afe_priv->clk[div_clk_id]); in mt8186_mck_disable()
595 clk_disable_unprepare(afe_priv->clk[m_sel_id]); in mt8186_mck_disable()
600 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_init_clock() local
606 afe_priv->clk = devm_kcalloc(afe->dev, CLK_NUM, sizeof(*afe_priv->clk), in mt8186_init_clock()
608 if (!afe_priv->clk) in mt8186_init_clock()
612 afe_priv->clk[i] = devm_clk_get(afe->dev, aud_clks[i]); in mt8186_init_clock()
613 if (IS_ERR(afe_priv->clk[i])) { in mt8186_init_clock()
616 aud_clks[i], PTR_ERR(afe_priv->clk[i])); in mt8186_init_clock()
617 afe_priv->clk[i] = NULL; in mt8186_init_clock()
621 afe_priv->apmixedsys = syscon_regmap_lookup_by_phandle(of_node, in mt8186_init_clock()
623 if (IS_ERR(afe_priv->apmixedsys)) { in mt8186_init_clock()
625 __func__, PTR_ERR(afe_priv->apmixedsys)); in mt8186_init_clock()
626 return PTR_ERR(afe_priv->apmixedsys); in mt8186_init_clock()
629 afe_priv->topckgen = syscon_regmap_lookup_by_phandle(of_node, in mt8186_init_clock()
631 if (IS_ERR(afe_priv->topckgen)) { in mt8186_init_clock()
633 __func__, PTR_ERR(afe_priv->topckgen)); in mt8186_init_clock()
634 return PTR_ERR(afe_priv->topckgen); in mt8186_init_clock()
637 afe_priv->infracfg = syscon_regmap_lookup_by_phandle(of_node, in mt8186_init_clock()
639 if (IS_ERR(afe_priv->infracfg)) { in mt8186_init_clock()
641 __func__, PTR_ERR(afe_priv->infracfg)); in mt8186_init_clock()
642 return PTR_ERR(afe_priv->infracfg); in mt8186_init_clock()