Lines Matching full:afe
3 * mt2701-afe-clock-ctrl.c -- Mediatek 2701 afe clock ctrl
10 #include "mt2701-afe-common.h"
11 #include "mt2701-afe-clock-ctrl.h"
25 int mt2701_init_clock(struct mtk_base_afe *afe) in mt2701_init_clock() argument
27 struct mt2701_afe_private *afe_priv = afe->platform_priv; in mt2701_init_clock()
31 afe_priv->base_ck[i] = devm_clk_get(afe->dev, base_clks[i]); in mt2701_init_clock()
33 dev_err(afe->dev, "failed to get %s\n", base_clks[i]); in mt2701_init_clock()
45 i2s_path->sel_ck = devm_clk_get(afe->dev, name); in mt2701_init_clock()
47 dev_err(afe->dev, "failed to get %s\n", name); in mt2701_init_clock()
52 i2s_path->div_ck = devm_clk_get(afe->dev, name); in mt2701_init_clock()
54 dev_err(afe->dev, "failed to get %s\n", name); in mt2701_init_clock()
59 i2s_path->mclk_ck = devm_clk_get(afe->dev, name); in mt2701_init_clock()
61 dev_err(afe->dev, "failed to get %s\n", name); in mt2701_init_clock()
66 i2s_ck = devm_clk_get(afe->dev, name); in mt2701_init_clock()
68 dev_err(afe->dev, "failed to get %s\n", name); in mt2701_init_clock()
74 i2s_ck = devm_clk_get(afe->dev, name); in mt2701_init_clock()
76 dev_err(afe->dev, "failed to get %s\n", name); in mt2701_init_clock()
82 i2s_path->asrco_ck = devm_clk_get(afe->dev, name); in mt2701_init_clock()
84 dev_err(afe->dev, "failed to get %s\n", name); in mt2701_init_clock()
90 afe_priv->mrgif_ck = devm_clk_get(afe->dev, "audio_mrgif_pd"); in mt2701_init_clock()
101 int mt2701_afe_enable_i2s(struct mtk_base_afe *afe, in mt2701_afe_enable_i2s() argument
109 dev_err(afe->dev, "failed to enable ASRC clock %d\n", ret); in mt2701_afe_enable_i2s()
115 dev_err(afe->dev, "failed to enable I2S clock %d\n", ret); in mt2701_afe_enable_i2s()
127 void mt2701_afe_disable_i2s(struct mtk_base_afe *afe, in mt2701_afe_disable_i2s() argument
135 int mt2701_afe_enable_mclk(struct mtk_base_afe *afe, int id) in mt2701_afe_enable_mclk() argument
137 struct mt2701_afe_private *afe_priv = afe->platform_priv; in mt2701_afe_enable_mclk()
143 void mt2701_afe_disable_mclk(struct mtk_base_afe *afe, int id) in mt2701_afe_disable_mclk() argument
145 struct mt2701_afe_private *afe_priv = afe->platform_priv; in mt2701_afe_disable_mclk()
151 int mt2701_enable_btmrg_clk(struct mtk_base_afe *afe) in mt2701_enable_btmrg_clk() argument
153 struct mt2701_afe_private *afe_priv = afe->platform_priv; in mt2701_enable_btmrg_clk()
158 void mt2701_disable_btmrg_clk(struct mtk_base_afe *afe) in mt2701_disable_btmrg_clk() argument
160 struct mt2701_afe_private *afe_priv = afe->platform_priv; in mt2701_disable_btmrg_clk()
165 static int mt2701_afe_enable_audsys(struct mtk_base_afe *afe) in mt2701_afe_enable_audsys() argument
167 struct mt2701_afe_private *afe_priv = afe->platform_priv; in mt2701_afe_enable_audsys()
220 static void mt2701_afe_disable_audsys(struct mtk_base_afe *afe) in mt2701_afe_disable_audsys() argument
222 struct mt2701_afe_private *afe_priv = afe->platform_priv; in mt2701_afe_disable_audsys()
233 int mt2701_afe_enable_clock(struct mtk_base_afe *afe) in mt2701_afe_enable_clock() argument
238 ret = mt2701_afe_enable_audsys(afe); in mt2701_afe_enable_clock()
240 dev_err(afe->dev, "failed to enable audio system %d\n", ret); in mt2701_afe_enable_clock()
244 regmap_update_bits(afe->regmap, ASYS_TOP_CON, in mt2701_afe_enable_clock()
247 regmap_update_bits(afe->regmap, AFE_DAC_CON0, in mt2701_afe_enable_clock()
252 regmap_write(afe->regmap, PWR1_ASM_CON1, PWR1_ASM_CON1_INIT_VAL); in mt2701_afe_enable_clock()
253 regmap_write(afe->regmap, PWR2_ASM_CON1, PWR2_ASM_CON1_INIT_VAL); in mt2701_afe_enable_clock()
258 int mt2701_afe_disable_clock(struct mtk_base_afe *afe) in mt2701_afe_disable_clock() argument
260 regmap_update_bits(afe->regmap, ASYS_TOP_CON, in mt2701_afe_disable_clock()
262 regmap_update_bits(afe->regmap, AFE_DAC_CON0, in mt2701_afe_disable_clock()
265 mt2701_afe_disable_audsys(afe); in mt2701_afe_disable_clock()
270 int mt2701_mclk_configuration(struct mtk_base_afe *afe, int id) in mt2701_mclk_configuration() argument
273 struct mt2701_afe_private *priv = afe->platform_priv; in mt2701_mclk_configuration()
286 dev_err(afe->dev, "failed to set mclk source\n"); in mt2701_mclk_configuration()
293 dev_err(afe->dev, "failed to set mclk divider %d\n", ret); in mt2701_mclk_configuration()