Lines Matching full:afe

14 #include "mt8188-afe-clk.h"
15 #include "mt8188-afe-common.h"
32 static int mt8188_adda_mtkaif_init(struct mtk_base_afe *afe) in mt8188_adda_mtkaif_init() argument
34 struct mt8188_afe_private *afe_priv = afe->platform_priv; in mt8188_adda_mtkaif_init()
42 regmap_set_bits(afe->regmap, AFE_ADDA_MTKAIF_CFG0, in mt8188_adda_mtkaif_init()
45 regmap_set_bits(afe->regmap, AFE_AUD_PAD_TOP, RG_RX_PROTOCOL2); in mt8188_adda_mtkaif_init()
48 dev_info(afe->dev, "%s(), calibration fail\n", __func__); in mt8188_adda_mtkaif_init()
70 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG2, mask, val); in mt8188_adda_mtkaif_init()
80 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_mtkaif_cfg_event() local
82 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_mtkaif_cfg_event()
87 mt8188_adda_mtkaif_init(afe); in mtk_adda_mtkaif_cfg_event()
101 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_dl_event() local
103 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_dl_event()
108 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_dl_event()
118 static void mtk_adda_ul_mictype(struct mtk_base_afe *afe, bool dmic) in mtk_adda_ul_mictype() argument
128 regmap_set_bits(afe->regmap, reg, val); in mtk_adda_ul_mictype()
130 regmap_clear_bits(afe->regmap, reg, val); in mtk_adda_ul_mictype()
138 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_ul_event() local
139 struct mt8188_afe_private *afe_priv = afe->platform_priv; in mtk_adda_ul_event()
142 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_ul_event()
147 mtk_adda_ul_mictype(afe, param->mtkaif_dmic_on); in mtk_adda_ul_event()
150 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_ul_event()
160 static struct mtk_dai_adda_priv *get_adda_priv_by_name(struct mtk_base_afe *afe, in get_adda_priv_by_name() argument
163 struct mt8188_afe_private *afe_priv = afe->platform_priv; in get_adda_priv_by_name()
178 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_adda_hires_connect() local
181 adda_priv = get_adda_priv_by_name(afe, w->name); in mtk_afe_adda_hires_connect()
184 dev_dbg(afe->dev, "adda_priv == NULL"); in mtk_afe_adda_hires_connect()
315 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8188_adda_dmic_get() local
316 struct mt8188_afe_private *afe_priv = afe->platform_priv; in mt8188_adda_dmic_get()
327 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8188_adda_dmic_set() local
328 struct mt8188_afe_private *afe_priv = afe->platform_priv; in mt8188_adda_dmic_set()
334 dev_dbg(afe->dev, "%s(), kcontrol name %s, dmic_on %d\n", in mt8188_adda_dmic_set()
351 static int mtk_dai_da_configure(struct mtk_base_afe *afe, in mtk_dai_da_configure() argument
360 mtk_adda_dl_rate_transform(afe, rate)); in mtk_dai_da_configure()
377 regmap_update_bits(afe->regmap, AFE_ADDA_DL_SRC2_CON0, mask, val); in mtk_dai_da_configure()
380 regmap_set_bits(afe->regmap, AFE_ADDA_DL_SDM_DCCOMP_CON, in mtk_dai_da_configure()
386 static int mtk_dai_ad_configure(struct mtk_base_afe *afe, in mtk_dai_ad_configure() argument
394 mtk_adda_ul_rate_transform(afe, rate)); in mtk_dai_ad_configure()
396 regmap_update_bits(afe->regmap, AFE_ADDA_UL_SRC_CON0, in mtk_dai_ad_configure()
405 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_dai_adda_hw_params() local
406 struct mt8188_afe_private *afe_priv = afe->platform_priv; in mtk_dai_adda_hw_params()
412 dev_dbg(afe->dev, "%s(), id %d, stream %d, rate %u\n", in mtk_dai_adda_hw_params()
418 ret = mtk_dai_da_configure(afe, rate, id); in mtk_dai_adda_hw_params()
420 ret = mtk_dai_ad_configure(afe, rate, id); in mtk_dai_adda_hw_params()
472 static int init_adda_priv_data(struct mtk_base_afe *afe) in init_adda_priv_data() argument
474 struct mt8188_afe_private *afe_priv = afe->platform_priv; in init_adda_priv_data()
480 adda_priv = devm_kzalloc(afe->dev, in init_adda_priv_data()
492 int mt8188_dai_adda_register(struct mtk_base_afe *afe) in mt8188_dai_adda_register() argument
496 dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); in mt8188_dai_adda_register()
500 list_add(&dai->list, &afe->sub_dais); in mt8188_dai_adda_register()
512 return init_adda_priv_data(afe); in mt8188_dai_adda_register()