audio: fix H-voltage when tdm disable [1/1]

PD#SWPL-2952

Problem:
High voltage will cause the tdmout
data pin wrong I2S data which cause pop.

Solution:
Disable the bias of gpio.

Verify:
I2S data will be low when I2s closed.

Change-Id: If5d68e0f30df074f528dfec21cbe297795bc4ea7
Signed-off-by: Shuai Li <shuai.li@amlogic.com>

Conflicts:
	arch/arm64/boot/dts/amlogic/tm2_t962e2_ab311.dts
	arch/arm64/boot/dts/amlogic/tm2_t962x3_ab301.dts
	sound/soc/amlogic/auge/tdm.c
This commit is contained in:
Shuai Li
2019-03-12 14:40:20 +08:00
committed by Luke Go
parent 59d82acd6c
commit d7900b5335
6 changed files with 23 additions and 4 deletions

View File

@@ -1205,6 +1205,7 @@
"tdma_dout2_z",
"tdma_dout3_z";
function = "tdma_out";
bias-disable;
};
};

View File

@@ -1476,6 +1476,7 @@
"tdma_fs_z",
"tdma_dout0_z";
function = "tdma_out";
bias-disable;
};
};

View File

@@ -1203,6 +1203,7 @@
"tdma_fs_z",
"tdma_dout0_z";
function = "tdma_out";
bias-disable;
};
};

View File

@@ -592,9 +592,6 @@ static int aml_dai_tdm_trigger(struct snd_pcm_substream *substream, int cmd,
break;
}
aml_tdm_enable(p_tdm->actrl,
substream->stream, p_tdm->id, false);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
dev_info(substream->pcm->card->dev, "tdm playback stop\n");
memset(substream->runtime->dma_area,
@@ -614,7 +611,7 @@ static int aml_dai_tdm_trigger(struct snd_pcm_substream *substream, int cmd,
aml_toddr_enable(p_tdm->tddr, 0);
}
aml_tdm_enable(p_tdm->actrl,
substream->stream, p_tdm->id, false);
substream->stream, p_tdm->id, false);
break;
default:
return -EINVAL;
@@ -877,6 +874,14 @@ static int aml_dai_set_tdm_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
aml_tdm_set_format(p_tdm->actrl,
&(p_tdm->setting), p_tdm->clk_sel, p_tdm->id, fmt,
1, 1);
if (p_tdm->contns_clk && !IS_ERR(p_tdm->mclk)) {
int ret = clk_prepare_enable(p_tdm->mclk);
if (ret) {
pr_err("Can't enable mclk: %d\n", ret);
return ret;
}
}
capture:
/* update skew for ACODEC_ADC */

View File

@@ -637,6 +637,16 @@ void aml_tdmout_get_aed_info(int tdmout_id,
*frddrtype = (val >> 4) & 0x7;
}
void aml_tdmout_enable_gain(int tdmout_id, int en)
{
unsigned int reg, offset;
offset = EE_AUDIO_TDMOUT_B_CTRL1
- EE_AUDIO_TDMOUT_A_CTRL1;
reg = EE_AUDIO_TDMOUT_A_CTRL1 + offset * tdmout_id;
audiobus_update_bits(reg, 0x1 << 26, !!en << 26);
}
void aml_tdm_clk_pad_select(
struct aml_audio_controller *actrl,
int mpad, int mclk_sel,

View File

@@ -71,6 +71,7 @@ extern void aml_tdm_arb_config(
extern void aml_tdm_fifo_reset(
struct aml_audio_controller *actrl,
int stream, int index);
void aml_tdmout_enable_gain(int tdmout_id, int en);
extern int tdmout_get_frddr_type(int bitwidth);