Lines Matching full:afe
14 #include "mt8188-afe-clk.h"
15 #include "mt8188-afe-common.h"
59 static unsigned int afe_adda_dl_rate_transform(struct mtk_base_afe *afe, in afe_adda_dl_rate_transform() argument
86 dev_info(afe->dev, "%s(), rate %u invalid, use 48kHz!!!\n", in afe_adda_dl_rate_transform()
92 static unsigned int afe_adda_ul_rate_transform(struct mtk_base_afe *afe, in afe_adda_ul_rate_transform() argument
109 dev_info(afe->dev, "%s(), rate %u invalid, use 48kHz!!!\n", in afe_adda_ul_rate_transform()
115 static int mt8188_adda_mtkaif_init(struct mtk_base_afe *afe) in mt8188_adda_mtkaif_init() argument
117 struct mt8188_afe_private *afe_priv = afe->platform_priv; in mt8188_adda_mtkaif_init()
125 regmap_set_bits(afe->regmap, AFE_ADDA_MTKAIF_CFG0, in mt8188_adda_mtkaif_init()
128 regmap_set_bits(afe->regmap, AFE_AUD_PAD_TOP, RG_RX_PROTOCOL2); in mt8188_adda_mtkaif_init()
131 dev_info(afe->dev, "%s(), calibration fail\n", __func__); in mt8188_adda_mtkaif_init()
153 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG2, mask, val); in mt8188_adda_mtkaif_init()
163 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_mtkaif_cfg_event() local
165 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_mtkaif_cfg_event()
170 mt8188_adda_mtkaif_init(afe); in mtk_adda_mtkaif_cfg_event()
184 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_dl_event() local
186 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_dl_event()
191 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_dl_event()
201 static void mtk_adda_ul_mictype(struct mtk_base_afe *afe, bool dmic) in mtk_adda_ul_mictype() argument
211 regmap_set_bits(afe->regmap, reg, val); in mtk_adda_ul_mictype()
213 regmap_clear_bits(afe->regmap, reg, val); in mtk_adda_ul_mictype()
221 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_ul_event() local
222 struct mt8188_afe_private *afe_priv = afe->platform_priv; in mtk_adda_ul_event()
225 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_ul_event()
230 mtk_adda_ul_mictype(afe, param->mtkaif_dmic_on); in mtk_adda_ul_event()
233 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_ul_event()
243 static struct mtk_dai_adda_priv *get_adda_priv_by_name(struct mtk_base_afe *afe, in get_adda_priv_by_name() argument
246 struct mt8188_afe_private *afe_priv = afe->platform_priv; in get_adda_priv_by_name()
261 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_adda_hires_connect() local
264 adda_priv = get_adda_priv_by_name(afe, w->name); in mtk_afe_adda_hires_connect()
267 dev_dbg(afe->dev, "adda_priv == NULL"); in mtk_afe_adda_hires_connect()
398 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8188_adda_dmic_get() local
399 struct mt8188_afe_private *afe_priv = afe->platform_priv; in mt8188_adda_dmic_get()
410 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8188_adda_dmic_set() local
411 struct mt8188_afe_private *afe_priv = afe->platform_priv; in mt8188_adda_dmic_set()
417 dev_dbg(afe->dev, "%s(), kcontrol name %s, dmic_on %d\n", in mt8188_adda_dmic_set()
434 static int mtk_dai_da_configure(struct mtk_base_afe *afe, in mtk_dai_da_configure() argument
443 afe_adda_dl_rate_transform(afe, rate)); in mtk_dai_da_configure()
460 regmap_update_bits(afe->regmap, AFE_ADDA_DL_SRC2_CON0, mask, val); in mtk_dai_da_configure()
463 regmap_set_bits(afe->regmap, AFE_ADDA_DL_SDM_DCCOMP_CON, in mtk_dai_da_configure()
469 static int mtk_dai_ad_configure(struct mtk_base_afe *afe, in mtk_dai_ad_configure() argument
477 afe_adda_ul_rate_transform(afe, rate)); in mtk_dai_ad_configure()
479 regmap_update_bits(afe->regmap, AFE_ADDA_UL_SRC_CON0, in mtk_dai_ad_configure()
488 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_dai_adda_hw_params() local
489 struct mt8188_afe_private *afe_priv = afe->platform_priv; in mtk_dai_adda_hw_params()
495 dev_dbg(afe->dev, "%s(), id %d, stream %d, rate %u\n", in mtk_dai_adda_hw_params()
501 ret = mtk_dai_da_configure(afe, rate, id); in mtk_dai_adda_hw_params()
503 ret = mtk_dai_ad_configure(afe, rate, id); in mtk_dai_adda_hw_params()
555 static int init_adda_priv_data(struct mtk_base_afe *afe) in init_adda_priv_data() argument
557 struct mt8188_afe_private *afe_priv = afe->platform_priv; in init_adda_priv_data()
563 adda_priv = devm_kzalloc(afe->dev, in init_adda_priv_data()
575 int mt8188_dai_adda_register(struct mtk_base_afe *afe) in mt8188_dai_adda_register() argument
579 dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); in mt8188_dai_adda_register()
583 list_add(&dai->list, &afe->sub_dais); in mt8188_dai_adda_register()
595 return init_adda_priv_data(afe); in mt8188_dai_adda_register()