aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Xu <Lionel.Xu@freescale.com>2011-09-26 16:46:00 +0800
committerEric Miao <eric.miao@linaro.org>2011-11-15 16:28:31 +0800
commit2ad21e37ad5664525e592473e31d8d628cafa585 (patch)
tree8d351c24291caaefa5ecabddea4961a4710ac2dd
parent07e8f55645b5b4134f188987a92945034908c0d7 (diff)
downloadlinux-linaro-2ad21e37ad5664525e592473e31d8d628cafa585.tar.gz
SAUCE: ENGR00158176 SGTL5000: I/O Error appeared when recording mono wav through HW
BugLink: http://bugs.launchpad.net/bugs/856933 When recording mono wav, SSI's network mode should be closed, or it will influence the internal freq config, making recording fail. Signed-off-by: Lionel Xu <Lionel.Xu@freescale.com> Signed-off-by: Eric Miao <eric.miao@linaro.org>
-rw-r--r--sound/soc/imx/imx-ssi.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c
index 19f7fb94787..03943d3c5df 100644
--- a/sound/soc/imx/imx-ssi.c
+++ b/sound/soc/imx/imx-ssi.c
@@ -89,14 +89,13 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai);
u32 strcr = 0, scr;
- scr = readl(ssi->base + SSI_SCR) & ~(SSI_SCR_SYN | SSI_SCR_NET);
+ scr = readl(ssi->base + SSI_SCR) & ~SSI_SCR_SYN;
/* DAI mode */
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_I2S:
/* data on rising edge of bclk, frame low 1clk before data */
strcr |= SSI_STCR_TFSI | SSI_STCR_TEFS | SSI_STCR_TXBIT0;
- scr |= SSI_SCR_NET;
if (ssi->flags & IMX_SSI_USE_I2S_SLAVE) {
scr &= ~SSI_I2S_MODE_MASK;
scr |= SSI_SCR_I2S_MODE_SLAVE;
@@ -145,8 +144,6 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
strcr |= SSI_STCR_TFEN0;
- if (ssi->flags & IMX_SSI_NET)
- scr |= SSI_SCR_NET;
if (ssi->flags & IMX_SSI_SYN)
scr |= SSI_SCR_SYN;
@@ -243,7 +240,8 @@ static int imx_ssi_hw_params(struct snd_pcm_substream *substream,
{
struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai);
struct imx_pcm_dma_params *dma_data;
- u32 reg, sccr;
+ u32 reg, sccr, scr;
+ unsigned int channels = params_channels(params);
/* Tx/Rx config */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
@@ -276,6 +274,14 @@ static int imx_ssi_hw_params(struct snd_pcm_substream *substream,
writel(sccr, ssi->base + reg);
+ scr = readl(ssi->base + SSI_SCR);
+
+ if (channels == 1)
+ scr &= ~SSI_SCR_NET;
+ else
+ scr |= SSI_SCR_NET;
+
+ writel(scr, ssi->base + SSI_SCR);
return 0;
}