Lines Matching full:afe

10 #include "mt8186-afe-clk.h"
11 #include "mt8186-afe-common.h"
12 #include "mt8186-afe-gpio.h"
44 static struct mtk_afe_adda_priv *get_adda_priv_by_name(struct mtk_base_afe *afe, in get_adda_priv_by_name() argument
47 struct mt8186_afe_private *afe_priv = afe->platform_priv; in get_adda_priv_by_name()
122 static int mtk_adda_ul_src_dmic(struct mtk_base_afe *afe, int id) in mtk_adda_ul_src_dmic() argument
136 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
138 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
142 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
145 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
148 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
160 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_ul_event() local
161 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_adda_ul_event()
164 dev_dbg(afe->dev, "%s(), name %s, event 0x%x, mtkaif_dmic %d\n", in mtk_adda_ul_event()
169 mt8186_afe_gpio_request(afe->dev, true, MT8186_DAI_ADDA, 1); in mtk_adda_ul_event()
174 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG0, in mtk_adda_ul_event()
178 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG0, in mtk_adda_ul_event()
181 mtk_adda_ul_src_dmic(afe, MT8186_DAI_ADDA); in mtk_adda_ul_event()
185 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_ul_event()
187 mt8186_afe_gpio_request(afe->dev, false, MT8186_DAI_ADDA, 1); in mtk_adda_ul_event()
201 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_pad_top_event() local
202 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_adda_pad_top_event()
207 regmap_write(afe->regmap, AFE_AUD_PAD_TOP, 0x39); in mtk_adda_pad_top_event()
209 regmap_write(afe->regmap, AFE_AUD_PAD_TOP, 0x31); in mtk_adda_pad_top_event()
223 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_mtkaif_cfg_event() local
224 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_adda_mtkaif_cfg_event()
232 regmap_write(afe->regmap, AFE_ADDA_MTKAIF_CFG0, 0x10000); in mtk_adda_mtkaif_cfg_event()
234 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_CFG0, in mtk_adda_mtkaif_cfg_event()
241 dev_err(afe->dev, in mtk_adda_mtkaif_cfg_event()
251 dev_err(afe->dev, in mtk_adda_mtkaif_cfg_event()
272 regmap_update_bits(afe->regmap, in mtk_adda_mtkaif_cfg_event()
278 regmap_update_bits(afe->regmap, in mtk_adda_mtkaif_cfg_event()
285 regmap_write(afe->regmap, AFE_ADDA_MTKAIF_CFG0, 0x10000); in mtk_adda_mtkaif_cfg_event()
287 regmap_write(afe->regmap, AFE_ADDA_MTKAIF_CFG0, 0); in mtk_adda_mtkaif_cfg_event()
303 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_dl_event() local
305 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_dl_event()
310 mt8186_afe_gpio_request(afe->dev, true, MT8186_DAI_ADDA, 0); in mtk_adda_dl_event()
313 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_dl_event()
315 mt8186_afe_gpio_request(afe->dev, false, MT8186_DAI_ADDA, 0); in mtk_adda_dl_event()
328 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8186_adda_dmic_get() local
329 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_adda_dmic_get()
340 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8186_adda_dmic_set() local
341 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_adda_dmic_set()
346 dev_dbg(afe->dev, "%s(), kcontrol name %s, dmic_on %d\n", in mt8186_adda_dmic_set()
456 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_dac_hires_connect() local
459 adda_priv = get_adda_priv_by_name(afe, w->name); in mtk_afe_dac_hires_connect()
462 dev_err(afe->dev, "%s(), adda_priv == NULL", __func__); in mtk_afe_dac_hires_connect()
474 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_adc_hires_connect() local
477 adda_priv = get_adda_priv_by_name(afe, w->name); in mtk_afe_adc_hires_connect()
480 dev_err(afe->dev, "%s(), adda_priv == NULL", __func__); in mtk_afe_adc_hires_connect()
559 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_dai_adda_hw_params() local
560 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_dai_adda_hw_params()
565 dev_dbg(afe->dev, "%s(), id %d, stream %d, rate %d\n", in mtk_dai_adda_hw_params()
575 dl_src2_con0 = mtk_adda_dl_rate_transform(afe, rate) << in mtk_dai_adda_hw_params()
598 regmap_write(afe->regmap, AFE_ADDA_PREDIS_CON0, 0); in mtk_dai_adda_hw_params()
599 regmap_write(afe->regmap, AFE_ADDA_PREDIS_CON1, 0); in mtk_dai_adda_hw_params()
601 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
603 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
607 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
614 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
618 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
622 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
628 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
631 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
638 unsigned int voice_mode = mtk_adda_ul_rate_transform(afe, rate); in mtk_dai_adda_hw_params()
652 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
654 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
656 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
658 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
660 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
663 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
667 regmap_update_bits(afe->regmap, AFE_ADDA_TOP_CON0, BIT(0), 0); in mtk_dai_adda_hw_params()
670 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG0, BIT(0), 0); in mtk_dai_adda_hw_params()
679 mtk_adda_ul_src_dmic(afe, id); in mtk_dai_adda_hw_params()
743 int mt8186_dai_adda_register(struct mtk_base_afe *afe) in mt8186_dai_adda_register() argument
746 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_dai_adda_register()
749 dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); in mt8186_dai_adda_register()
753 list_add(&dai->list, &afe->sub_dais); in mt8186_dai_adda_register()
766 ret = mt8186_dai_set_priv(afe, MT8186_DAI_ADDA, in mt8186_dai_adda_register()