aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-04-29 15:29:25 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-04-30 08:26:34 -0400
commit553b1dd58c5cf1abd6d0965041169400a3cff1ad (patch)
tree7cd7da476df8c709a6082862e4a16f71878021d0 /sound/soc/s3c24xx
parent51438449e717db54550b4676f38208092eb654da (diff)
ASoC: Fix data format configuration for S3C64xx IISv2 and add 24 bit
The data format configuration for S3C64xx IISv2 is completely different to that for S3C24xx. Instead of a single bit configuration in bit 0 of IISMOD we have format selection in bits 13 and 14 and bit clock rate selection in bits 1 and 2. While we're here add support for 24 bit samples in S3C64xx. At some point it may be desirable to expose the bit clock rate selection to users but given the limited configuration options that may not be required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/s3c24xx')
-rw-r--r--sound/soc/s3c24xx/s3c-i2s-v2.c22
-rw-r--r--sound/soc/s3c24xx/s3c64xx-i2s.c3
2 files changed, 23 insertions, 2 deletions
diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c
index 3b9201cfe43c..54f4119e6098 100644
--- a/sound/soc/s3c24xx/s3c-i2s-v2.c
+++ b/sound/soc/s3c24xx/s3c-i2s-v2.c
@@ -280,7 +280,7 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
280 */ 280 */
281#define IISMOD_MASTER_MASK (1 << 11) 281#define IISMOD_MASTER_MASK (1 << 11)
282#define IISMOD_SLAVE (1 << 11) 282#define IISMOD_SLAVE (1 << 11)
283#define IISMOD_MASTER (0x0) 283#define IISMOD_MASTER (0 << 11)
284#endif 284#endif
285 285
286 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { 286 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
@@ -341,6 +341,7 @@ static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,
341 iismod = readl(i2s->regs + S3C2412_IISMOD); 341 iismod = readl(i2s->regs + S3C2412_IISMOD);
342 pr_debug("%s: r: IISMOD: %x\n", __func__, iismod); 342 pr_debug("%s: r: IISMOD: %x\n", __func__, iismod);
343 343
344#if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413)
344 switch (params_format(params)) { 345 switch (params_format(params)) {
345 case SNDRV_PCM_FORMAT_S8: 346 case SNDRV_PCM_FORMAT_S8:
346 iismod |= S3C2412_IISMOD_8BIT; 347 iismod |= S3C2412_IISMOD_8BIT;
@@ -349,6 +350,25 @@ static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,
349 iismod &= ~S3C2412_IISMOD_8BIT; 350 iismod &= ~S3C2412_IISMOD_8BIT;
350 break; 351 break;
351 } 352 }
353#endif
354
355#ifdef CONFIG_PLAT_S3C64XX
356 iismod &= ~0x606;
357 /* Sample size */
358 switch (params_format(params)) {
359 case SNDRV_PCM_FORMAT_S8:
360 /* 8 bit sample, 16fs BCLK */
361 iismod |= 0x2004;
362 break;
363 case SNDRV_PCM_FORMAT_S16_LE:
364 /* 16 bit sample, 32fs BCLK */
365 break;
366 case SNDRV_PCM_FORMAT_S24_LE:
367 /* 24 bit sample, 48fs BCLK */
368 iismod |= 0x4002;
369 break;
370 }
371#endif
352 372
353 writel(iismod, i2s->regs + S3C2412_IISMOD); 373 writel(iismod, i2s->regs + S3C2412_IISMOD);
354 pr_debug("%s: w: IISMOD: %x\n", __func__, iismod); 374 pr_debug("%s: w: IISMOD: %x\n", __func__, iismod);
diff --git a/sound/soc/s3c24xx/s3c64xx-i2s.c b/sound/soc/s3c24xx/s3c64xx-i2s.c
index cb11f7831474..e0f4a1644f1f 100644
--- a/sound/soc/s3c24xx/s3c64xx-i2s.c
+++ b/sound/soc/s3c24xx/s3c64xx-i2s.c
@@ -146,7 +146,8 @@ static int s3c64xx_i2s_probe(struct platform_device *pdev,
146 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000) 146 SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
147 147
148#define S3C64XX_I2S_FMTS \ 148#define S3C64XX_I2S_FMTS \
149 (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE) 149 (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |\
150 SNDRV_PCM_FMTBIT_S24_LE)
150 151
151static struct snd_soc_dai_ops s3c64xx_i2s_dai_ops = { 152static struct snd_soc_dai_ops s3c64xx_i2s_dai_ops = {
152 .set_sysclk = s3c64xx_i2s_set_sysclk, 153 .set_sysclk = s3c64xx_i2s_set_sysclk,