Lines Matching refs:afe
72 static struct mtk_afe_adda_priv *get_adda_priv_by_name(struct mtk_base_afe *afe, in get_adda_priv_by_name() argument
75 struct mt8186_afe_private *afe_priv = afe->platform_priv; in get_adda_priv_by_name()
86 static unsigned int adda_dl_rate_transform(struct mtk_base_afe *afe, in adda_dl_rate_transform() argument
113 dev_dbg(afe->dev, "%s(), rate %d invalid, use 48kHz!!!\n", in adda_dl_rate_transform()
120 static unsigned int adda_ul_rate_transform(struct mtk_base_afe *afe, in adda_ul_rate_transform() argument
137 dev_dbg(afe->dev, "%s(), rate %d invalid, use 48kHz!!!\n", in adda_ul_rate_transform()
208 static int mtk_adda_ul_src_dmic(struct mtk_base_afe *afe, int id) in mtk_adda_ul_src_dmic() argument
222 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
224 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
228 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
231 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
234 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
246 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_ul_event() local
247 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_adda_ul_event()
250 dev_dbg(afe->dev, "%s(), name %s, event 0x%x, mtkaif_dmic %d\n", in mtk_adda_ul_event()
255 mt8186_afe_gpio_request(afe->dev, true, MT8186_DAI_ADDA, 1); in mtk_adda_ul_event()
260 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG0, in mtk_adda_ul_event()
264 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG0, in mtk_adda_ul_event()
267 mtk_adda_ul_src_dmic(afe, MT8186_DAI_ADDA); in mtk_adda_ul_event()
273 mt8186_afe_gpio_request(afe->dev, false, MT8186_DAI_ADDA, 1); in mtk_adda_ul_event()
287 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_pad_top_event() local
288 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_adda_pad_top_event()
293 regmap_write(afe->regmap, AFE_AUD_PAD_TOP, 0x39); in mtk_adda_pad_top_event()
295 regmap_write(afe->regmap, AFE_AUD_PAD_TOP, 0x31); in mtk_adda_pad_top_event()
309 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_mtkaif_cfg_event() local
310 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_adda_mtkaif_cfg_event()
318 regmap_write(afe->regmap, AFE_ADDA_MTKAIF_CFG0, 0x10000); in mtk_adda_mtkaif_cfg_event()
320 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_CFG0, in mtk_adda_mtkaif_cfg_event()
327 dev_err(afe->dev, in mtk_adda_mtkaif_cfg_event()
337 dev_err(afe->dev, in mtk_adda_mtkaif_cfg_event()
358 regmap_update_bits(afe->regmap, in mtk_adda_mtkaif_cfg_event()
364 regmap_update_bits(afe->regmap, in mtk_adda_mtkaif_cfg_event()
371 regmap_write(afe->regmap, AFE_ADDA_MTKAIF_CFG0, 0x10000); in mtk_adda_mtkaif_cfg_event()
373 regmap_write(afe->regmap, AFE_ADDA_MTKAIF_CFG0, 0); in mtk_adda_mtkaif_cfg_event()
389 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_dl_event() local
391 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_dl_event()
396 mt8186_afe_gpio_request(afe->dev, true, MT8186_DAI_ADDA, 0); in mtk_adda_dl_event()
401 mt8186_afe_gpio_request(afe->dev, false, MT8186_DAI_ADDA, 0); in mtk_adda_dl_event()
414 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8186_adda_dmic_get() local
415 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_adda_dmic_get()
426 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8186_adda_dmic_set() local
427 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_adda_dmic_set()
432 dev_dbg(afe->dev, "%s(), kcontrol name %s, dmic_on %d\n", in mt8186_adda_dmic_set()
542 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_dac_hires_connect() local
545 adda_priv = get_adda_priv_by_name(afe, w->name); in mtk_afe_dac_hires_connect()
548 dev_err(afe->dev, "%s(), adda_priv == NULL", __func__); in mtk_afe_dac_hires_connect()
560 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_adc_hires_connect() local
563 adda_priv = get_adda_priv_by_name(afe, w->name); in mtk_afe_adc_hires_connect()
566 dev_err(afe->dev, "%s(), adda_priv == NULL", __func__); in mtk_afe_adc_hires_connect()
645 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_dai_adda_hw_params() local
646 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_dai_adda_hw_params()
651 dev_dbg(afe->dev, "%s(), id %d, stream %d, rate %d\n", in mtk_dai_adda_hw_params()
661 dl_src2_con0 = adda_dl_rate_transform(afe, rate) << in mtk_dai_adda_hw_params()
684 regmap_write(afe->regmap, AFE_ADDA_PREDIS_CON0, 0); in mtk_dai_adda_hw_params()
685 regmap_write(afe->regmap, AFE_ADDA_PREDIS_CON1, 0); in mtk_dai_adda_hw_params()
687 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
689 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
693 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
700 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
704 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
708 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
714 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
717 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
724 unsigned int voice_mode = adda_ul_rate_transform(afe, rate); in mtk_dai_adda_hw_params()
738 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
740 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
742 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
744 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
746 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
749 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
753 regmap_update_bits(afe->regmap, AFE_ADDA_TOP_CON0, BIT(0), 0); in mtk_dai_adda_hw_params()
756 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG0, BIT(0), 0); in mtk_dai_adda_hw_params()
765 mtk_adda_ul_src_dmic(afe, id); in mtk_dai_adda_hw_params()
829 int mt8186_dai_adda_register(struct mtk_base_afe *afe) in mt8186_dai_adda_register() argument
832 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_dai_adda_register()
835 dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); in mt8186_dai_adda_register()
839 list_add(&dai->list, &afe->sub_dais); in mt8186_dai_adda_register()
852 ret = mt8186_dai_set_priv(afe, MT8186_DAI_ADDA, in mt8186_dai_adda_register()