From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 04/18] ASoC: Fix data format configuration for S3C64xx IISv2 and add 24 bit
Date: Tue, 5 May 2009 11:02:17 +0100 [thread overview]
Message-ID: <1241517751-2634-4-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20090505100123.GB2050@rakim.wolfsonmicro.main>
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>
---
sound/soc/s3c24xx/s3c-i2s-v2.c | 22 +++++++++++++++++++++-
sound/soc/s3c24xx/s3c64xx-i2s.c | 3 ++-
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 3b9201c..54f4119 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,
*/
#define IISMOD_MASTER_MASK (1 << 11)
#define IISMOD_SLAVE (1 << 11)
-#define IISMOD_MASTER (0x0)
+#define IISMOD_MASTER (0 << 11)
#endif
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
@@ -341,6 +341,7 @@ static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,
iismod = readl(i2s->regs + S3C2412_IISMOD);
pr_debug("%s: r: IISMOD: %x\n", __func__, iismod);
+#if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413)
switch (params_format(params)) {
case SNDRV_PCM_FORMAT_S8:
iismod |= S3C2412_IISMOD_8BIT;
@@ -349,6 +350,25 @@ static int s3c2412_i2s_hw_params(struct snd_pcm_substream *substream,
iismod &= ~S3C2412_IISMOD_8BIT;
break;
}
+#endif
+
+#ifdef CONFIG_PLAT_S3C64XX
+ iismod &= ~0x606;
+ /* Sample size */
+ switch (params_format(params)) {
+ case SNDRV_PCM_FORMAT_S8:
+ /* 8 bit sample, 16fs BCLK */
+ iismod |= 0x2004;
+ break;
+ case SNDRV_PCM_FORMAT_S16_LE:
+ /* 16 bit sample, 32fs BCLK */
+ break;
+ case SNDRV_PCM_FORMAT_S24_LE:
+ /* 24 bit sample, 48fs BCLK */
+ iismod |= 0x4002;
+ break;
+ }
+#endif
writel(iismod, i2s->regs + S3C2412_IISMOD);
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 cb11f78..e0f4a16 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,
SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)
#define S3C64XX_I2S_FMTS \
- (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE)
+ (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE |\
+ SNDRV_PCM_FMTBIT_S24_LE)
static struct snd_soc_dai_ops s3c64xx_i2s_dai_ops = {
.set_sysclk = s3c64xx_i2s_set_sysclk,
--
1.6.2.4
next prev parent reply other threads:[~2009-05-05 10:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-05 10:01 ASoC updates for 2.6.31 Mark Brown
2009-05-05 10:02 ` [PATCH 01/18] ASoC: Fix error message formatting in s3c64xx-i2s driver Mark Brown
2009-05-05 10:02 ` [PATCH 02/18] ASoC: Check for supported CPUs when building s3c-i2s-v2 Mark Brown
2009-05-05 10:02 ` [PATCH 03/18] ASoC: Make S3C64xx clock export function to return struct clk Mark Brown
2009-05-05 10:02 ` Mark Brown [this message]
2009-05-05 10:02 ` [PATCH 05/18] ASoC: Fix boot warnings from S3C IISv2 Mark Brown
2009-05-05 10:02 ` [PATCH 06/18] ASoC: Allow use of resource from the platform device for " Mark Brown
2009-05-05 10:02 ` [PATCH 07/18] ASoC: Display the clock rate used as the basis for rate calculation Mark Brown
2009-05-05 10:02 ` [PATCH 08/18] ASoC: Display S3C IISv2 mode and MS errors by default Mark Brown
2009-05-05 10:02 ` [PATCH 09/18] ASoC: Staticise txctrl and rxctrl for S3C IISv2 Mark Brown
2009-05-05 10:02 ` [PATCH 10/18] ASoC: Use platform device resource for S3C64xx IISv2 Mark Brown
2009-05-05 10:02 ` [PATCH 11/18] ASoC: Use a shared define for AC97 CODEC data formats Mark Brown
2009-05-05 10:02 ` [PATCH 12/18] ASoC: Remove unused DAI format defines Mark Brown
2009-05-05 10:02 ` [PATCH 13/18] ASoC: Fix errors in WM8990 Mark Brown
2009-05-05 10:02 ` [PATCH 14/18] ASoC: TWL4030: Add VDL analog bypass Mark Brown
2009-05-05 10:02 ` [PATCH 15/18] ASoC: TWL4030: Add voice digital loopback: sidetone Mark Brown
2009-05-05 10:02 ` [PATCH 16/18] ASoC: IMote2 ASoC Support Mark Brown
2009-05-05 10:02 ` [PATCH 17/18] ASoC: TWL4030: Add VIBRA output Mark Brown
2009-05-05 10:02 ` [PATCH 18/18] ASoC: Remove redundant codec pointer from DAIs Mark Brown
2009-05-05 10:45 ` ASoC updates for 2.6.31 Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1241517751-2634-4-git-send-email-broonie@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox