]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ep93xx: Don't use system controller defines in audio drivers
authorRyan Mallon <rmallon@gmail.com>
Wed, 11 Jan 2012 03:14:31 +0000 (14:14 +1100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 20 Jan 2012 13:58:27 +0000 (13:58 +0000)
Both the Snapper CL15 and EDB93xx audio drivers set the same audio
configuration in ep93xx_i2s_acquire. Remove the arguments to
ep93xx_i2s_acquire so that the audio drivers no longer need the
EP93XX_SYSCON defines exported.

Cc: Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Mika Westerberg <mika.westerberg@iki.fi>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Ryan Mallon <rmallon@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
arch/arm/mach-ep93xx/core.c
arch/arm/mach-ep93xx/include/mach/platform.h
sound/soc/ep93xx/edb93xx.c
sound/soc/ep93xx/snappercl15.c

index 24203f9a67967df314a6d3776d6ac581a8d22fb3..b5c1dae8327fd87ccf945913a185397142135ca5 100644 (file)
@@ -817,23 +817,12 @@ void __init ep93xx_register_i2s(void)
 #define EP93XX_I2SCLKDIV_MASK          (EP93XX_SYSCON_I2SCLKDIV_ORIDE | \
                                         EP93XX_SYSCON_I2SCLKDIV_SPOL)
 
-int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config)
+int ep93xx_i2s_acquire(void)
 {
        unsigned val;
 
-       /* Sanity check */
-       if (i2s_pins & ~EP93XX_SYSCON_DEVCFG_I2S_MASK)
-               return -EINVAL;
-       if (i2s_config & ~EP93XX_I2SCLKDIV_MASK)
-               return -EINVAL;
-
-       /* Must have only one of I2SONSSP/I2SONAC97 set */
-       if ((i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONSSP) ==
-           (i2s_pins & EP93XX_SYSCON_DEVCFG_I2SONAC97))
-               return -EINVAL;
-
-       ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_I2S_MASK);
-       ep93xx_devcfg_set_bits(i2s_pins);
+       ep93xx_devcfg_set_clear(EP93XX_SYSCON_DEVCFG_I2SONAC97,
+                       EP93XX_SYSCON_DEVCFG_I2S_MASK);
 
        /*
         * This is potentially racy with the clock api for i2s_mclk, sclk and 
@@ -843,7 +832,7 @@ int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config)
         */
        val = __raw_readl(EP93XX_SYSCON_I2SCLKDIV);
        val &= ~EP93XX_I2SCLKDIV_MASK;
-       val |= i2s_config;
+       val |= EP93XX_SYSCON_I2SCLKDIV_ORIDE | EP93XX_SYSCON_I2SCLKDIV_SPOL;
        ep93xx_syscon_swlocked_write(val, EP93XX_SYSCON_I2SCLKDIV);
 
        return 0;
index d4c934931f9d4cbf85c580355a0115f154ca241e..ad63d4be693fbfeca164a080a73e871118df2425 100644 (file)
@@ -59,7 +59,7 @@ void ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data);
 int ep93xx_keypad_acquire_gpio(struct platform_device *pdev);
 void ep93xx_keypad_release_gpio(struct platform_device *pdev);
 void ep93xx_register_i2s(void);
-int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config);
+int ep93xx_i2s_acquire(void);
 void ep93xx_i2s_release(void);
 void ep93xx_register_ac97(void);
 
index bae5cbbbd2b2d28c817c954f25e6dfc08faed22c..e01cb02abd3a91e17cfc9b3e22ee1df563feb22b 100644 (file)
@@ -85,9 +85,7 @@ static int __devinit edb93xx_probe(struct platform_device *pdev)
        struct snd_soc_card *card = &snd_soc_edb93xx;
        int ret;
 
-       ret = ep93xx_i2s_acquire(EP93XX_SYSCON_DEVCFG_I2SONAC97,
-                                EP93XX_SYSCON_I2SCLKDIV_ORIDE |
-                                EP93XX_SYSCON_I2SCLKDIV_SPOL);
+       ret = ep93xx_i2s_acquire();
        if (ret)
                return ret;
 
index ccae34a3f280dc08d8e33942389f46b27215ec87..a193cea3cf3cc73406a201db9e5aeb10b7772cc6 100644 (file)
@@ -103,9 +103,7 @@ static int __devinit snappercl15_probe(struct platform_device *pdev)
        struct snd_soc_card *card = &snd_soc_snappercl15;
        int ret;
 
-       ret = ep93xx_i2s_acquire(EP93XX_SYSCON_DEVCFG_I2SONAC97,
-                                EP93XX_SYSCON_I2SCLKDIV_ORIDE |
-                                EP93XX_SYSCON_I2SCLKDIV_SPOL);
+       ret = ep93xx_i2s_acquire();
        if (ret)
                return ret;