aboutsummaryrefslogtreecommitdiff
path: root/sound
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-12-19 11:25:00 +0800
commit4fb23d7102b2a3d71b9d23f8beaeb3c9ac4c462c (patch)
treea5a5185bdacaaea230ff3206d026e2600d41f5ba /sound
parent0115ca4d4c7a7d1d8b8114f34a8e88c075397734 (diff)
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>
Diffstat (limited to 'sound')
-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 e1b66f12ec5..563d197e37d 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;
}