stingray: Set AP to QCOM BP status pins for BP USB HW Bypass
authorJohn Michelau <john.michelau@motorola.com>
Mon, 29 Nov 2010 23:21:51 +0000 (17:21 -0600)
committerBenoit Goby <benoit@android.com>
Fri, 3 Dec 2010 02:34:32 +0000 (18:34 -0800)
The AP status pins must be set properly to tell the BP that
we've booted into BP USB HW Bypass mode. They were previously
set incorrectly, which was preventing the BP from going
online automatically as it should.

Change-Id: Ic60bea141f6d5be270cdabb83fd4f38c7bdf8de7
Signed-off-by: John Michelau <john.michelau@motorola.com>
arch/arm/mach-tegra/board-stingray-power.c

index 99926aa6c1eef99bb0b5ae4877740c0b1bb5fdbc..03230d7639a6445715f33f14e1588e0b04ab7535 100644 (file)
@@ -695,6 +695,7 @@ 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. */
@@ -715,7 +716,7 @@ int __init stingray_power_init(void)
        for (i = 0; i < ARRAY_SIZE(cpcap_devices); i++)
                cpcap_device_register(cpcap_devices[i]);
 
-       if (!stingray_qbp_usb_hw_bypass_enabled())
+       if (!qbp_usb_hw_bypass_enabled)
                cpcap_device_register(&cpcap_whisper_device);
 
        (void) cpcap_driver_register(&cpcap_validity_driver);
@@ -726,6 +727,16 @@ int __init stingray_power_init(void)
        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);
 
        return 0;