]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ASoC: S3C: I2Sv2: Unify i2s_get_clock callback
authorJassi Brar <jassi.brar@samsung.com>
Tue, 27 Apr 2010 06:56:45 +0000 (15:56 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 5 May 2010 14:13:20 +0000 (15:13 +0100)
Now that we have two callbacks s3c2412_i2s_get_clock & s3c64xx_i2s_get_clock
doing exactly the same thing, we can define one generic s3c_i2sv2_get_clock
and discard other two copies. Also, switch the users to make calls to the
newly defined and generic s3c_i2sv2_get_clock

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/s3c24xx/jive_wm8750.c
sound/soc/s3c24xx/s3c-i2s-v2.c
sound/soc/s3c24xx/s3c-i2s-v2.h
sound/soc/s3c24xx/s3c2412-i2s.c
sound/soc/s3c24xx/s3c2412-i2s.h
sound/soc/s3c24xx/s3c64xx-i2s.c
sound/soc/s3c24xx/s3c64xx-i2s.h

index 97d8ff3196be96b8b0c12eb350d8572d47b20783..8c108b121c10de97f4fbc2f786b54e40c23f9b8f 100644 (file)
@@ -70,7 +70,7 @@ static int jive_hw_params(struct snd_pcm_substream *substream,
        }
 
        s3c_i2sv2_iis_calc_rate(&div, NULL, params_rate(params),
-                               s3c2412_get_iisclk());
+                               s3c_i2sv2_get_clock(cpu_dai));
 
        /* set codec DAI configuration */
        ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
index b8803a182cc1f7ec76054499afeec62acc3850a1..ac153ca9c6289fdf5654e10748999412fa7c7d08 100644 (file)
@@ -516,6 +516,18 @@ static snd_pcm_sframes_t s3c2412_i2s_delay(struct snd_pcm_substream *substream,
        return delay;
 }
 
+struct clk *s3c_i2sv2_get_clock(struct snd_soc_dai *cpu_dai)
+{
+       struct s3c_i2sv2_info *i2s = to_info(cpu_dai);
+       u32 iismod = readl(i2s->regs + S3C2412_IISMOD);
+
+       if (iismod & S3C2412_IISMOD_IMS_SYSMUX)
+               return i2s->iis_cclk;
+       else
+               return i2s->iis_pclk;
+}
+EXPORT_SYMBOL_GPL(s3c_i2sv2_get_clock);
+
 /* default table of all avaialable root fs divisors */
 static unsigned int iis_fs_tab[] = { 256, 512, 384, 768 };
 
index ea56467f5adc92b92ceb42f4436bb823180fc4ce..39a6db6a565c9b3f1f3080f34c2bc7e436658b1f 100644 (file)
@@ -60,6 +60,8 @@ struct s3c_i2sv2_info {
        u32              suspend_iispsr;
 };
 
+extern struct clk *s3c_i2sv2_get_clock(struct snd_soc_dai *cpu_dai);
+
 struct s3c_i2sv2_rate_calc {
        unsigned int    clk_div;        /* for prescaler */
        unsigned int    fs_div;         /* for root frame clock */
index ce2daacc4eb97a028e006849e98d143385acf503..6b884d75235ec5297ae38e3c784f2b14bb96af9a 100644 (file)
@@ -91,19 +91,6 @@ static int s3c2412_i2s_set_sysclk(struct snd_soc_dai *cpu_dai,
        return 0;
 }
 
-
-struct clk *s3c2412_get_iisclk(void)
-{
-       struct s3c_i2sv2_info *i2s = &s3c2412_i2s;
-       u32 iismod = readl(i2s->regs + S3C2412_IISMOD);
-
-       if (iismod & S3C2412_IISMOD_IMS_SYSMUX)
-               return i2s->iis_cclk;
-       else
-               return i2s->iis_pclk;
-}
-EXPORT_SYMBOL_GPL(s3c2412_get_iisclk);
-
 static inline struct s3c_i2sv2_info *to_info(struct snd_soc_dai *cpu_dai)
 {
        return cpu_dai->private_data;
index 60cac002a8303620b44bad4bf9056fa7e8c2c754..0b5686b4d5c36fb4c307132b6c654017dd583657 100644 (file)
@@ -24,8 +24,6 @@
 #define S3C2412_CLKSRC_PCLK    S3C_I2SV2_CLKSRC_PCLK
 #define S3C2412_CLKSRC_I2SCLK  S3C_I2SV2_CLKSRC_AUDIOBUS
 
-extern struct clk *s3c2412_get_iisclk(void);
-
 extern struct snd_soc_dai s3c2412_i2s_dai;
 
 #endif /* __SND_SOC_S3C24XX_S3C2412_I2S_H */
index b7e951fe30a6b95b088baedf96c542ed10bae022..97327ef09de62a2c64b2930c7264806061ccfa80 100644 (file)
@@ -91,18 +91,6 @@ static int s3c64xx_i2s_set_sysclk(struct snd_soc_dai *cpu_dai,
        return 0;
 }
 
-struct clk *s3c64xx_i2s_get_clock(struct snd_soc_dai *dai)
-{
-       struct s3c_i2sv2_info *i2s = to_info(dai);
-       u32 iismod = readl(i2s->regs + S3C2412_IISMOD);
-
-       if (iismod & S3C64XX_IISMOD_IMS_SYSMUX)
-               return i2s->iis_cclk;
-       else
-               return i2s->iis_pclk;
-}
-EXPORT_SYMBOL_GPL(s3c64xx_i2s_get_clock);
-
 static int s3c64xx_i2s_probe(struct platform_device *pdev,
                             struct snd_soc_dai *dai)
 {
index 53d2a0a0df362492838ab37b38a07a9fe3f6716e..f27ed50e4d82e8d18f37508e583680cd01fed855 100644 (file)
@@ -38,6 +38,4 @@ struct clk;
 
 extern struct snd_soc_dai s3c64xx_i2s_dai[];
 
-extern struct clk *s3c64xx_i2s_get_clock(struct snd_soc_dai *dai);
-
 #endif /* __SND_SOC_S3C24XX_S3C64XX_I2S_H */