From: Viswanath Puttagunta <vi...@ti.com>

The charger detection module is getting
disabled during boot up if a DCP (Dedicated charging port)
is connected before device is powered on (Bit 30 of CONTROL_USB2PHYCORE
is set). This patch enables charger type detection each time the charger type
wants to be detected.

Signed-off-by: Viswanath Puttagunta <vi...@ti.com>
Signed-off-by: Moiz Sonasath <m-sonas...@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kis...@ti.com>
---
 arch/arm/mach-omap2/omap_phy_internal.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_phy_internal.c 
b/arch/arm/mach-omap2/omap_phy_internal.c
index e5a6701..55918ea 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -49,6 +49,7 @@
 #define CHARGER_TYPE_HOST              0x5
 #define CHARGER_TYPE_PC                        0x6
 #define USB2PHY_CHGDETECTED            BIT(13)
+#define USB2PHY_DISCHGDET              BIT(30)
 
 static struct clk *phyclk, *clk48m, *clk32k;
 static void __iomem *ctrl_base;
@@ -124,6 +125,10 @@ int omap4_charger_detect(void)
 
        omap4430_phy_power(NULL, 0, 1);
 
+       usb2phycore = omap4_ctrl_pad_readl(CONTROL_USB2PHYCORE);
+       usb2phycore &= ~USB2PHY_DISCHGDET;
+       omap4_ctrl_pad_writel(usb2phycore, CONTROL_USB2PHYCORE);
+
        timeout = jiffies + msecs_to_jiffies(500);
        do {
                usb2phycore = omap4_ctrl_pad_readl(CONTROL_USB2PHYCORE);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to