audio: set tdmout frddr select mask by the chip [1/1]

PD#SWPL-188060

Problem:
from sm1, the frddr select mask is bit 24-26,
before sm1, the frddr select mask is bit 24-25,
the bit 26 is for gain control.

Solution:
set tdmout frddr select mask by the chip,
before sm1, it is 0x3, from sm1, it is 0x7.

Verify:
a4

Change-Id: Icf92904ad94b18897d6c8687168e126e605224cd
Signed-off-by: jian zhou <jian.zhou@amlogic.com>
(cherry picked from commit fd6639bb19)
(cherry picked from commit b9e8bdf57797218a34918d6fe6ed8e8b5eced79d)
This commit is contained in:
jian zhou
2024-10-14 09:47:14 +08:00
committed by Jian Zhou
parent 0a9b1d164d
commit 015acb9ff7
3 changed files with 13 additions and 4 deletions
+2 -1
View File
@@ -1789,7 +1789,8 @@ static int aml_dai_tdm_prepare(struct snd_pcm_substream *substream,
bit_depth,
substream->stream,
p_tdm->id,
fifo_id);
fifo_id,
p_tdm->chipinfo->gain_ver);
switch (p_tdm->id) {
case 0:
+10 -2
View File
@@ -221,10 +221,11 @@ int tdmout_get_frddr_type(int bitwidth)
void aml_tdm_fifo_ctrl(struct aml_audio_controller *actrl,
int bitwidth, int stream,
int index, unsigned int fifo_id)
int index, unsigned int fifo_id, int gain_ver)
{
unsigned int frddr_type = tdmout_get_frddr_type(bitwidth);
unsigned int reg, offset;
int frddr_sel_mask = 0x7;
if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
pr_debug("tdm prepare----playback\n");
@@ -238,8 +239,15 @@ void aml_tdm_fifo_ctrl(struct aml_audio_controller *actrl,
} else {
reg = EE_AUDIO_TDMOUT_A_CTRL1;
}
/* from sm1, the frddr select mask is bit 24-26,
* before sm1, the frddr select mask is bit 24-25,
* the bit 26 is for gain control.
*/
if (gain_ver == GAIN_VER1)
frddr_sel_mask = 0x3;
aml_audiobus_update_bits(actrl, reg,
0x3 << 24 | 0x1f << 8 | 0x7 << 4,
frddr_sel_mask << 24 | 0x1f << 8 | 0x7 << 4,
fifo_id << 24 | (bitwidth - 1) << 8 | frddr_type << 4);
} else {
pr_debug("tdm prepare----capture\n");
+1 -1
View File
@@ -74,7 +74,7 @@ int tdmout_get_frddr_type(int bitwidth);
void aml_tdm_fifo_ctrl(struct aml_audio_controller *actrl,
int bitwidth, int stream,
int index, unsigned int fifo_id);
int index, unsigned int fifo_id, int gain_ver);
void aml_tdm_set_format(struct aml_audio_controller *actrl,
struct pcm_setting *p_config,