UBUNTU: SAUCE: omap3: beagle: detect new xM revision C
authorRobert Nelson <robertcnelson@gmail.com>
Tue, 26 Apr 2011 05:09:44 +0000 (02:09 -0300)
committerSteve Conklin <sconklin@canonical.com>
Thu, 2 Jun 2011 19:23:18 +0000 (14:23 -0500)
Beagle xM rev C has nEN_USB_PWR inverted again, so we need
proper check for revision C.

BugLink: http://bugs.launchpad.net/bugs/770679

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Acked-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

arch/arm/mach-omap2/board-omap3beagle.c

index c157095..3448f67 100644 (file)
@@ -61,6 +61,7 @@
  *     C4      = GPIO173, GPIO172, GPIO171: 1 0 1
  *     XMA     = GPIO173, GPIO172, GPIO171: 0 0 0
  *     XMB     = GPIO173, GPIO172, GPIO171: 0 0 1
+ *     XMC     = GPIO173, GPIO172, GPIO171: 0 1 0
  */
 enum {
        OMAP3BEAGLE_BOARD_UNKN = 0,
@@ -68,6 +69,7 @@ enum {
        OMAP3BEAGLE_BOARD_C1_3,
        OMAP3BEAGLE_BOARD_C4,
        OMAP3BEAGLE_BOARD_XM,
+       OMAP3BEAGLE_BOARD_XMC,
 };
 
 static u8 omap3_beagle_version;
@@ -126,6 +128,10 @@ static void __init omap3_beagle_init_rev(void)
                printk(KERN_INFO "OMAP3 Beagle Rev: xM B\n");
                omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
                break;
+       case 2:
+               printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
+               omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
+               break;
        default:
                printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
                omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
@@ -254,7 +260,8 @@ static void __init beagle_display_init(void)
        int r;
 
        /* DVI reset GPIO is different between beagle revisions */
-       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
+       if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) ||
+                       (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC))
                beagle_dvi_device.reset_gpio = 129;
        else
                beagle_dvi_device.reset_gpio = 170;
@@ -294,7 +301,8 @@ static int beagle_twl_gpio_setup(struct device *dev,
 {
        int r;
 
-       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+       if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) ||
+                       (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC)) {
                mmc[0].gpio_wp = -EINVAL;
        } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
                (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
@@ -314,7 +322,8 @@ static int beagle_twl_gpio_setup(struct device *dev,
        /* REVISIT: need ehci-omap hooks for external VBUS
         * power switch and overcurrent detect
         */
-       if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
+       if ((omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) &&
+                       (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMC)) {
                r = gpio_request(gpio + 1, "EHCI_nOC");
                if (!r) {
                        r = gpio_direction_input(gpio + 1);
@@ -344,7 +353,8 @@ static int beagle_twl_gpio_setup(struct device *dev,
         * P7/P8 revisions(prototype): Camera EN
         * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
         */
-       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+       if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) ||
+                       (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC)) {
                r = gpio_request(gpio + 1, "nDVI_PWR_EN");
                if (!r) {
                        r = gpio_direction_output(gpio + 1, 0);