[RFC PATCH 4/6] MUSB Charger Type Detection: Fix DCP detect during boot.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Viswanath Puttagunta <vishp@xxxxxx>

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 <vishp@xxxxxx>
Signed-off-by: Moiz Sonasath <m-sonasath@xxxxxx>
Signed-off-by: Kishon Vijay Abraham I <kishon@xxxxxx>
---
 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux