* [PATCH 06/10] S3C I2S: LRCLK polarity option.
@ 2009-09-15 10:02 Jassi
2009-09-15 10:56 ` Mark Brown
2009-09-15 12:30 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Jassi @ 2009-09-15 10:02 UTC (permalink / raw)
To: linux-arm-kernel
1) Explicitly set LRCLK polarity for I2S Vs LSM/MSB modes.
2) Convert from numerical to bit-field values for BCLK selection.
3) Use proper error checking for return value from clk_get
Signed-Off-by: Jassi <jassi.brar@samsung.com>
---
sound/soc/s3c24xx/s3c-i2s-v2.c | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/sound/soc/s3c24xx/s3c-i2s-v2.c b/sound/soc/s3c24xx/s3c-i2s-v2.c
index 8865bc7..1870e05 100644
--- a/sound/soc/s3c24xx/s3c-i2s-v2.c
+++ b/sound/soc/s3c24xx/s3c-i2s-v2.c
@@ -312,12 +312,15 @@ static int s3c2412_i2s_set_fmt(struct snd_soc_dai *cpu_dai,
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_RIGHT_J:
+ iismod |= S3C2412_IISMOD_LR_RLOW;
iismod |= S3C2412_IISMOD_SDF_MSB;
break;
case SND_SOC_DAIFMT_LEFT_J:
+ iismod |= S3C2412_IISMOD_LR_RLOW;
iismod |= S3C2412_IISMOD_SDF_LSB;
break;
case SND_SOC_DAIFMT_I2S:
+ iismod &= ~S3C2412_IISMOD_LR_RLOW;
iismod |= S3C2412_IISMOD_SDF_IIS;
break;
default:
@@ -467,6 +470,31 @@ static int s3c2412_i2s_set_clkdiv(struct snd_soc_dai *cpu_dai,
switch (div_id) {
case S3C_I2SV2_DIV_BCLK:
+ if (div > 3) {
+ /* convert value to bit field */
+
+ switch (div) {
+ case 16:
+ div = S3C2412_IISMOD_BCLK_16FS;
+ break;
+
+ case 32:
+ div = S3C2412_IISMOD_BCLK_32FS;
+ break;
+
+ case 24:
+ div = S3C2412_IISMOD_BCLK_24FS;
+ break;
+
+ case 48:
+ div = S3C2412_IISMOD_BCLK_48FS;
+ break;
+
+ default:
+ return -EINVAL;
+ }
+ }
+
reg = readl(i2s->regs + S3C2412_IISMOD);
reg &= ~S3C2412_IISMOD_BCLK_MASK;
writel(reg | div, i2s->regs + S3C2412_IISMOD);
@@ -626,7 +654,7 @@ int s3c_i2sv2_probe(struct platform_device *pdev,
}
i2s->iis_pclk = clk_get(dev, "iis");
- if (i2s->iis_pclk == NULL) {
+ if (IS_ERR(i2s->iis_pclk)) {
dev_err(dev, "failed to get iis_clock\n");
iounmap(i2s->regs);
return -ENOENT;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 06/10] S3C I2S: LRCLK polarity option.
2009-09-15 10:02 [PATCH 06/10] S3C I2S: LRCLK polarity option Jassi
@ 2009-09-15 10:56 ` Mark Brown
2009-09-15 12:30 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2009-09-15 10:56 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 15, 2009 at 07:02:38PM +0900, Jassi wrote:
> 1) Explicitly set LRCLK polarity for I2S Vs LSM/MSB modes.
> 2) Convert from numerical to bit-field values for BCLK selection.
> 3) Use proper error checking for return value from clk_get
This is three separate patches you've merged into one here... Ideally
at least patch 3 and possibly also patch 1 ought to be applied as bug
fixes for 2.6.32 but you've mixed them all together for some reason?
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 06/10] S3C I2S: LRCLK polarity option.
2009-09-15 10:02 [PATCH 06/10] S3C I2S: LRCLK polarity option Jassi
2009-09-15 10:56 ` Mark Brown
@ 2009-09-15 12:30 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2009-09-15 12:30 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Sep 15, 2009 at 07:02:38PM +0900, Jassi wrote:
> 1) Explicitly set LRCLK polarity for I2S Vs LSM/MSB modes.
> 2) Convert from numerical to bit-field values for BCLK selection.
> 3) Use proper error checking for return value from clk_get
> Signed-Off-by: Jassi <jassi.brar@samsung.com>
I'll apply this for 2.6.33 - the errors aren't that serious (I'd be
surprised to see anyone choose left or right justified modes at all).
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-09-15 12:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-15 10:02 [PATCH 06/10] S3C I2S: LRCLK polarity option Jassi
2009-09-15 10:56 ` Mark Brown
2009-09-15 12:30 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.