This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Unknown charger detected after connecting to PC Host occasionally

Other Parts Discussed in Thread: TWL6032

Our software is based on 4AJ2.1 release and we are using omap4430 and PMIC twl6032. When I connect our device to PC host, most time it report PC type in omap4_charger_detect function at /arch/arm/mach-omap2/omap_phy_internal.c.

However, sometimes it reports "Unknown charger", the bit 23:21 in CONTROL_USB2PHYCORE indicate 0(Wait state). And I need to reconnect USB cable to let PC host recognize the device. First, I don't know how it ends up in Wait state. Second, is there any way to reset the USB port from OMAP when it faces such condition? Thanks!

  • Hi Li Chen,

    First you can thinker with the jiffies value in: omap4_charger_detect(void)

    timeout = jiffies + msecs_to_jiffies(2000);

    and also see if this peace of code is implemented after it:

    1. <       omap4_ctrl_pad_writel(omap4_ctrl_pad_readl(CONTROL_USB2PHYCORE) & ~USB2PHY_DISCHGDET, CONTROL_USB2PHYCORE);
    2. <       do {
    3. <               msleep(10);
    4. <               usb2phycore = omap4_ctrl_pad_readl(CONTROL_USB2PHYCORE);
    5. <               chargertype = ((usb2phycore >> 21) & 0x7);
    6. <               if (chargertype)
    7. <               {
    8. <                       // Give things time to settle.
    9. <                       msleep(5);
    10. <                       usb2phycore = omap4_ctrl_pad_readl(CONTROL_USB2PHYCORE);
    11. <                       chargertype = ((usb2phycore >> 21) & 0x7);
    12. <                       break;
    13. <               }
    14. <       } while (!time_after(jiffies, timeout));

    Regards,

    Boyko