ARM: Tegra: usb_phy: WAR: Apple compatibility charger detect as NVcharger.
Hyongbin Kim [Thu, 20 Jun 2013 11:07:34 +0000 (20:07 +0900)]
NVcharger detection logic is defferent between BL and kernel.
Tegratab not use NVcharger, but apple chargers are detect as
NVcharger in BL and kernel can't detect apple compatibility
charger except iPad/iPhone5 charger.
It is better those are detected as NVcharger.
Tegratab charger IC support DPM(synamic Power Management) mode to
avoid over loading the adapter.

Bug 1308440
Bug 1299342

Change-Id: Idd36aee98c65350ca61b5237a25f9ac5ef81af2e
Signed-off-by: Hyongbin Kim <hyongbink@nvidia.com>
Reviewed-on: http://git-master/r/240581
(cherry picked from commit 930109e1ec09f4de809c692faceb7a8282bc66a1)
Reviewed-on: http://git-master/r/300437
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>

arch/arm/mach-tegra/tegra11x_usb_phy.c

index 9de5e50..f6bd2a5 100644 (file)
@@ -1464,8 +1464,6 @@ static void utmi_phy_pmc_disable(struct tegra_usb_phy *phy)
 }
 static bool utmi_phy_nv_charger_detect(struct tegra_usb_phy *phy)
 {
-       int status1;
-       int status2;
        int status3;
        bool ret;
 
@@ -1475,24 +1473,13 @@ static bool utmi_phy_nv_charger_detect(struct tegra_usb_phy *phy)
                return false;
 
        ret = false;
-       /* Turn off all terminations except DP pulldown */
-       status1 = utmi_phy_get_dp_dm_status(phy,
-                       DISABLE_PULLUP_DP | DISABLE_PULLUP_DM |
-                       FORCE_PULLDN_DP | DISABLE_PULLDN_DM);
-
-       /* Turn off all terminations except for DP pullup */
-       status2 = utmi_phy_get_dp_dm_status(phy,
-                       FORCE_PULLUP_DP | DISABLE_PULLUP_DM |
-                       DISABLE_PULLDN_DP | DISABLE_PULLDN_DM);
 
        /* Check for NV charger DISABLE all terminations */
        status3 = utmi_phy_get_dp_dm_status(phy,
                        DISABLE_PULLUP_DP | DISABLE_PULLUP_DM |
                        DISABLE_PULLDN_DP | DISABLE_PULLDN_DM);
 
-       if ((status1 == (USB_PORTSC_LINE_DP_SET | USB_PORTSC_LINE_DM_SET)) &&
-           (status2 == (USB_PORTSC_LINE_DP_SET | USB_PORTSC_LINE_DM_SET)) &&
-           (status3 == (USB_PORTSC_LINE_DP_SET | USB_PORTSC_LINE_DM_SET)))
+       if (status3 == (USB_PORTSC_LINE_DP_SET | USB_PORTSC_LINE_DM_SET))
                ret = true;
 
        /* Restore standard termination by hardware. */