Lines Matching full:afe
12 #include "mt8192-afe-clk.h"
13 #include "mt8192-afe-common.h"
14 #include "mt8192-afe-gpio.h"
175 static int mtk_adda_ul_src_dmic(struct mtk_base_afe *afe, int id) in mtk_adda_ul_src_dmic() argument
193 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
196 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
201 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
204 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
207 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic()
218 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_ul_event() local
219 struct mt8192_afe_private *afe_priv = afe->platform_priv; in mtk_adda_ul_event()
224 mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 1); in mtk_adda_ul_event()
229 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG0, in mtk_adda_ul_event()
233 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG0, in mtk_adda_ul_event()
236 mtk_adda_ul_src_dmic(afe, MT8192_DAI_ADDA); in mtk_adda_ul_event()
240 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_ul_event()
242 mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA, 1); in mtk_adda_ul_event()
256 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_ch34_ul_event() local
257 struct mt8192_afe_private *afe_priv = afe->platform_priv; in mtk_adda_ch34_ul_event()
263 mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34, in mtk_adda_ch34_ul_event()
269 regmap_update_bits(afe->regmap, in mtk_adda_ch34_ul_event()
274 regmap_update_bits(afe->regmap, in mtk_adda_ch34_ul_event()
278 mtk_adda_ul_src_dmic(afe, MT8192_DAI_ADDA_CH34); in mtk_adda_ch34_ul_event()
286 regmap_update_bits(afe->regmap, in mtk_adda_ch34_ul_event()
292 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_ch34_ul_event()
294 mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA_CH34, in mtk_adda_ch34_ul_event()
301 regmap_update_bits(afe->regmap, in mtk_adda_ch34_ul_event()
318 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_pad_top_event() local
319 struct mt8192_afe_private *afe_priv = afe->platform_priv; in mtk_adda_pad_top_event()
324 regmap_write(afe->regmap, AFE_AUD_PAD_TOP, 0x38); in mtk_adda_pad_top_event()
326 regmap_write(afe->regmap, AFE_AUD_PAD_TOP, 0x30); in mtk_adda_pad_top_event()
340 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_mtkaif_cfg_event() local
341 struct mt8192_afe_private *afe_priv = afe->platform_priv; in mtk_adda_mtkaif_cfg_event()
349 regmap_write(afe->regmap, AFE_ADDA_MTKAIF_CFG0, in mtk_adda_mtkaif_cfg_event()
351 regmap_write(afe->regmap, AFE_ADDA6_MTKAIF_CFG0, in mtk_adda_mtkaif_cfg_event()
357 dev_warn(afe->dev, in mtk_adda_mtkaif_cfg_event()
365 dev_warn(afe->dev, in mtk_adda_mtkaif_cfg_event()
373 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_CFG0, in mtk_adda_mtkaif_cfg_event()
376 regmap_update_bits(afe->regmap, AFE_ADDA6_MTKAIF_CFG0, in mtk_adda_mtkaif_cfg_event()
392 regmap_update_bits(afe->regmap, in mtk_adda_mtkaif_cfg_event()
398 regmap_update_bits(afe->regmap, in mtk_adda_mtkaif_cfg_event()
416 regmap_update_bits(afe->regmap, in mtk_adda_mtkaif_cfg_event()
421 regmap_update_bits(afe->regmap, in mtk_adda_mtkaif_cfg_event()
427 regmap_write(afe->regmap, AFE_ADDA_MTKAIF_CFG0, in mtk_adda_mtkaif_cfg_event()
429 regmap_write(afe->regmap, AFE_ADDA6_MTKAIF_CFG0, in mtk_adda_mtkaif_cfg_event()
432 regmap_write(afe->regmap, AFE_ADDA_MTKAIF_CFG0, 0x0); in mtk_adda_mtkaif_cfg_event()
433 regmap_write(afe->regmap, AFE_ADDA6_MTKAIF_CFG0, 0x0); in mtk_adda_mtkaif_cfg_event()
448 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_dl_event() local
452 mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 0); in mtk_adda_dl_event()
455 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_dl_event()
457 mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA, 0); in mtk_adda_dl_event()
471 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_ch34_dl_event() local
475 mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34, in mtk_adda_ch34_dl_event()
479 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_ch34_dl_event()
481 mt8192_afe_gpio_request(afe->dev, false, MT8192_DAI_ADDA_CH34, in mtk_adda_ch34_dl_event()
496 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in stf_positive_gain_get() local
497 struct mt8192_afe_private *afe_priv = afe->platform_priv; in stf_positive_gain_get()
507 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in stf_positive_gain_set() local
508 struct mt8192_afe_private *afe_priv = afe->platform_priv; in stf_positive_gain_set()
515 regmap_update_bits_check(afe->regmap, in stf_positive_gain_set()
531 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8192_adda_dmic_get() local
532 struct mt8192_afe_private *afe_priv = afe->platform_priv; in mt8192_adda_dmic_get()
542 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8192_adda_dmic_set() local
543 struct mt8192_afe_private *afe_priv = afe->platform_priv; in mt8192_adda_dmic_set()
562 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8192_adda6_only_get() local
563 struct mt8192_afe_private *afe_priv = afe->platform_priv; in mt8192_adda6_only_get()
573 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8192_adda6_only_set() local
574 struct mt8192_afe_private *afe_priv = afe->platform_priv; in mt8192_adda6_only_set()
636 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_stf_event() local
643 regmap_read(afe->regmap, AFE_ADDA_UL_SRC_CON0, &ul_rate); in mtk_stf_event()
658 regmap_read(afe->regmap, AFE_SIDETONE_CON1, ®_value); in mtk_stf_event()
663 regmap_update_bits(afe->regmap, in mtk_stf_event()
667 regmap_update_bits(afe->regmap, in mtk_stf_event()
672 regmap_update_bits(afe->regmap, in mtk_stf_event()
677 regmap_update_bits(afe->regmap, in mtk_stf_event()
683 regmap_read(afe->regmap, AFE_SIDETONE_CON0, ®_value); in mtk_stf_event()
689 regmap_update_bits(afe->regmap, in mtk_stf_event()
701 regmap_read(afe->regmap, in mtk_stf_event()
709 dev_warn(afe->dev, in mtk_stf_event()
718 regmap_update_bits(afe->regmap, in mtk_stf_event()
726 regmap_update_bits(afe->regmap, in mtk_stf_event()
732 regmap_update_bits(afe->regmap, in mtk_stf_event()
736 regmap_update_bits(afe->regmap, in mtk_stf_event()
1066 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_dai_adda_hw_params() local
1075 dl_src2_con0 = mtk_adda_dl_rate_transform(afe, rate) << in mtk_dai_adda_hw_params()
1098 regmap_write(afe->regmap, AFE_ADDA_PREDIS_CON0, 0); in mtk_dai_adda_hw_params()
1099 regmap_write(afe->regmap, AFE_ADDA_PREDIS_CON1, 0); in mtk_dai_adda_hw_params()
1101 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1103 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1107 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
1114 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
1120 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1123 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
1129 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1131 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1134 regmap_write(afe->regmap, AFE_ADDA_3RD_DAC_DL_SRC2_CON0, in mtk_dai_adda_hw_params()
1136 regmap_write(afe->regmap, AFE_ADDA_3RD_DAC_DL_SRC2_CON1, in mtk_dai_adda_hw_params()
1140 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
1147 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
1153 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1156 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
1165 voice_mode = mtk_adda_ul_rate_transform(afe, rate); in mtk_dai_adda_hw_params()
1179 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1181 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1183 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1185 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1187 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1190 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1194 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
1200 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
1208 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1210 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1212 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1214 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1216 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1219 regmap_write(afe->regmap, in mtk_dai_adda_hw_params()
1223 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
1229 regmap_update_bits(afe->regmap, in mtk_dai_adda_hw_params()
1242 mtk_adda_ul_src_dmic(afe, id); in mtk_dai_adda_hw_params()
1337 int mt8192_dai_adda_register(struct mtk_base_afe *afe) in mt8192_dai_adda_register() argument
1340 struct mt8192_afe_private *afe_priv = afe->platform_priv; in mt8192_dai_adda_register()
1342 dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); in mt8192_dai_adda_register()
1346 list_add(&dai->list, &afe->sub_dais); in mt8192_dai_adda_register()