[ARM] tegra: stingray: Do not load usb devices in factory and recovery mode
authorJames Wilson <james.wilson@motorola.com>
Tue, 23 Nov 2010 21:00:44 +0000 (15:00 -0600)
committerColin Cross <ccross@android.com>
Wed, 1 Dec 2010 00:25:27 +0000 (16:25 -0800)
Skips adding USB and gadget devices when both using a factory
cable and in recovery mode.

Change-Id: Ibf47ded70237d83d5b1b49bcfc24e3c976ff03ce
Signed-off-by: James Wilson <james.wilson@motorola.com>
arch/arm/mach-tegra/board-stingray.c

index ba0cac1b5aa8303c6a79387cdbe1dbe5a71834fa..a746011b09763d282f6faecf2280e89caeeb9ecb 100644 (file)
@@ -719,7 +719,9 @@ static void stingray_usb_init(void)
        tegra_ehci2_device.dev.platform_data = &tegra_ehci_pdata[1];
        tegra_ehci3_device.dev.platform_data = &tegra_ehci_pdata[2];
 
-       platform_device_register(&tegra_udc_device);
+       if (strncmp(boot_mode, "factorycable", BOOT_MODE_MAX_LEN) ||
+            !mot_boot_recovery)
+               platform_device_register(&tegra_udc_device);
        platform_device_register(&tegra_ehci2_device);
        platform_device_register(&tegra_ehci3_device);
 #ifdef CONFIG_USB_ANDROID_RNDIS
@@ -748,7 +750,10 @@ static void stingray_usb_init(void)
 
        platform_data->serial_number = usb_serial_num;
        androidusb_device.dev.platform_data = platform_data;
-       platform_device_register(&androidusb_device);
+
+       if (strncmp(boot_mode, "factorycable", BOOT_MODE_MAX_LEN) ||
+            !mot_boot_recovery)
+               platform_device_register(&androidusb_device);
 }
 
 static void stingray_reset(char mode, const char *cmd)