Lines Matching refs:afe
99 static unsigned int mtk_get_src_freq_mode(struct mtk_base_afe *afe, int rate) in mtk_get_src_freq_mode() argument
129 dev_err(afe->dev, "%s(), rate %d invalid!!!\n", in mtk_get_src_freq_mode()
171 static int mtk_set_src_1_param(struct mtk_base_afe *afe, int id) in mtk_set_src_1_param() argument
173 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_set_src_1_param()
179 unsigned int out_freq_mode = mtk_get_src_freq_mode(afe, rate_out); in mtk_set_src_1_param()
180 unsigned int in_freq_mode = mtk_get_src_freq_mode(afe, rate_in); in mtk_set_src_1_param()
183 regmap_update_bits(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON3, in mtk_set_src_1_param()
188 regmap_update_bits(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON4, in mtk_set_src_1_param()
192 regmap_write(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON5, 0x3f5986); in mtk_set_src_1_param()
193 regmap_write(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON5, 0x3f5987); in mtk_set_src_1_param()
194 regmap_write(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON6, 0x1fbd); in mtk_set_src_1_param()
195 regmap_write(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON2, 0); in mtk_set_src_1_param()
204 dev_err(afe->dev, "%s(), iir coeff error, num %d, coeff %p\n", in mtk_set_src_1_param()
210 regmap_update_bits(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON0, in mtk_set_src_1_param()
214 regmap_update_bits(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON13, in mtk_set_src_1_param()
218 regmap_write(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON12, in mtk_set_src_1_param()
221 regmap_update_bits(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON0, in mtk_set_src_1_param()
225 regmap_update_bits(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON2, in mtk_set_src_1_param()
229 regmap_update_bits(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON2, in mtk_set_src_1_param()
234 regmap_update_bits(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON2, in mtk_set_src_1_param()
241 static int mtk_set_src_2_param(struct mtk_base_afe *afe, int id) in mtk_set_src_2_param() argument
243 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_set_src_2_param()
249 unsigned int out_freq_mode = mtk_get_src_freq_mode(afe, rate_out); in mtk_set_src_2_param()
250 unsigned int in_freq_mode = mtk_get_src_freq_mode(afe, rate_in); in mtk_set_src_2_param()
253 regmap_update_bits(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON3, in mtk_set_src_2_param()
258 regmap_update_bits(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON4, in mtk_set_src_2_param()
262 regmap_write(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON5, 0x3f5986); in mtk_set_src_2_param()
263 regmap_write(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON5, 0x3f5987); in mtk_set_src_2_param()
264 regmap_write(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON6, 0x1fbd); in mtk_set_src_2_param()
265 regmap_write(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON2, 0); in mtk_set_src_2_param()
274 dev_err(afe->dev, "%s(), iir coeff error, num %d, coeff %p\n", in mtk_set_src_2_param()
280 regmap_update_bits(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON0, in mtk_set_src_2_param()
284 regmap_update_bits(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON13, in mtk_set_src_2_param()
288 regmap_write(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON12, in mtk_set_src_2_param()
291 regmap_update_bits(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON0, in mtk_set_src_2_param()
295 regmap_update_bits(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON2, in mtk_set_src_2_param()
299 regmap_update_bits(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON2, in mtk_set_src_2_param()
304 regmap_update_bits(afe->regmap, AFE_GENERAL2_ASRC_2CH_CON2, in mtk_set_src_2_param()
319 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_hw_src_event() local
320 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_hw_src_event()
332 dev_dbg(afe->dev, in mtk_hw_src_event()
340 mtk_set_src_1_param(afe, id); in mtk_hw_src_event()
342 mtk_set_src_2_param(afe, id); in mtk_hw_src_event()
348 regmap_update_bits(afe->regmap, reg, in mtk_hw_src_event()
352 regmap_update_bits(afe->regmap, reg, in mtk_hw_src_event()
356 regmap_update_bits(afe->regmap, reg, in mtk_hw_src_event()
364 regmap_update_bits(afe->regmap, reg, G_SRC_ASM_ON_MASK_SFT, 0); in mtk_hw_src_event()
366 regmap_update_bits(afe->regmap, reg, G_SRC_CHSET_ON_MASK_SFT, 0); in mtk_hw_src_event()
368 regmap_update_bits(afe->regmap, reg, G_SRC_CHSET_STR_CLR_MASK_SFT, 0); in mtk_hw_src_event()
486 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_src_en_connect() local
487 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_afe_src_en_connect()
495 dev_dbg(afe->dev, in mtk_afe_src_en_connect()
551 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_dai_src_hw_params() local
552 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_dai_src_hw_params()
557 unsigned int rate_reg = mt8186_rate_transform(afe->dev, rate, id); in mtk_dai_src_hw_params()
559 dev_dbg(afe->dev, "%s(), id %d, stream %d, rate %d\n", in mtk_dai_src_hw_params()
583 regmap_update_bits(afe->regmap, GENERAL_ASRC_MODE, mask << sft, rate_reg << sft); in mtk_dai_src_hw_params()
591 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_dai_src_hw_free() local
592 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_dai_src_hw_free()
596 dev_dbg(afe->dev, "%s(), id %d, stream %d\n", in mtk_dai_src_hw_free()
664 int mt8186_dai_src_register(struct mtk_base_afe *afe) in mt8186_dai_src_register() argument
669 dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); in mt8186_dai_src_register()
673 list_add(&dai->list, &afe->sub_dais); in mt8186_dai_src_register()
684 ret = mt8186_dai_set_priv(afe, MT8186_DAI_SRC_1, in mt8186_dai_src_register()
689 ret = mt8186_dai_set_priv(afe, MT8186_DAI_SRC_2, in mt8186_dai_src_register()