summaryrefslogtreecommitdiff
path: root/sound/soc/tegra/tegra30_i2s.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/tegra/tegra30_i2s.c')
-rw-r--r--sound/soc/tegra/tegra30_i2s.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index e05b55ac36fe..20faef840358 100644
--- a/sound/soc/tegra/tegra30_i2s.c
+++ b/sound/soc/tegra/tegra30_i2s.c
@@ -6,8 +6,8 @@
*
* Based on code copyright/by:
*
- * Copyright (c) 2009-2010, NVIDIA Corporation.
- * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2009-2013, NVIDIA Corporation.
+ * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
* Scott Peterson <speterson@nvidia.com>
*
* Copyright (C) 2010 Google, Inc.
@@ -108,6 +108,9 @@ static int tegra30_i2s_show(struct seq_file *s, void *unused)
REG(TEGRA30_I2S_LCOEF_2_4_0),
REG(TEGRA30_I2S_LCOEF_2_4_1),
REG(TEGRA30_I2S_LCOEF_2_4_2),
+#ifndef CONFIG_ARCH_TEGRA_3x_SOC
+ REG(TEGRA30_I2S_SLOT_CTRL2),
+#endif
};
#undef REG
@@ -554,15 +557,19 @@ static int tegra30_i2s_hw_params(struct snd_pcm_substream *substream,
bitcnt = (i2sclock / srate) - 1;
sym_bitclk = !(i2sclock % srate);
#ifndef CONFIG_ARCH_TEGRA_3x_SOC
- val = 0;
- for (i = 0; i < params_channels(params); i++)
- val |= (1 << i);
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
- val = val <<
+ val = tegra30_i2s_read(i2s, TEGRA30_I2S_SLOT_CTRL2);
+
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ val &=
+ ~TEGRA30_I2S_SLOT_CTRL2_TX_SLOT_ENABLES_MASK;
+ val |= ((1 << params_channels(params)) - 1) <<
TEGRA30_I2S_SLOT_CTRL2_TX_SLOT_ENABLES_SHIFT;
- else
- val = val <<
+ } else {
+ val &=
+ ~TEGRA30_I2S_SLOT_CTRL2_RX_SLOT_ENABLES_MASK;
+ val |= ((1 << params_channels(params)) - 1) <<
TEGRA30_I2S_SLOT_CTRL2_RX_SLOT_ENABLES_SHIFT;
+ }
tegra30_i2s_write(i2s, TEGRA30_I2S_SLOT_CTRL2, val);
#endif
} else {