ASoC: SDP3430: Fix TWL GPIO6 pin mux request
authorCandelaria Villareal, Jorge <x0107209@ti.com>
Tue, 25 Aug 2009 15:13:25 +0000 (10:13 -0500)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 25 Aug 2009 18:30:32 +0000 (19:30 +0100)
Fix the write to PMBR1 register through I2C. Also, the constant which
holds the value to write is now called TWL4030_GPIO6_PWM0_MUTE. This
name is based on TRM to avoid confusion.

Signed-off-by: Jorge Eduardo Candelaria <x0107209@ti.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/omap/sdp3430.c

index f7e5b74..4a3f62d 100644 (file)
 #include "omap-pcm.h"
 #include "../codecs/twl4030.h"
 
-#define TWL4030_INTBR_PMBR1    0x0D
-#define EXTMUTE(value)         (value << 2)
+/* TWL4030 PMBR1 Register */
+#define TWL4030_INTBR_PMBR1            0x0D
+/* TWL4030 PMBR1 Register GPIO6 mux bit */
+#define TWL4030_GPIO6_PWM0_MUTE(value) (value << 2)
 
 static struct snd_soc_card snd_soc_sdp3430;
 
@@ -299,6 +301,7 @@ static struct platform_device *sdp3430_snd_device;
 static int __init sdp3430_soc_init(void)
 {
        int ret;
+       u8 pin_mux;
 
        if (!machine_is_omap_3430sdp()) {
                pr_debug("Not SDP3430!\n");
@@ -318,8 +321,12 @@ static int __init sdp3430_soc_init(void)
        *(unsigned int *)sdp3430_dai[1].cpu_dai->private_data = 2; /* McBSP3 */
 
        /* Set TWL4030 GPIO6 as EXTMUTE signal */
-       twl4030_i2c_write_u8(TWL4030_MODULE_INTBR, EXTMUTE(0x02),
-                                                       TWL4030_MODULE_INTBR);
+       twl4030_i2c_read_u8(TWL4030_MODULE_INTBR, &pin_mux,
+                                               TWL4030_INTBR_PMBR1);
+       pin_mux &= ~TWL4030_GPIO6_PWM0_MUTE(0x03);
+       pin_mux |= TWL4030_GPIO6_PWM0_MUTE(0x02);
+       twl4030_i2c_write_u8(TWL4030_MODULE_INTBR, pin_mux,
+                                               TWL4030_INTBR_PMBR1);
 
        ret = platform_device_add(sdp3430_snd_device);
        if (ret)