]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/usb/chipidea/ci_hdrc_imx.c
MLK-10279-2 usb: chipidea: imx: only do charger detection if we enable it
[karo-tx-linux.git] / 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);