]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
MLK-10279-2 usb: chipidea: imx: only do charger detection if we enable it
authorPeter Chen <peter.chen@freescale.com>
Sun, 15 Feb 2015 07:44:43 +0000 (15:44 +0800)
committerPeter Chen <peter.chen@freescale.com>
Fri, 27 Feb 2015 00:33:39 +0000 (08:33 +0800)
We should only do charger detection if both we have enabled
usb charger at kernel configuration and set usb charger enable
at dts. Otherwise, we will do useless things, like toggle dp.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
(cherry picked from commit 6b677c09dbda0274c6b2e1d61ea0d7f1cc73f621)

drivers/usb/chipidea/ci_hdrc_imx.c

index 708c486b49a249aba2ccf2e66c996be3b80dca40..ce659d632c00ec871a0059ab429fe01d5badc858 100644 (file)
@@ -204,11 +204,12 @@ static int ci_hdrc_imx_notify_event(struct ci_hdrc *ci, unsigned event)
        switch (event) {
        case CI_HDRC_CONTROLLER_VBUS_EVENT:
                if (data->usbmisc_data && ci->vbus_active) {
-                       if (data->imx6_usb_charger_detection)
+                       if (data->imx6_usb_charger_detection) {
                                ret = imx6_usb_vbus_connect(&data->charger);
-                       if (!ret && data->charger.psy.type !=
-                                               POWER_SUPPLY_TYPE_USB)
-                               ret = CI_HDRC_NOTIFY_RET_DEFER_EVENT;
+                               if (!ret && data->charger.psy.type !=
+                                                       POWER_SUPPLY_TYPE_USB)
+                                       ret = CI_HDRC_NOTIFY_RET_DEFER_EVENT;
+                       }
                } else if (data->usbmisc_data && !ci->vbus_active) {
                        if (data->imx6_usb_charger_detection)
                                ret = imx6_usb_vbus_disconnect(&data->charger);