omap: Fix MMC gpio_wp for BeagleBoard C2 and above
authorJarkko Nikula <jhnikula@gmail.com>
Thu, 24 Sep 2009 23:23:17 +0000 (16:23 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 24 Sep 2009 23:23:17 +0000 (16:23 -0700)
Earlier BeagleBoards were using pad AH8 muxed to GPIO29 for MMC write-protect.
However, this signal has been changed to pad AG9 in board revision C2.

Fix this by adding mux configuration for pad AG9, runtime check for board
revisions and set the gpio number and pad muxing accordingly.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/mux.c
arch/arm/plat-omap/include/mach/mux.h

index 500c9956876de8c71fcaddd39d1dc2258719c6ca..70df6b4dbcd4c65c5d339c797a48c5263a876f79 100644 (file)
@@ -139,8 +139,13 @@ static struct gpio_led gpio_leds[];
 static int beagle_twl_gpio_setup(struct device *dev,
                unsigned gpio, unsigned ngpio)
 {
+       if (system_rev >= 0x20 && system_rev <= 0x34301000) {
+               omap_cfg_reg(AG9_34XX_GPIO23);
+               mmc[0].gpio_wp = 23;
+       } else {
+               omap_cfg_reg(AH8_34XX_GPIO29);
+       }
        /* gpio + 0 is "mmc0_cd" (input/IRQ) */
-       omap_cfg_reg(AH8_34XX_GPIO29);
        mmc[0].gpio_cd = gpio + 0;
        twl4030_mmc_init(mmc);
 
index 339ba80ee683bca40a004011d378235b9d1b90a8..b5fac32aae704ea7515450779ffb1d7514b2a32e 100644 (file)
@@ -460,6 +460,8 @@ MUX_CFG_34XX("AF26_34XX_GPIO0", 0x1e0,
                OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AF22_34XX_GPIO9", 0xa18,
                OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("AG9_34XX_GPIO23", 0x5ee,
+               OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("AH8_34XX_GPIO29", 0x5fa,
                OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
 MUX_CFG_34XX("U8_34XX_GPIO54_OUT", 0x0b4,
index 4bcf8a59d8c0c81c1423519ee989fc8d5c02ec7d..0f49d2d563d9cd99a10759f935fa7923f6213abd 100644 (file)
@@ -840,6 +840,7 @@ enum omap34xx_index {
         */
        AF26_34XX_GPIO0,
        AF22_34XX_GPIO9,
+       AG9_34XX_GPIO23,
        AH8_34XX_GPIO29,
        U8_34XX_GPIO54_OUT,
        U8_34XX_GPIO54_DOWN,