/linux/sound/soc/mediatek/common/ |
H A D | mtk-afe-fe-dai.c | 41 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_afe_fe_startup() local 44 struct mtk_base_afe_memif *memif = &afe->memif[memif_num]; in mtk_afe_fe_startup() 45 const struct snd_pcm_hardware *mtk_afe_hardware = afe->mtk_afe_hardware; in mtk_afe_fe_startup() 53 mtk_regmap_update_bits(afe->regmap, memif->data->agent_disable_reg, in mtk_afe_fe_startup() 71 dev_err(afe->dev, "hw_constraint_minmax failed\n"); in mtk_afe_fe_startup() 79 dev_err(afe->dev, "snd_pcm_hw_constraint_integer failed\n"); in mtk_afe_fe_startup() 83 int irq_id = mtk_dynamic_irq_acquire(afe); in mtk_afe_fe_startup() 85 if (irq_id != afe->irqs_size) { in mtk_afe_fe_startup() 89 dev_err(afe->dev, "%s() error: no more asys irq\n", in mtk_afe_fe_startup() 102 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_afe_fe_shutdown() local [all …]
|
/linux/sound/soc/mediatek/mt8188/ |
H A D | mt8188-afe-clk.c | 226 static int mt8188_afe_setup_apll_tuner(struct mtk_base_afe *afe, unsigned int id) in mt8188_afe_setup_apll_tuner() argument 233 regmap_update_bits(afe->regmap, in mt8188_afe_setup_apll_tuner() 238 regmap_update_bits(afe->regmap, in mt8188_afe_setup_apll_tuner() 243 regmap_update_bits(afe->regmap, in mt8188_afe_setup_apll_tuner() 251 static int mt8188_afe_enable_tuner_clk(struct mtk_base_afe *afe, in mt8188_afe_enable_tuner_clk() argument 254 struct mt8188_afe_private *afe_priv = afe->platform_priv; in mt8188_afe_enable_tuner_clk() 258 mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL]); in mt8188_afe_enable_tuner_clk() 259 mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL1_TUNER]); in mt8188_afe_enable_tuner_clk() 262 mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL2]); in mt8188_afe_enable_tuner_clk() 263 mt8188_afe_enable_clk(afe, afe_priv->clk[MT8188_CLK_AUD_APLL2_TUNER]); in mt8188_afe_enable_tuner_clk() [all …]
|
/linux/sound/soc/mediatek/mt8365/ |
H A D | mt8365-afe-clk.c | 34 int mt8365_afe_init_audio_clk(struct mtk_base_afe *afe) in mt8365_afe_init_audio_clk() argument 37 struct mt8365_afe_private *afe_priv = afe->platform_priv; in mt8365_afe_init_audio_clk() 40 afe_priv->clocks[i] = devm_clk_get(afe->dev, aud_clks[i]); in mt8365_afe_init_audio_clk() 42 dev_err(afe->dev, "%s devm_clk_get %s fail\n", in mt8365_afe_init_audio_clk() 50 void mt8365_afe_disable_clk(struct mtk_base_afe *afe, struct clk *clk) in mt8365_afe_disable_clk() argument 56 int mt8365_afe_set_clk_rate(struct mtk_base_afe *afe, struct clk *clk, in mt8365_afe_set_clk_rate() argument 64 dev_err(afe->dev, "Failed to set rate\n"); in mt8365_afe_set_clk_rate() 71 int mt8365_afe_set_clk_parent(struct mtk_base_afe *afe, struct clk *clk, in mt8365_afe_set_clk_parent() argument 79 dev_err(afe->dev, "Failed to set parent\n"); in mt8365_afe_set_clk_parent() 192 int mt8365_afe_enable_top_cg(struct mtk_base_afe *afe, unsigned int cg_type) in mt8365_afe_enable_top_cg() argument [all …]
|
H A D | mt8365-dai-adda.c | 21 static int mt8365_dai_set_adda_out(struct mtk_base_afe *afe, unsigned int rate) in mt8365_dai_set_adda_out() argument 31 mtk_adda_dl_rate_transform(afe, rate)); in mt8365_dai_set_adda_out() 37 regmap_update_bits(afe->regmap, AFE_ADDA_PREDIS_CON0, 0xffffffff, 0); in mt8365_dai_set_adda_out() 38 regmap_update_bits(afe->regmap, AFE_ADDA_PREDIS_CON1, 0xffffffff, 0); in mt8365_dai_set_adda_out() 39 regmap_update_bits(afe->regmap, AFE_ADDA_DL_SRC2_CON0, 0xffffffff, val); in mt8365_dai_set_adda_out() 41 regmap_update_bits(afe->regmap, AFE_ADDA_DL_SRC2_CON1, in mt8365_dai_set_adda_out() 44 regmap_update_bits(afe->regmap, AFE_ADDA_DL_SDM_DCCOMP_CON, in mt8365_dai_set_adda_out() 50 static int mt8365_dai_set_adda_in(struct mtk_base_afe *afe, unsigned int rate) in mt8365_dai_set_adda_in() argument 55 mtk_adda_ul_rate_transform(afe, rate)); in mt8365_dai_set_adda_in() 56 regmap_update_bits(afe->regmap, AFE_ADDA_UL_SRC_CON0, in mt8365_dai_set_adda_in() [all …]
|
H A D | mt8365-dai-dmic.c | 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 [all …]
|
H A D | mt8365-afe-pcm.c | 190 int mt8365_dai_set_priv(struct mtk_base_afe *afe, int id, in mt8365_dai_set_priv() argument 193 struct mt8365_afe_private *afe_priv = afe->platform_priv; in mt8365_dai_set_priv() 196 temp_data = devm_kzalloc(afe->dev, priv_size, GFP_KERNEL); in mt8365_dai_set_priv() 208 static int mt8365_afe_irq_direction_enable(struct mtk_base_afe *afe, in mt8365_afe_irq_direction_enable() argument 216 irq = &afe->irqs[irq_id]; in mt8365_afe_irq_direction_enable() 219 regmap_update_bits(afe->regmap, AFE_IRQ_MCU_DSP_EN, in mt8365_afe_irq_direction_enable() 222 regmap_update_bits(afe->regmap, AFE_IRQ_MCU_EN, in mt8365_afe_irq_direction_enable() 226 regmap_update_bits(afe->regmap, AFE_IRQ_MCU_DSP_EN, in mt8365_afe_irq_direction_enable() 229 regmap_update_bits(afe->regmap, AFE_IRQ_MCU_EN, in mt8365_afe_irq_direction_enable() 233 regmap_update_bits(afe->regmap, AFE_IRQ_MCU_DSP_EN, in mt8365_afe_irq_direction_enable() [all …]
|
H A D | mt8365-dai-i2s.c | 279 static int mt8365_dai_set_config(struct mtk_base_afe *afe, in mt8365_dai_set_config() argument 284 struct mt8365_afe_private *afe_priv = afe->platform_priv; in mt8365_dai_set_config() 321 regmap_update_bits(afe->regmap, reg_off, ~(u32)AFE_I2S_CON_EN, val); in mt8365_dai_set_config() 324 regmap_update_bits(afe->regmap, AFE_ADDA_TOP_CON0, 0x1, 0x1); in mt8365_dai_set_config() 329 int mt8365_afe_set_i2s_out(struct mtk_base_afe *afe, in mt8365_afe_set_i2s_out() argument 332 struct mt8365_afe_private *afe_priv = afe->platform_priv; in mt8365_afe_set_i2s_out() 336 return mt8365_dai_set_config(afe, i2s_data, false, rate, bit_width); in mt8365_afe_set_i2s_out() 339 static int mt8365_afe_set_2nd_i2s_asrc(struct mtk_base_afe *afe, in mt8365_afe_set_2nd_i2s_asrc() argument 364 regmap_update_bits(afe->regmap, AFE_ASRC_2CH_CON2, in mt8365_afe_set_2nd_i2s_asrc() 374 regmap_update_bits(afe->regmap, AFE_ASRC_2CH_CON0, in mt8365_afe_set_2nd_i2s_asrc() [all …]
|
/linux/drivers/media/i2c/adv748x/ |
H A D | adv748x-afe.c | 55 static int adv748x_afe_status(struct adv748x_afe *afe, u32 *signal, in adv748x_afe_status() argument 58 struct adv748x_state *state = adv748x_afe_to_state(afe); in adv748x_afe_status() 112 static void adv748x_afe_fill_format(struct adv748x_afe *afe, in adv748x_afe_fill_format() argument 122 fmt->height = afe->curr_norm & V4L2_STD_525_60 ? 480 : 576; in adv748x_afe_fill_format() 157 int adv748x_afe_s_input(struct adv748x_afe *afe, unsigned int input) in adv748x_afe_s_input() argument 159 struct adv748x_state *state = adv748x_afe_to_state(afe); in adv748x_afe_s_input() 167 struct adv748x_afe *afe = adv748x_sd_to_afe(sd); in adv748x_afe_g_pixelaspect() local 169 if (afe->curr_norm & V4L2_STD_525_60) { in adv748x_afe_g_pixelaspect() 186 struct adv748x_afe *afe = adv748x_sd_to_afe(sd); in adv748x_afe_g_std() local 188 *norm = afe->curr_norm; in adv748x_afe_g_std() [all …]
|
/linux/sound/soc/mediatek/mt8195/ |
H A D | mt8195-afe-clk.c | 217 static int mt8195_afe_setup_apll_tuner(struct mtk_base_afe *afe, in mt8195_afe_setup_apll_tuner() argument 225 regmap_update_bits(afe->regmap, cfg->apll_div_reg, in mt8195_afe_setup_apll_tuner() 229 regmap_update_bits(afe->regmap, cfg->ref_ck_sel_reg, in mt8195_afe_setup_apll_tuner() 233 regmap_update_bits(afe->regmap, cfg->upper_bound_reg, in mt8195_afe_setup_apll_tuner() 240 static int mt8195_afe_enable_tuner_clk(struct mtk_base_afe *afe, in mt8195_afe_enable_tuner_clk() argument 243 struct mt8195_afe_private *afe_priv = afe->platform_priv; in mt8195_afe_enable_tuner_clk() 247 mt8195_afe_enable_clk(afe, afe_priv->clk[MT8195_CLK_AUD_APLL]); in mt8195_afe_enable_tuner_clk() 248 mt8195_afe_enable_clk(afe, afe_priv->clk[MT8195_CLK_AUD_APLL1_TUNER]); in mt8195_afe_enable_tuner_clk() 251 mt8195_afe_enable_clk(afe, afe_priv->clk[MT8195_CLK_AUD_APLL2]); in mt8195_afe_enable_tuner_clk() 252 mt8195_afe_enable_clk(afe, afe_priv->clk[MT8195_CLK_AUD_APLL2_TUNER]); in mt8195_afe_enable_tuner_clk() [all …]
|
H A D | mt8195-dai-adda.c | 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() [all …]
|
/linux/sound/soc/mediatek/mt8186/ |
H A D | mt8186-afe-clk.c | 73 int mt8186_set_audio_int_bus_parent(struct mtk_base_afe *afe, in mt8186_set_audio_int_bus_parent() argument 76 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mt8186_set_audio_int_bus_parent() 82 dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n", in mt8186_set_audio_int_bus_parent() 91 static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable) in apll1_mux_setting() argument 93 struct mt8186_afe_private *afe_priv = afe->platform_priv; in apll1_mux_setting() 99 dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n", in apll1_mux_setting() 106 dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n", in apll1_mux_setting() 115 dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n", in apll1_mux_setting() 122 dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n", in apll1_mux_setting() 131 dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n", in apll1_mux_setting() [all …]
|
H A D | mt8186-dai-adda.c | 44 static struct mtk_afe_adda_priv *get_adda_priv_by_name(struct mtk_base_afe *afe, in get_adda_priv_by_name() argument 47 struct mt8186_afe_private *afe_priv = afe->platform_priv; in get_adda_priv_by_name() 122 static int mtk_adda_ul_src_dmic(struct mtk_base_afe *afe, int id) in mtk_adda_ul_src_dmic() argument 136 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic() 138 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic() 142 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic() 145 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic() 148 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic() 160 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_ul_event() local 161 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_adda_ul_event() [all …]
|
H A D | mt8186-dai-src.c | 99 static unsigned int mtk_get_src_freq_mode(struct mtk_base_afe *afe, int rate) in mtk_get_src_freq_mode() argument 129 dev_err(afe->dev, "%s(), rate %d invalid!!!\n", in mtk_get_src_freq_mode() 171 static int mtk_set_src_1_param(struct mtk_base_afe *afe, int id) in mtk_set_src_1_param() argument 173 struct mt8186_afe_private *afe_priv = afe->platform_priv; in mtk_set_src_1_param() 179 unsigned int out_freq_mode = mtk_get_src_freq_mode(afe, rate_out); in mtk_set_src_1_param() 180 unsigned int in_freq_mode = mtk_get_src_freq_mode(afe, rate_in); in mtk_set_src_1_param() 183 regmap_update_bits(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON3, in mtk_set_src_1_param() 188 regmap_update_bits(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON4, in mtk_set_src_1_param() 192 regmap_write(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON5, 0x3f5986); in mtk_set_src_1_param() 193 regmap_write(afe->regmap, AFE_GENERAL1_ASRC_2CH_CON5, 0x3f5987); in mtk_set_src_1_param() [all …]
|
/linux/sound/soc/mediatek/mt7986/ |
H A D | mt7986-afe-pcm.c | 111 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); in mt7986_memif_fs() local 113 return mt7986_afe_rate_transform(afe->dev, rate); in mt7986_memif_fs() 121 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); in mt7986_irq_fs() local 123 return mt7986_afe_rate_transform(afe->dev, rate); in mt7986_irq_fs() 321 static int mt7986_init_clock(struct mtk_base_afe *afe) in mt7986_init_clock() argument 323 struct mt7986_afe_private *afe_priv = afe->platform_priv; in mt7986_init_clock() 326 afe_priv->clks = devm_kcalloc(afe->dev, CLK_NUM, in mt7986_init_clock() 335 ret = devm_clk_bulk_get(afe->dev, afe_priv->num_clks, afe_priv->clks); in mt7986_init_clock() 337 return dev_err_probe(afe->dev, ret, "Failed to get clocks\n"); in mt7986_init_clock() 344 struct mtk_base_afe *afe = dev; in mt7986_afe_irq_handler() local [all …]
|
H A D | mt7986-dai-etdm.c | 121 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_dai_etdm_startup() local 122 struct mt7986_afe_private *afe_priv = afe->platform_priv; in mtk_dai_etdm_startup() 127 return dev_err_probe(afe->dev, ret, "Failed to enable clocks\n"); in mtk_dai_etdm_startup() 129 regmap_update_bits(afe->regmap, AUDIO_TOP_CON2, CLK_OUT5_PDN_MASK, 0); in mtk_dai_etdm_startup() 130 regmap_update_bits(afe->regmap, AUDIO_TOP_CON2, CLK_IN5_PDN_MASK, 0); in mtk_dai_etdm_startup() 138 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mtk_dai_etdm_shutdown() local 139 struct mt7986_afe_private *afe_priv = afe->platform_priv; in mtk_dai_etdm_shutdown() 141 regmap_update_bits(afe->regmap, AUDIO_TOP_CON2, CLK_OUT5_PDN_MASK, in mtk_dai_etdm_shutdown() 143 regmap_update_bits(afe->regmap, AUDIO_TOP_CON2, CLK_IN5_PDN_MASK, in mtk_dai_etdm_shutdown() 163 static int mtk_dai_etdm_config(struct mtk_base_afe *afe, in mtk_dai_etdm_config() argument [all …]
|
/linux/drivers/iio/health/ |
H A D | afe4403.c | 141 struct afe4403_data *afe = iio_priv(indio_dev); in afe440x_show_register() local 147 ret = regmap_field_read(afe->fields[afe440x_attr->field], ®_val); in afe440x_show_register() 165 struct afe4403_data *afe = iio_priv(indio_dev); in afe440x_store_register() local 180 ret = regmap_field_write(afe->fields[afe440x_attr->field], val); in afe440x_store_register() 217 static int afe4403_read(struct afe4403_data *afe, unsigned int reg, u32 *val) in afe4403_read() argument 224 ret = spi_write_then_read(afe->spi, tx, 4, NULL, 0); in afe4403_read() 228 ret = spi_write_then_read(afe->spi, ®, 1, rx, sizeof(rx)); in afe4403_read() 236 ret = spi_write_then_read(afe->spi, tx, 4, NULL, 0); in afe4403_read() 247 struct afe4403_data *afe = iio_priv(indio_dev); in afe4403_read_raw() local 256 ret = afe4403_read(afe, reg, val); in afe4403_read_raw() [all …]
|
H A D | afe4404.c | 172 struct afe4404_data *afe = iio_priv(indio_dev); in afe440x_show_register() local 178 ret = regmap_field_read(afe->fields[afe440x_attr->field], ®_val); in afe440x_show_register() 196 struct afe4404_data *afe = iio_priv(indio_dev); in afe440x_store_register() local 211 ret = regmap_field_write(afe->fields[afe440x_attr->field], val); in afe440x_store_register() 252 struct afe4404_data *afe = iio_priv(indio_dev); in afe4404_read_raw() local 261 ret = regmap_read(afe->regmap, value_reg, val); in afe4404_read_raw() 267 ret = regmap_field_read(afe->fields[offdac_field], val); in afe4404_read_raw() 277 ret = regmap_field_read(afe->fields[led_field], val); in afe4404_read_raw() 298 struct afe4404_data *afe = iio_priv(indio_dev); in afe4404_write_raw() local 306 return regmap_field_write(afe->fields[offdac_field], val); in afe4404_write_raw() [all …]
|
/linux/sound/soc/mediatek/mt8192/ |
H A D | mt8192-dai-adda.c | 175 static int mtk_adda_ul_src_dmic(struct mtk_base_afe *afe, int id) in mtk_adda_ul_src_dmic() argument 193 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic() 196 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic() 201 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic() 204 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic() 207 regmap_update_bits(afe->regmap, reg, in mtk_adda_ul_src_dmic() 218 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_ul_event() local 219 struct mt8192_afe_private *afe_priv = afe->platform_priv; in mtk_adda_ul_event() 224 mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 1); in mtk_adda_ul_event() 229 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG0, in mtk_adda_ul_event() [all …]
|
H A D | mt8192-afe-clk.c | 63 int mt8192_set_audio_int_bus_parent(struct mtk_base_afe *afe, in mt8192_set_audio_int_bus_parent() argument 66 struct mt8192_afe_private *afe_priv = afe->platform_priv; in mt8192_set_audio_int_bus_parent() 72 dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n", in mt8192_set_audio_int_bus_parent() 80 static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable) in apll1_mux_setting() argument 82 struct mt8192_afe_private *afe_priv = afe->platform_priv; in apll1_mux_setting() 88 dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n", in apll1_mux_setting() 95 dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n", in apll1_mux_setting() 104 dev_err(afe->dev, "%s clk_prepare_enable %s fail %d\n", in apll1_mux_setting() 111 dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n", in apll1_mux_setting() 120 dev_err(afe->dev, "%s clk_set_parent %s-%s fail %d\n", in apll1_mux_setting() [all …]
|
/linux/sound/soc/mediatek/mt2701/ |
H A D | mt2701-afe-clock-ctrl.c | 25 int mt2701_init_clock(struct mtk_base_afe *afe) in mt2701_init_clock() argument 27 struct mt2701_afe_private *afe_priv = afe->platform_priv; in mt2701_init_clock() 31 afe_priv->base_ck[i] = devm_clk_get(afe->dev, base_clks[i]); in mt2701_init_clock() 33 dev_err(afe->dev, "failed to get %s\n", base_clks[i]); in mt2701_init_clock() 45 i2s_path->sel_ck = devm_clk_get(afe->dev, name); in mt2701_init_clock() 47 dev_err(afe->dev, "failed to get %s\n", name); in mt2701_init_clock() 52 i2s_path->div_ck = devm_clk_get(afe->dev, name); in mt2701_init_clock() 54 dev_err(afe->dev, "failed to get %s\n", name); in mt2701_init_clock() 59 i2s_path->mclk_ck = devm_clk_get(afe->dev, name); in mt2701_init_clock() 61 dev_err(afe->dev, "failed to get %s\n", name); in mt2701_init_clock() [all …]
|
H A D | mt2701-afe-pcm.c | 82 static int mt2701_dai_num_to_i2s(struct mtk_base_afe *afe, int num) in mt2701_dai_num_to_i2s() argument 84 struct mt2701_afe_private *afe_priv = afe->platform_priv; in mt2701_dai_num_to_i2s() 88 dev_err(afe->dev, "%s, num not available, num %d, val %d\n", in mt2701_dai_num_to_i2s() 109 struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); in mt2701_afe_i2s_startup() local 110 struct mt2701_afe_private *afe_priv = afe->platform_priv; in mt2701_afe_i2s_startup() 111 int i2s_num = mt2701_dai_num_to_i2s(afe, dai->id); in mt2701_afe_i2s_startup() 117 return mt2701_afe_enable_mclk(afe, mode ? 1 : i2s_num); in mt2701_afe_i2s_startup() 120 static int mt2701_afe_i2s_path_disable(struct mtk_base_afe *afe, in mt2701_afe_i2s_path_disable() argument 133 regmap_update_bits(afe->regmap, i2s_data->i2s_ctrl_reg, in mt2701_afe_i2s_path_disable() 136 mt2701_afe_disable_i2s(afe, i2s_path, stream_dir); in mt2701_afe_i2s_path_disable() [all …]
|
/linux/sound/soc/mediatek/mt8183/ |
H A D | mt8183-dai-adda.c | 63 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mtk_adda_ul_event() local 64 struct mt8183_afe_private *afe_priv = afe->platform_priv; in mtk_adda_ul_event() 66 dev_dbg(afe->dev, "%s(), name %s, event 0x%x\n", in mtk_adda_ul_event() 74 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG0, in mtk_adda_ul_event() 78 regmap_update_bits(afe->regmap, AFE_ADDA_MTKAIF_RX_CFG0, in mtk_adda_ul_event() 80 regmap_update_bits(afe->regmap, AFE_ADDA_UL_SRC_CON0, in mtk_adda_ul_event() 82 regmap_update_bits(afe->regmap, AFE_ADDA_UL_SRC_CON0, in mtk_adda_ul_event() 86 regmap_update_bits(afe->regmap, AFE_ADDA_UL_SRC_CON0, in mtk_adda_ul_event() 88 regmap_update_bits(afe->regmap, AFE_ADDA_UL_SRC_CON0, in mtk_adda_ul_event() 117 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); in mt8183_adda_dmic_get() local [all …]
|
H A D | mt8183-afe-clk.c | 92 int mt8183_init_clock(struct mtk_base_afe *afe) in mt8183_init_clock() argument 94 struct mt8183_afe_private *afe_priv = afe->platform_priv; in mt8183_init_clock() 97 afe_priv->clk = devm_kcalloc(afe->dev, CLK_NUM, sizeof(*afe_priv->clk), in mt8183_init_clock() 103 afe_priv->clk[i] = devm_clk_get(afe->dev, aud_clks[i]); in mt8183_init_clock() 105 dev_err(afe->dev, "%s(), devm_clk_get %s fail, ret %ld\n", in mt8183_init_clock() 115 int mt8183_afe_enable_clock(struct mtk_base_afe *afe) in mt8183_afe_enable_clock() argument 117 struct mt8183_afe_private *afe_priv = afe->platform_priv; in mt8183_afe_enable_clock() 122 dev_err(afe->dev, "%s(), clk_prepare_enable %s fail %d\n", in mt8183_afe_enable_clock() 129 dev_err(afe->dev, "%s(), clk_prepare_enable %s fail %d\n", in mt8183_afe_enable_clock() 137 dev_err(afe->dev, "%s(), clk_set_parent %s-%s fail %d\n", in mt8183_afe_enable_clock() [all …]
|
/linux/sound/soc/mediatek/mt8173/ |
H A D | mt8173-afe-pcm.c | 196 static int mt8173_afe_set_i2s(struct mtk_base_afe *afe, unsigned int rate) in mt8173_afe_set_i2s() argument 205 regmap_update_bits(afe->regmap, AFE_ADDA_TOP_CON0, 0x1, 0x1); in mt8173_afe_set_i2s() 206 regmap_update_bits(afe->regmap, AFE_ADDA2_TOP_CON0, 0x1, 0x1); in mt8173_afe_set_i2s() 213 regmap_update_bits(afe->regmap, AFE_I2S_CON2, ~AFE_I2S_CON2_EN, val); in mt8173_afe_set_i2s() 220 regmap_update_bits(afe->regmap, AFE_I2S_CON1, ~AFE_I2S_CON1_EN, val); in mt8173_afe_set_i2s() 224 static void mt8173_afe_set_i2s_enable(struct mtk_base_afe *afe, bool enable) in mt8173_afe_set_i2s_enable() argument 228 regmap_read(afe->regmap, AFE_I2S_CON2, &val); in mt8173_afe_set_i2s_enable() 233 regmap_update_bits(afe->regmap, AFE_I2S_CON2, 0x1, enable); in mt8173_afe_set_i2s_enable() 236 regmap_update_bits(afe->regmap, AFE_I2S_CON1, 0x1, enable); in mt8173_afe_set_i2s_enable() 239 static int mt8173_afe_dais_enable_clks(struct mtk_base_afe *afe, in mt8173_afe_dais_enable_clks() argument [all …]
|
/linux/sound/soc/mediatek/mt6797/ |
H A D | mt6797-afe-pcm.c | 145 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); in mt6797_memif_fs() local 148 return mt6797_rate_transform(afe->dev, rate, id); in mt6797_memif_fs() 156 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(component); in mt6797_irq_fs() local 158 return mt6797_general_rate_transform(afe->dev, rate); in mt6797_irq_fs() 604 struct mtk_base_afe *afe = dev; in mt6797_afe_irq_handler() local 613 regmap_read(afe->regmap, AFE_IRQ_MCU_EN, &mcu_en); in mt6797_afe_irq_handler() 615 ret = regmap_read(afe->regmap, AFE_IRQ_MCU_STATUS, &status); in mt6797_afe_irq_handler() 617 dev_err(afe->dev, "%s(), irq status err, ret %d, status 0x%x, mcu_en 0x%x\n", in mt6797_afe_irq_handler() 628 struct mtk_base_afe_memif *memif = &afe->memif[i]; in mt6797_afe_irq_handler() 633 irq = &afe->irqs[memif->irq_usage]; in mt6797_afe_irq_handler() [all …]
|