Skip to content

Commit cab2b9e

Browse files
wenliangwubroonie
authored andcommitted
ASoC: mediatek: mt8195: update mediatek common driver
Update mediatek common driver to support MT8195 Signed-off-by: Trevor Wu <[email protected]> Reported-by: kernel test robot <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 6f02c08 commit cab2b9e

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

sound/soc/mediatek/common/mtk-afe-fe-dai.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ int mtk_afe_fe_hw_params(struct snd_pcm_substream *substream,
139139
substream->runtime->dma_area,
140140
substream->runtime->dma_bytes);
141141

142-
memset_io(substream->runtime->dma_area, 0,
142+
memset_io((void __force __iomem *)substream->runtime->dma_area, 0,
143143
substream->runtime->dma_bytes);
144144

145145
/* set addr */
@@ -433,11 +433,20 @@ int mtk_memif_set_addr(struct mtk_base_afe *afe, int id,
433433
phys_buf_addr_upper_32);
434434
}
435435

436-
/* set MSB to 33-bit */
437-
if (memif->data->msb_reg >= 0)
436+
/*
437+
* set MSB to 33-bit, for memif address
438+
* only for memif base address, if msb_end_reg exists
439+
*/
440+
if (memif->data->msb_reg)
438441
mtk_regmap_update_bits(afe->regmap, memif->data->msb_reg,
439442
1, msb_at_bit33, memif->data->msb_shift);
440443

444+
/* set MSB to 33-bit, for memif end address */
445+
if (memif->data->msb_end_reg)
446+
mtk_regmap_update_bits(afe->regmap, memif->data->msb_end_reg,
447+
1, msb_at_bit33,
448+
memif->data->msb_end_shift);
449+
441450
return 0;
442451
}
443452
EXPORT_SYMBOL_GPL(mtk_memif_set_addr);
@@ -464,6 +473,13 @@ int mtk_memif_set_channel(struct mtk_base_afe *afe,
464473
else
465474
mono = (channel == 1) ? 1 : 0;
466475

476+
/* for specific configuration of memif mono mode */
477+
if (memif->data->int_odd_flag_reg)
478+
mtk_regmap_update_bits(afe->regmap,
479+
memif->data->int_odd_flag_reg,
480+
1, mono,
481+
memif->data->int_odd_flag_shift);
482+
467483
return mtk_regmap_update_bits(afe->regmap, memif->data->mono_reg,
468484
1, mono, memif->data->mono_shift);
469485
}

sound/soc/mediatek/common/mtk-base-afe.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ struct mtk_base_memif_data {
2929
int quad_ch_reg;
3030
int quad_ch_mask;
3131
int quad_ch_shift;
32+
int int_odd_flag_reg;
33+
int int_odd_flag_shift;
3234
int enable_reg;
3335
int enable_shift;
3436
int hd_reg;
@@ -37,10 +39,13 @@ struct mtk_base_memif_data {
3739
int hd_align_mshift;
3840
int msb_reg;
3941
int msb_shift;
40-
int msb2_reg;
41-
int msb2_shift;
42+
int msb_end_reg;
43+
int msb_end_shift;
4244
int agent_disable_reg;
4345
int agent_disable_shift;
46+
int ch_num_reg;
47+
int ch_num_shift;
48+
int ch_num_maskbit;
4449
/* playback memif only */
4550
int pbuf_reg;
4651
int pbuf_mask;
@@ -62,6 +67,7 @@ struct mtk_base_irq_data {
6267
int irq_en_shift;
6368
int irq_clr_reg;
6469
int irq_clr_shift;
70+
int irq_status_shift;
6571
};
6672

6773
struct device;

0 commit comments

Comments
 (0)