summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorVijay Mali <vmali@nvidia.com>2014-04-21 19:45:27 +0530
committerRiham Haidar <rhaidar@nvidia.com>2014-05-21 11:42:28 -0700
commit51ce6d2eb3e98fb5fe62d9a527f5b042ceaa0c79 (patch)
treeb635906bf2f03e8af96c770727378e2adb7eeb4e /sound
parent7f14613d8dbc873bb2db502cf154b00c6fb5e31e (diff)
asoc: tegra: Support 24 bit, 192KHz format
- Add 192Khz sample rate - Update clock rate for i2s clock - Update ahub clock Bug 1502003 Change-Id: I0013957e22a864670e67e3c808df270a8ca16fa1 Signed-off-by: Vijay Mali <vmali@nvidia.com> Reviewed-on: http://git-master/r/398989 (cherry picked from commit 6f3ec1ce0b301ebf2eb3533a3fd985f25132e4f2) Reviewed-on: http://git-master/r/411871 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Ravindra Lokhande <rlokhande@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra30_ahub.c9
-rw-r--r--sound/soc/tegra/tegra30_i2s.c10
-rw-r--r--sound/soc/tegra/tegra_asoc_utils.c3
-rw-r--r--sound/soc/tegra/tegra_rt5639.c11
4 files changed, 15 insertions, 18 deletions
diff --git a/sound/soc/tegra/tegra30_ahub.c b/sound/soc/tegra/tegra30_ahub.c
index d57280e23318..dadacb636b64 100644
--- a/sound/soc/tegra/tegra30_ahub.c
+++ b/sound/soc/tegra/tegra30_ahub.c
@@ -1,7 +1,7 @@
/*
* tegra30_ahub.c - Tegra30 AHUB driver
*
- * Copyright (c) 2011-2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -766,7 +766,6 @@ static int tegra30_ahub_probe(struct platform_device *pdev)
struct resource *res0, *res1, *region;
u32 of_dma[2];
void __iomem *regs_apbif, *regs_ahub;
- int clkm_rate;
int ret = 0;
if (ahub)
@@ -806,12 +805,6 @@ static int tegra30_ahub_probe(struct platform_device *pdev)
ret = PTR_ERR(ahub->clk_d_audio);
goto err;
}
- clkm_rate = clk_get_rate(clk_get_parent(ahub->clk_d_audio));
-
- while (clkm_rate > 13000000)
- clkm_rate >>= 1;
-
- clk_set_rate(ahub->clk_d_audio,clkm_rate);
ahub->clk_apbif = clk_get(&pdev->dev, "apbif");
if (IS_ERR(ahub->clk_apbif)) {
diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index 3d627e840f69..c54e078014a0 100644
--- a/sound/soc/tegra/tegra30_i2s.c
+++ b/sound/soc/tegra/tegra30_i2s.c
@@ -478,9 +478,11 @@ static int tegra30_i2s_hw_params(struct snd_pcm_substream *substream,
sample_size = 16;
break;
case SNDRV_PCM_FORMAT_S24_LE:
- val = TEGRA30_I2S_CTRL_BIT_SIZE_24;
- sample_size = 24;
- break;
+ /* Fallthrough
+ * for 24 bit audio we support only S24_LE (S24_3LE is not
+ * supported) which is rendered on bus in 32 bits packet so
+ * consider as 32 bit
+ */
case SNDRV_PCM_FORMAT_S32_LE:
val = TEGRA30_I2S_CTRL_BIT_SIZE_32;
sample_size = 32;
@@ -948,7 +950,7 @@ static struct snd_soc_dai_driver tegra30_i2s_dai_template = {
.stream_name = "Playback",
.channels_min = 1,
.channels_max = 16,
- .rates = SNDRV_PCM_RATE_8000_96000,
+ .rates = SNDRV_PCM_RATE_8000_192000,
.formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE,
},
diff --git a/sound/soc/tegra/tegra_asoc_utils.c b/sound/soc/tegra/tegra_asoc_utils.c
index 0e22b6204f35..52e898983198 100644
--- a/sound/soc/tegra/tegra_asoc_utils.c
+++ b/sound/soc/tegra/tegra_asoc_utils.c
@@ -2,7 +2,7 @@
* tegra_asoc_utils.c - Harmony machine ASoC driver
*
* Author: Stephen Warren <swarren@nvidia.com>
- * Copyright (c) 2010-2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2010-2014, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -387,6 +387,7 @@ int tegra_asoc_utils_set_rate(struct tegra_asoc_utils_data *data, int srate,
case 48000:
case 64000:
case 96000:
+ case 192000:
if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA20)
new_baseclock = 73728000;
else if (data->soc == TEGRA_ASOC_UTILS_SOC_TEGRA30)
diff --git a/sound/soc/tegra/tegra_rt5639.c b/sound/soc/tegra/tegra_rt5639.c
index ae16793491f5..f002c5bed286 100644
--- a/sound/soc/tegra/tegra_rt5639.c
+++ b/sound/soc/tegra/tegra_rt5639.c
@@ -312,12 +312,13 @@ static int tegra_rt5639_hw_params(struct snd_pcm_substream *substream,
}
}
- /*for 24 bit audio we support only S24_LE (S24_3LE is not supported)
- which is rendered on bus in 32 bits packet so consider as 32 bit
- depth in clock calculations, extra 4 is required by codec,
- God knows why ?*/
+ /*
+ * For 24 bit audio we support only S24_LE (S24_3LE is not supported)
+ * which is rendered on bus in 32 bits packet so consider as 32 bit
+ * depth in clock calculations
+ */
if (sample_size == 24)
- i2sclock = srate * params_channels(params) * 32 * 4;
+ i2sclock = srate * params_channels(params) * 32;
else
i2sclock = 0;