summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Xu <Lionel.Xu@freescale.com>2012-03-02 13:18:17 +0800
committerLionel Xu <Lionel.Xu@freescale.com>2012-03-06 10:53:07 +0800
commit8b4eb3911f63aa32b74ef8dd79d2ca2a721db983 (patch)
tree6a1d5bb9c335905e4616208921bd24c3d9422227
parent5f5a08e4d616beb2aac46ccbb00ee98683c0d4c4 (diff)
ENGR00170526-4 ESAI: To resolve the playback no sound issue occasionally happen
There is no sound output any longer sometimes after several times of playback, this platch is trying to resolve this issue by: 1)move the global power control bit setting from function hw_params/shutdown to DAPM, thererfor the PWN bit will not be set/unset each time playback; 2) Signed-off-by: Lionel Xu <Lionel.Xu@freescale.com>
-rw-r--r--sound/soc/codecs/cs42888.c46
-rw-r--r--sound/soc/imx/imx-esai.c11
2 files changed, 27 insertions, 30 deletions
diff --git a/sound/soc/codecs/cs42888.c b/sound/soc/codecs/cs42888.c
index 29268e535ed8..86feec2676df 100644
--- a/sound/soc/codecs/cs42888.c
+++ b/sound/soc/codecs/cs42888.c
@@ -446,21 +446,36 @@ SND_SOC_DAPM_INPUT("AIN1L"),
SND_SOC_DAPM_INPUT("AIN1R"),
SND_SOC_DAPM_INPUT("AIN2L"),
SND_SOC_DAPM_INPUT("AIN2R"),
+
+SND_SOC_DAPM_PGA_E("PWR", CS42888_PWRCTL, 0, 1, NULL, 0,
+ NULL, 0),
};
static const struct snd_soc_dapm_route audio_map[] = {
/* Playback */
- { "AOUT1L", NULL, "DAC1" },
- { "AOUT1R", NULL, "DAC1" },
+ { "PWR", NULL, "DAC1" },
+ { "PWR", NULL, "DAC1" },
+
+ { "PWR", NULL, "DAC2" },
+ { "PWR", NULL, "DAC2" },
+
+ { "PWR", NULL, "DAC3" },
+ { "PWR", NULL, "DAC3" },
+
+ { "PWR", NULL, "DAC4" },
+ { "PWR", NULL, "DAC4" },
+
+ { "AOUT1L", NULL, "PWR" },
+ { "AOUT1R", NULL, "PWR" },
- { "AOUT2L", NULL, "DAC2" },
- { "AOUT2R", NULL, "DAC2" },
+ { "AOUT2L", NULL, "PWR" },
+ { "AOUT2R", NULL, "PWR" },
- { "AOUT3L", NULL, "DAC3" },
- { "AOUT3R", NULL, "DAC3" },
+ { "AOUT3L", NULL, "PWR" },
+ { "AOUT3R", NULL, "PWR" },
- { "AOUT4L", NULL, "DAC4" },
- { "AOUT4R", NULL, "DAC4" },
+ { "AOUT4L", NULL, "PWR" },
+ { "AOUT4R", NULL, "PWR" },
/* Capture */
{ "ADC1", NULL, "AIN1L" },
@@ -683,15 +698,6 @@ static int cs42888_hw_params(struct snd_pcm_substream *substream,
return ret;
}
- /* Out of low power state */
- val = snd_soc_read(codec, CS42888_PWRCTL);
- val &= ~CS42888_PWRCTL_PDN_MASK;
- ret = snd_soc_write(codec, CS42888_PWRCTL, val);
- if (ret < 0) {
- pr_err("i2c write failed\n");
- return ret;
- }
-
/* Unmute all the channels */
val = snd_soc_read(codec, CS42888_MUTE);
val &= ~CS42888_MUTE_ALL;
@@ -738,12 +744,6 @@ static void cs42888_shutdown(struct snd_pcm_substream *substream,
if (ret < 0)
pr_err("i2c write failed\n");
- /* Enter low power state */
- val = snd_soc_read(codec, CS42888_PWRCTL);
- val |= CS42888_PWRCTL_PDN_MASK;
- ret = snd_soc_write(codec, CS42888_PWRCTL, val);
- if (ret < 0)
- pr_err("i2c write failed\n");
}
static struct snd_soc_dai_ops cs42888_dai_ops = {
diff --git a/sound/soc/imx/imx-esai.c b/sound/soc/imx/imx-esai.c
index d3cf553bee2e..f6361716c20c 100644
--- a/sound/soc/imx/imx-esai.c
+++ b/sound/soc/imx/imx-esai.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2008-2012 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
@@ -280,16 +280,12 @@ static int imx_esai_startup(struct snd_pcm_substream *substream,
if (!(local_esai->imx_esai_txrx_state & IMX_DAI_ESAI_TXRX)) {
clk_enable(esai->clk);
- writel(ESAI_ECR_ERST, esai->base + ESAI_ECR);
- writel(ESAI_ECR_ESAIEN, esai->base + ESAI_ECR);
-
writel(ESAI_GPIO_ESAI, esai->base + ESAI_PRRC);
writel(ESAI_GPIO_ESAI, esai->base + ESAI_PCRC);
}
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
local_esai->imx_esai_txrx_state |= IMX_DAI_ESAI_TX;
- writel(ESAI_TCR_TPR, esai->base + ESAI_TCR);
} else {
local_esai->imx_esai_txrx_state |= IMX_DAI_ESAI_RX;
writel(ESAI_RCR_RPR, esai->base + ESAI_RCR);
@@ -458,7 +454,6 @@ static int imx_esai_trigger(struct snd_pcm_substream *substream, int cmd,
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
tfcr |= ESAI_TFCR_TFEN;
writel(tfcr, esai->base + ESAI_TFCR);
- reg &= ~ESAI_TCR_TPR;
reg |= ESAI_TCR_TE(substream->runtime->channels);
writel(reg, esai->base + ESAI_TCR);
} else {
@@ -478,7 +473,6 @@ static int imx_esai_trigger(struct snd_pcm_substream *substream, int cmd,
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
reg &= ~ESAI_TCR_TE(substream->runtime->channels);
writel(reg, esai->base + ESAI_TCR);
- reg |= ESAI_TCR_TPR;
writel(reg, esai->base + ESAI_TCR);
tfcr |= ESAI_TFCR_TFR;
tfcr &= ~ESAI_TFCR_TFEN;
@@ -661,6 +655,9 @@ static int imx_esai_probe(struct platform_device *pdev)
goto failed_pdev_add;
}
+ writel(ESAI_ECR_ERST, esai->base + ESAI_ECR);
+ writel(ESAI_ECR_ESAIEN, esai->base + ESAI_ECR);
+
return 0;
failed_pdev_add: