ARM: tegra: stingray: Add support for wifi-only model
authorBenoit Goby <benoit@android.com>
Thu, 10 Feb 2011 01:12:46 +0000 (17:12 -0800)
committerBenoit Goby <benoit@android.com>
Fri, 18 Feb 2011 22:12:30 +0000 (14:12 -0800)
Change-Id: Ia165295d00577474e03f8c28d74f7346a9eeed44
Signed-off-by: Benoit Goby <benoit@android.com>
arch/arm/mach-tegra/board-stingray-power.c
arch/arm/mach-tegra/board-stingray.c

index afd7640f301d0b6c99b37f48c51b9e34e3640947..e794a7eada37bb263262ba309b0104f4ab0dca40 100644 (file)
@@ -696,11 +696,30 @@ static struct platform_device mdm_ctrl_platform_device = {
        },
 };
 
+static void mdm_ctrl_register(void)
+{
+       int i;
+
+       for (i = 0; i < MDM_CTRL_NUM_GPIOS; i++)
+               tegra_gpio_enable(mdm_ctrl_platform_data.gpios[i].number);
+
+       if (stingray_qbp_usb_hw_bypass_enabled()) {
+               /* The default AP status is "no bypass", so we must override it */
+               mdm_ctrl_platform_data.gpios[MDM_CTRL_GPIO_AP_STATUS_0]. \
+                               default_value = 1;
+               mdm_ctrl_platform_data.gpios[MDM_CTRL_GPIO_AP_STATUS_1]. \
+                               default_value = 0;
+               mdm_ctrl_platform_data.gpios[MDM_CTRL_GPIO_AP_STATUS_2]. \
+                               default_value = 0;
+       }
+
+       platform_device_register(&mdm_ctrl_platform_device);
+}
+
 int __init stingray_power_init(void)
 {
        int i;
        unsigned long pmc_cntrl_0;
-       int qbp_usb_hw_bypass_enabled = stingray_qbp_usb_hw_bypass_enabled();
 
        /* Enable CORE_PWR_REQ signal from T20. The signal must be enabled
         * before the CPCAP uC firmware is started. */
@@ -727,7 +746,7 @@ int __init stingray_power_init(void)
        for (i = 0; i < ARRAY_SIZE(cpcap_devices); i++)
                cpcap_device_register(cpcap_devices[i]);
 
-       if (!qbp_usb_hw_bypass_enabled)
+       if (!stingray_qbp_usb_hw_bypass_enabled())
                cpcap_device_register(&cpcap_whisper_device);
 
        (void) cpcap_driver_register(&cpcap_validity_driver);
@@ -735,20 +754,8 @@ int __init stingray_power_init(void)
        i2c_register_board_info(3, stingray_i2c_bus4_power_info,
                ARRAY_SIZE(stingray_i2c_bus4_power_info));
 
-       for (i = 0; i < MDM_CTRL_NUM_GPIOS; i++)
-               tegra_gpio_enable(mdm_ctrl_platform_data.gpios[i].number);
-
-       if (qbp_usb_hw_bypass_enabled) {
-               /* The default AP status is "no bypass", so we must override it */
-               mdm_ctrl_platform_data.gpios[MDM_CTRL_GPIO_AP_STATUS_0]. \
-                               default_value = 1;
-               mdm_ctrl_platform_data.gpios[MDM_CTRL_GPIO_AP_STATUS_1]. \
-                               default_value = 0;
-               mdm_ctrl_platform_data.gpios[MDM_CTRL_GPIO_AP_STATUS_2]. \
-                               default_value = 0;
-       }
-
-       platform_device_register(&mdm_ctrl_platform_device);
+       if (stingray_hw_has_cdma())
+               mdm_ctrl_register();
 
        return 0;
 }
index 8bfcfb0aeda163f725bc4eb7bf66c7010d6a5d2f..7c3a653681fa3c662573134726ebbfceffcc9b39 100644 (file)
@@ -764,8 +764,12 @@ static void stingray_usb_init(void)
        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);
+
+       if (stingray_hw_has_cdma()) {
+               platform_device_register(&tegra_ehci2_device);
+               platform_device_register(&tegra_ehci3_device);
+       }
+
 #ifdef CONFIG_USB_ANDROID_RNDIS
        src = usb_serial_num;