Lines Matching full:afe

12 #include "mt8195-afe-clk.h"
13 #include "mt8195-afe-common.h"
38 static int mt8195_adda_mtkaif_init(struct mtk_base_afe *afe) in mt8195_adda_mtkaif_init() argument
40 struct mt8195_afe_private *afe_priv = afe->platform_priv; in mt8195_adda_mtkaif_init()
51 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_CFG0, mask, val); in mt8195_adda_mtkaif_init()
52 regmap_update_bits(afe->regmap, AFE_ADDA6_MTKAIF_CFG0, mask, val); in mt8195_adda_mtkaif_init()
56 regmap_update_bits(afe->regmap, AFE_AUD_PAD_TOP, mask, val); in mt8195_adda_mtkaif_init()
59 dev_info(afe->dev, "%s(), calibration fail\n", __func__); in mt8195_adda_mtkaif_init()
82 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG2, mask, val); in mt8195_adda_mtkaif_init()
103 regmap_update_bits(afe->regmap, AFE_ADDA6_MTKAIF_RX_CFG2, mask, val); in mt8195_adda_mtkaif_init()
113 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_mtkaif_cfg_event() local
115 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_mtkaif_cfg_event()
120 mt8195_adda_mtkaif_init(afe); in mtk_adda_mtkaif_cfg_event()
134 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_dl_event() local
136 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_dl_event()
141 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_dl_event()
151 static void mtk_adda_ul_mictype(struct mtk_base_afe *afe, int adda, bool dmic) in mtk_adda_ul_mictype() argument
165 dev_info(afe->dev, "%s(), wrong parameter\n", __func__); in mtk_adda_ul_mictype()
176 regmap_update_bits(afe->regmap, reg, mask, val); in mtk_adda_ul_mictype()
184 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_ul_event() local
185 struct mt8195_afe_private *afe_priv = afe->platform_priv; in mtk_adda_ul_event()
188 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_ul_event()
193 mtk_adda_ul_mictype(afe, MTK_AFE_ADDA, param->mtkaif_dmic_on); in mtk_adda_ul_event()
196 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda_ul_event()
211 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda6_ul_event() local
212 struct mt8195_afe_private *afe_priv = afe->platform_priv; in mtk_adda6_ul_event()
216 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda6_ul_event()
221 mtk_adda_ul_mictype(afe, MTK_AFE_ADDA6, param->mtkaif_dmic_on); in mtk_adda6_ul_event()
226 regmap_update_bits(afe->regmap, in mtk_adda6_ul_event()
232 /* should delayed 1/fs(smallest is 8k) = 125us before afe off */ in mtk_adda6_ul_event()
247 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_audio_hires_event() local
248 struct mt8195_afe_private *afe_priv = afe->platform_priv; in mtk_audio_hires_event()
252 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_audio_hires_event()
265 mt8195_afe_set_clk_parent(afe, clk, clk_parent); in mtk_audio_hires_event()
270 static struct mtk_dai_adda_priv *get_adda_priv_by_name(struct mtk_base_afe *afe, in get_adda_priv_by_name() argument
273 struct mt8195_afe_private *afe_priv = afe->platform_priv; in get_adda_priv_by_name()
293 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_afe_adda_hires_connect() local
296 adda_priv = get_adda_priv_by_name(afe, w->name); in mtk_afe_adda_hires_connect()
299 dev_info(afe->dev, "adda_priv == NULL"); in mtk_afe_adda_hires_connect()
459 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); in mt8195_adda_dl_gain_put() local
464 regmap_update_bits(afe->regmap, reg, mask, DL_2_GAIN_CTL_PRE(value)); in mt8195_adda_dl_gain_put()
472 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); in mt8195_adda_dl_gain_get() local
477 regmap_read(afe->regmap, reg, &value); in mt8195_adda_dl_gain_get()
488 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8195_adda6_only_get() local
489 struct mt8195_afe_private *afe_priv = afe->platform_priv; in mt8195_adda6_only_get()
500 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8195_adda6_only_set() local
501 struct mt8195_afe_private *afe_priv = afe->platform_priv; in mt8195_adda6_only_set()
507 dev_info(afe->dev, "%s(), kcontrol name %s, mtkaif_adda6_only %d\n", in mt8195_adda6_only_set()
519 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8195_adda_dmic_get() local
520 struct mt8195_afe_private *afe_priv = afe->platform_priv; in mt8195_adda_dmic_get()
531 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8195_adda_dmic_set() local
532 struct mt8195_afe_private *afe_priv = afe->platform_priv; in mt8195_adda_dmic_set()
538 dev_dbg(afe->dev, "%s(), kcontrol name %s, dmic_on %d\n", in mt8195_adda_dmic_set()
555 static int mtk_dai_da_configure(struct mtk_base_afe *afe, in mtk_dai_da_configure() argument
563 val |= DL_2_INPUT_MODE_CTL(mtk_adda_dl_rate_transform(afe, rate)); in mtk_dai_da_configure()
580 regmap_update_bits(afe->regmap, AFE_ADDA_DL_SRC2_CON0, mask, val); in mtk_dai_da_configure()
588 regmap_update_bits(afe->regmap, AFE_ADDA_DL_SDM_DCCOMP_CON, mask, val); in mtk_dai_da_configure()
593 static int mtk_dai_ad_configure(struct mtk_base_afe *afe, in mtk_dai_ad_configure() argument
600 val |= UL_VOICE_MODE_CTL(mtk_adda_ul_rate_transform(afe, rate)); in mtk_dai_ad_configure()
604 regmap_update_bits(afe->regmap, AFE_ADDA_UL_SRC_CON0, in mtk_dai_ad_configure()
608 regmap_update_bits(afe->regmap, AFE_ADDA6_UL_SRC_CON0, in mtk_dai_ad_configure()
621 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_dai_adda_hw_params() local
622 struct mt8195_afe_private *afe_priv = afe->platform_priv; in mtk_dai_adda_hw_params()
633 dev_dbg(afe->dev, "%s(), id %d, stream %d, rate %d\n", in mtk_dai_adda_hw_params()
642 ret = mtk_dai_da_configure(afe, rate, dai->id); in mtk_dai_adda_hw_params()
644 ret = mtk_dai_ad_configure(afe, rate, dai->id); in mtk_dai_adda_hw_params()
708 static int init_adda_priv_data(struct mtk_base_afe *afe) in init_adda_priv_data() argument
710 struct mt8195_afe_private *afe_priv = afe->platform_priv; in init_adda_priv_data()
720 adda_priv = devm_kzalloc(afe->dev, in init_adda_priv_data()
732 int mt8195_dai_adda_register(struct mtk_base_afe *afe) in mt8195_dai_adda_register() argument
736 dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); in mt8195_dai_adda_register()
740 list_add(&dai->list, &afe->sub_dais); in mt8195_dai_adda_register()
752 return init_adda_priv_data(afe); in mt8195_dai_adda_register()