Lines Matching full:afe

13 #include "mt8365-afe-clk.h"
14 #include "mt8365-afe-common.h"
52 static void audio_dmic_adda_enable(struct mtk_base_afe *afe) in audio_dmic_adda_enable() argument
54 mt8365_dai_enable_adda_on(afe); in audio_dmic_adda_enable()
55 regmap_update_bits(afe->regmap, AFE_ADDA_UL_DL_CON0, in audio_dmic_adda_enable()
60 static void audio_dmic_adda_disable(struct mtk_base_afe *afe) in audio_dmic_adda_disable() argument
62 regmap_update_bits(afe->regmap, AFE_ADDA_UL_DL_CON0, in audio_dmic_adda_disable()
65 mt8365_dai_disable_adda_on(afe); in audio_dmic_adda_disable()
68 static void mt8365_dai_enable_dmic(struct mtk_base_afe *afe, in mt8365_dai_enable_dmic() argument
72 struct mt8365_afe_private *afe_priv = afe->platform_priv; in mt8365_dai_enable_dmic()
85 regmap_update_bits(afe->regmap, reg, val_mask, val_mask); in mt8365_dai_enable_dmic()
88 static void mt8365_dai_disable_dmic(struct mtk_base_afe *afe, in mt8365_dai_disable_dmic() argument
92 struct mt8365_afe_private *afe_priv = afe->platform_priv; in mt8365_dai_disable_dmic()
100 dev_dbg(afe->dev, "%s dmic_channel %d\n", __func__, dmic_data->dmic_channel); in mt8365_dai_disable_dmic()
108 regmap_update_bits(afe->regmap, reg, mask, 0); in mt8365_dai_disable_dmic()
111 static int mt8365_dai_configure_dmic(struct mtk_base_afe *afe, in mt8365_dai_configure_dmic() argument
115 struct mt8365_afe_private *afe_priv = afe->platform_priv; in mt8365_dai_configure_dmic()
157 regmap_update_bits(afe->regmap, reg, DMIC_TOP_CON_CONFIG_MASK, val); in mt8365_dai_configure_dmic()
165 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mt8365_dai_dmic_startup() local
167 mt8365_afe_enable_main_clk(afe); in mt8365_dai_dmic_startup()
169 mt8365_afe_enable_top_cg(afe, MT8365_TOP_CG_DMIC0_ADC); in mt8365_dai_dmic_startup()
170 mt8365_afe_enable_top_cg(afe, MT8365_TOP_CG_DMIC1_ADC); in mt8365_dai_dmic_startup()
171 mt8365_afe_enable_top_cg(afe, MT8365_TOP_CG_DMIC2_ADC); in mt8365_dai_dmic_startup()
172 mt8365_afe_enable_top_cg(afe, MT8365_TOP_CG_DMIC3_ADC); in mt8365_dai_dmic_startup()
174 audio_dmic_adda_enable(afe); in mt8365_dai_dmic_startup()
182 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mt8365_dai_dmic_shutdown() local
184 mt8365_dai_disable_dmic(afe, substream, dai); in mt8365_dai_dmic_shutdown()
185 audio_dmic_adda_disable(afe); in mt8365_dai_dmic_shutdown()
188 mt8365_afe_disable_top_cg(afe, MT8365_TOP_CG_DMIC3_ADC); in mt8365_dai_dmic_shutdown()
189 mt8365_afe_disable_top_cg(afe, MT8365_TOP_CG_DMIC2_ADC); in mt8365_dai_dmic_shutdown()
190 mt8365_afe_disable_top_cg(afe, MT8365_TOP_CG_DMIC1_ADC); in mt8365_dai_dmic_shutdown()
191 mt8365_afe_disable_top_cg(afe, MT8365_TOP_CG_DMIC0_ADC); in mt8365_dai_dmic_shutdown()
193 mt8365_afe_disable_main_clk(afe); in mt8365_dai_dmic_shutdown()
199 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mt8365_dai_dmic_prepare() local
201 mt8365_dai_configure_dmic(afe, substream, dai); in mt8365_dai_dmic_prepare()
202 mt8365_dai_enable_dmic(afe, substream, dai); in mt8365_dai_dmic_prepare()
265 static int init_dmic_priv_data(struct mtk_base_afe *afe) in init_dmic_priv_data() argument
267 struct mt8365_afe_private *afe_priv = afe->platform_priv; in init_dmic_priv_data()
269 struct device_node *np = afe->dev->of_node; in init_dmic_priv_data()
273 dmic_priv = devm_kzalloc(afe->dev, sizeof(*dmic_priv), GFP_KERNEL); in init_dmic_priv_data()
292 int mt8365_dai_dmic_register(struct mtk_base_afe *afe) in mt8365_dai_dmic_register() argument
296 dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); in mt8365_dai_dmic_register()
300 list_add(&dai->list, &afe->sub_dais); in mt8365_dai_dmic_register()
309 return init_dmic_priv_data(afe); in mt8365_dai_dmic_register()