ASoC: Add S3C64xx IIS CDCLK source selection
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 16 Sep 2009 18:38:53 +0000 (19:38 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 16 Sep 2009 20:07:50 +0000 (21:07 +0100)
CDCLK can either be an output generated by the CPU, intended for use
as the CODEC master clock, or an input (probably from the CODEC)
providing a master clock for the IIS block.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
arch/arm/plat-s3c/include/plat/regs-s3c2412-iis.h
sound/soc/s3c24xx/s3c64xx-i2s.c
sound/soc/s3c24xx/s3c64xx-i2s.h

index 07659dad1748a95ebcba9ad72f3d76f1905ea113..abf2fbc2eb2f0d25c02daa82e896690aecd5263b 100644 (file)
@@ -67,6 +67,8 @@
 #define S3C2412_IISMOD_BCLK_MASK       (3 << 1)
 #define S3C2412_IISMOD_8BIT            (1 << 0)
 
+#define S3C64XX_IISMOD_CDCLKCON                (1 << 12)
+
 #define S3C2412_IISPSR_PSREN           (1 << 15)
 
 #define S3C2412_IISFIC_TXFLUSH         (1 << 15)
index 3c06c401d0fb86ce6a4b98cb55264af36c807b4c..aaf452096be2d83894ed29558768da43d324ff01 100644 (file)
@@ -99,6 +99,19 @@ static int s3c64xx_i2s_set_sysclk(struct snd_soc_dai *cpu_dai,
                iismod |= S3C64XX_IISMOD_IMS_SYSMUX;
                break;
 
+       case S3C64XX_CLKSRC_CDCLK:
+               switch (dir) {
+               case SND_SOC_CLOCK_IN:
+                       iismod |= S3C64XX_IISMOD_CDCLKCON;
+                       break;
+               case SND_SOC_CLOCK_OUT:
+                       iismod &= ~S3C64XX_IISMOD_CDCLKCON;
+                       break;
+               default:
+                       return -EINVAL;
+               }
+               break;
+
        default:
                return -EINVAL;
        }
index 02148cee26139fe1ca4df20df734d9314ca43486..abe7253b55fc37bf72447c69ea7e80feeb9b23b0 100644 (file)
@@ -25,6 +25,7 @@ struct clk;
 
 #define S3C64XX_CLKSRC_PCLK    (0)
 #define S3C64XX_CLKSRC_MUX     (1)
+#define S3C64XX_CLKSRC_CDCLK    (2)
 
 extern struct snd_soc_dai s3c64xx_i2s_dai[];