Lines Matching full:afe
11 #include "mt8186-afe-clk.h"
12 #include "mt8186-afe-common.h"
13 #include "mt8186-afe-gpio.h"
104 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_tdm_en_event() local
105 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_tdm_en_event()
114 mt8186_afe_gpio_request(afe->dev, true, tdm_priv->id, 0); in mtk_tdm_en_event()
117 mt8186_afe_gpio_request(afe->dev, false, tdm_priv->id, 0); in mtk_tdm_en_event()
131 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_tdm_mck_en_event() local
132 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_tdm_mck_en_event()
141 mt8186_mck_enable(afe, tdm_priv->mclk_id, tdm_priv->mclk_rate); in mtk_tdm_mck_en_event()
145 mt8186_mck_disable(afe, tdm_priv->mclk_id); in mtk_tdm_mck_en_event()
203 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_tdm_mclk_connect() local
204 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_afe_tdm_mclk_connect()
216 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_tdm_mclk_apll_connect() local
217 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_afe_tdm_mclk_apll_connect()
223 cur_apll = mt8186_get_apll_by_name(afe, source->name); in mtk_afe_tdm_mclk_apll_connect()
233 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_tdm_hd_connect() local
234 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_afe_tdm_hd_connect()
246 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_tdm_apll_connect() local
247 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_afe_tdm_apll_connect()
254 cur_apll = mt8186_get_apll_by_name(afe, source->name); in mtk_afe_tdm_apll_connect()
257 tdm_need_apll = mt8186_get_apll_by_rate(afe, tdm_priv->rate); in mtk_afe_tdm_apll_connect()
276 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8186_tdm_hd_get() local
277 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_tdm_hd_get()
290 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8186_tdm_hd_set() local
291 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_tdm_hd_set()
302 dev_dbg(afe->dev, "%s(), kcontrol name %s, hd_en %d\n", in mt8186_tdm_hd_set()
335 static int mtk_dai_tdm_cal_mclk(struct mtk_base_afe *afe, in mtk_dai_tdm_cal_mclk() argument
342 apll = mt8186_get_apll_by_rate(afe, freq); in mtk_dai_tdm_cal_mclk()
343 apll_rate = mt8186_get_apll_rate(afe, apll); in mtk_dai_tdm_cal_mclk()
346 dev_err(afe->dev, in mtk_dai_tdm_cal_mclk()
352 dev_err(afe->dev, in mtk_dai_tdm_cal_mclk()
367 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_dai_tdm_hw_params() local
368 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_dai_tdm_hw_params()
390 tran_rate = mt8186_rate_transform(afe->dev, rate, dai->id); in mtk_dai_tdm_hw_params()
391 tran_relatch_rate = mt8186_tdm_relatch_rate_transform(afe->dev, rate); in mtk_dai_tdm_hw_params()
396 mtk_dai_tdm_cal_mclk(afe, tdm_priv, tdm_priv->mclk_rate); in mtk_dai_tdm_hw_params()
409 regmap_update_bits(afe->regmap, ETDM_IN1_CON0, ETDM_IN_CON0_CTRL_MASK, tdm_con); in mtk_dai_tdm_hw_params()
416 regmap_update_bits(afe->regmap, ETDM_IN1_CON1, ETDM_IN_CON1_CTRL_MASK, tdm_con); in mtk_dai_tdm_hw_params()
420 regmap_update_bits(afe->regmap, ETDM_IN1_CON3, ETDM_IN_CON3_CTRL_MASK, tdm_con); in mtk_dai_tdm_hw_params()
435 regmap_update_bits(afe->regmap, ETDM_IN1_CON4, ETDM_IN_CON4_CTRL_MASK, tdm_con); in mtk_dai_tdm_hw_params()
443 regmap_update_bits(afe->regmap, ETDM_IN1_CON2, ETDM_IN_CON2_CTRL_MASK, tdm_con); in mtk_dai_tdm_hw_params()
454 regmap_update_bits(afe->regmap, ETDM_IN1_CON8, ETDM_IN_CON8_CTRL_MASK, tdm_con); in mtk_dai_tdm_hw_params()
462 struct mtk_base_afe *afe = dev_get_drvdata(dai->dev); in mtk_dai_tdm_set_sysclk() local
463 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_dai_tdm_set_sysclk()
467 dev_err(afe->dev, "%s(), dir != SND_SOC_CLOCK_OUT", __func__); in mtk_dai_tdm_set_sysclk()
471 dev_dbg(afe->dev, "%s(), freq %d\n", __func__, freq); in mtk_dai_tdm_set_sysclk()
473 return mtk_dai_tdm_cal_mclk(afe, tdm_priv, freq); in mtk_dai_tdm_set_sysclk()
478 struct mtk_base_afe *afe = dev_get_drvdata(dai->dev); in mtk_dai_tdm_set_fmt() local
479 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_dai_tdm_set_fmt()
505 dev_err(afe->dev, "%s(), invalid DAIFMT_FORMAT_MASK", __func__); in mtk_dai_tdm_set_fmt()
528 dev_err(afe->dev, "%s(), invalid DAIFMT_INV_MASK", __func__); in mtk_dai_tdm_set_fmt()
540 dev_err(afe->dev, "%s(), invalid DAIFMT_CLOCK_PROVIDER_MASK", in mtk_dai_tdm_set_fmt()
554 struct mtk_base_afe *afe = dev_get_drvdata(dai->dev); in mtk_dai_tdm_set_tdm_slot() local
555 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_dai_tdm_set_tdm_slot()
598 static struct mtk_afe_tdm_priv *init_tdm_priv_data(struct mtk_base_afe *afe) in init_tdm_priv_data() argument
602 tdm_priv = devm_kzalloc(afe->dev, sizeof(struct mtk_afe_tdm_priv), in init_tdm_priv_data()
614 int mt8186_dai_tdm_register(struct mtk_base_afe *afe) in mt8186_dai_tdm_register() argument
616 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_dai_tdm_register()
620 dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); in mt8186_dai_tdm_register()
624 list_add(&dai->list, &afe->sub_dais); in mt8186_dai_tdm_register()
636 tdm_priv = init_tdm_priv_data(afe); in mt8186_dai_tdm_register()