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>
This commit is contained in:
Shuai Li
2019-03-12 14:40:20 +08:00
committed by Jianxin Pan
parent 1670aa7274
commit 009354756a
8 changed files with 26 additions and 3 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -625,9 +625,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");
aml_frddr_enable(p_tdm->fddr, 0);
@@ -643,6 +640,8 @@ static int aml_dai_tdm_trigger(struct snd_pcm_substream *substream, int cmd,
dev_info(substream->pcm->card->dev, "tdm capture stop\n");
aml_toddr_enable(p_tdm->tddr, 0);
}
aml_tdm_enable(p_tdm->actrl,
substream->stream, p_tdm->id, false);
break;
default:
return -EINVAL;
@@ -902,6 +901,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);