summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorVinod G <vinodg@nvidia.com>2011-01-13 18:03:28 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-04-26 15:49:27 -0700
commita5a16a1d8d16a80607932f529d8e3f4143c96d30 (patch)
treee81462ce93806ab69a134c5e1bc1da7153097d95 /sound
parent61f68483c0f4ae1145b31522e63516f0c1d56d46 (diff)
[arm/tegra] Initial version of T30 audio driver
Add driver support to ahub, dam & i2s Original-Change-Id: I7281f787f1dd747c780a2dd55e53412a229ed6c0 Reviewed-on: http://git-master/r/15902 Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Tested-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Change-Id: I146604556290f3f72f7efc95f32541d667fb0d00
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra_i2s.c29
-rw-r--r--sound/soc/tegra/tegra_soc.h4
2 files changed, 20 insertions, 13 deletions
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c
index 1f40cff697d8..dfcf184b689c 100644
--- a/sound/soc/tegra/tegra_i2s.c
+++ b/sound/soc/tegra/tegra_i2s.c
@@ -110,6 +110,7 @@ static inline void stop_i2s_capture(struct snd_soc_dai *cpu_dai)
i2s_fifo_enable(cpu_dai->id, I2S_FIFO_RX, 0);
while (i2s_get_status(cpu_dai->id) & I2S_I2S_FIFO_RX_BUSY);
}
+#endif
static int tegra_i2s_hw_params(struct snd_pcm_substream *substream,
@@ -124,15 +125,15 @@ static int tegra_i2s_hw_params(struct snd_pcm_substream *substream,
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S16_LE:
- val = I2S_BIT_SIZE_16;
+ val = AUDIO_BIT_SIZE_16;
sample_size = 16;
break;
case SNDRV_PCM_FORMAT_S24_LE:
- val = I2S_BIT_SIZE_24;
+ val = AUDIO_BIT_SIZE_24;
sample_size = 24;
break;
case SNDRV_PCM_FORMAT_S32_LE:
- val = I2S_BIT_SIZE_32;
+ val = AUDIO_BIT_SIZE_32;
sample_size = 32;
break;
default:
@@ -201,26 +202,24 @@ static int tegra_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
i2s_set_master(i2s_id, val1);
info->i2s_master = val1;
+ val2 = AUDIO_LRCK_LEFT_LOW;
+
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_DSP_A:
- val1 = I2S_BIT_FORMAT_DSP;
- val2 = 0;
+ val1 = AUDIO_FRAME_FORMAT_DSP;
break;
case SND_SOC_DAIFMT_DSP_B:
- val1 = I2S_BIT_FORMAT_DSP;
- val2 = 1;
+ val1 = AUDIO_FRAME_FORMAT_DSP;
+ val2 = AUDIO_LRCK_RIGHT_LOW;
break;
case SND_SOC_DAIFMT_I2S:
- val1 = I2S_BIT_FORMAT_I2S;
- val2 = 0;
+ val1 = AUDIO_FRAME_FORMAT_I2S;
break;
case SND_SOC_DAIFMT_RIGHT_J:
- val1 = I2S_BIT_FORMAT_RJM;
- val2 = 0;
+ val1 = AUDIO_FRAME_FORMAT_RJM;
break;
case SND_SOC_DAIFMT_LEFT_J:
- val1 = I2S_BIT_FORMAT_LJM;
- val2 = 0;
+ val1 = AUDIO_FRAME_FORMAT_LJM;
break;
default:
return -EINVAL;
@@ -530,7 +529,11 @@ static struct platform_driver tegra_i2s_driver = {
.probe = tegra_i2s_driver_probe,
.remove = __devexit_p(tegra_i2s_driver_remove),
.driver = {
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
.name = "i2s",
+#else
+ .name = "audio",
+#endif
.owner = THIS_MODULE,
},
};
diff --git a/sound/soc/tegra/tegra_soc.h b/sound/soc/tegra/tegra_soc.h
index 238497aacb2c..be122d2afd6c 100644
--- a/sound/soc/tegra/tegra_soc.h
+++ b/sound/soc/tegra/tegra_soc.h
@@ -36,7 +36,11 @@
#include <linux/tegra_audio.h>
#include <linux/regulator/consumer.h>
#include <mach/iomap.h>
+#if defined(CONFIG_ARCH_TEGRA_2x_SOC)
#include <mach/tegra2_i2s.h>
+#elif defined(CONFIG_ARCH_TEGRA_3x_SOC)
+#include <mach/tegra3_i2s.h>
+#endif
#include <mach/spdif.h>
#include <mach/irqs.h>
#include <mach/pinmux.h>