summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorSumit Bhattacharya <sumitb@nvidia.com>2011-11-03 03:35:02 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:50:00 -0800
commit822011d5c3d2cad33b3e650df82c38defa14d49c (patch)
tree1788a1f0844a09f3f3baece262ea45f7c236ce15 /sound/soc
parentccb1676b1dc92c170dbb7633496be7ae97206d0a (diff)
ASoC: tegra: Support Tegra20 mono playback/capture
Add support for Tegra20 mono playback/capture. Mono is only supported using DSP mode. Also reduce minimum period bytes limit to 128 to have an acceptable latency value for 8kHz-mono playback/capture. Bug 872652 Signed-off-by: Sumit Bhattacharya <sumitb@nvidia.com> Change-Id: I715a6995506f0ae036579d181392251a51d3a5c2 Reviewed-on: http://git-master/r/62016 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R06beebb87c426eb010f1fb28aa521af25d51e2a7
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/tegra/tegra20_i2s.c14
-rw-r--r--sound/soc/tegra/tegra_pcm.c4
2 files changed, 12 insertions, 6 deletions
diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c
index 0dcea81c50d9..3f83887a7185 100644
--- a/sound/soc/tegra/tegra20_i2s.c
+++ b/sound/soc/tegra/tegra20_i2s.c
@@ -189,6 +189,12 @@ static int tegra20_i2s_hw_params(struct snd_pcm_substream *substream,
u32 reg;
int ret, sample_size, srate, i2sclock, bitcnt, i2sclk_div;
+ if ((i2s->reg_ctrl & TEGRA20_I2S_CTRL_BIT_FORMAT_I2S) &&
+ (params_channels(params) != 2)) {
+ dev_err(dev, "Only Stereo is supported in I2s mode\n");
+ return -EINVAL;
+ }
+
i2s->reg_ctrl &= ~TEGRA20_I2S_CTRL_BIT_SIZE_MASK;
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
@@ -348,13 +354,13 @@ struct snd_soc_dai_driver tegra20_i2s_dai[] = {
.name = DRV_NAME ".0",
.probe = tegra20_i2s_probe,
.playback = {
- .channels_min = 2,
+ .channels_min = 1,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_96000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
.capture = {
- .channels_min = 2,
+ .channels_min = 1,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_96000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
@@ -366,13 +372,13 @@ struct snd_soc_dai_driver tegra20_i2s_dai[] = {
.name = DRV_NAME ".1",
.probe = tegra20_i2s_probe,
.playback = {
- .channels_min = 2,
+ .channels_min = 1,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_96000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
.capture = {
- .channels_min = 2,
+ .channels_min = 1,
.channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_96000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
index 74844cef1fc1..b15a90bb9e27 100644
--- a/sound/soc/tegra/tegra_pcm.c
+++ b/sound/soc/tegra/tegra_pcm.c
@@ -48,9 +48,9 @@ static const struct snd_pcm_hardware tegra_pcm_hardware = {
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_INTERLEAVED,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
- .channels_min = 2,
+ .channels_min = 1,
.channels_max = 2,
- .period_bytes_min = 1024,
+ .period_bytes_min = 128,
.period_bytes_max = PAGE_SIZE,
.periods_min = 2,
.periods_max = 8,