usb: chipidea: imx: enable OTG overcurrent in case USB subsystem is already started
authorNicolas Adell <nicolas.adell@actia.fr>
Mon, 27 Aug 2018 13:59:56 +0000 (15:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2019 08:52:37 +0000 (09:52 +0100)
[ Upstream commit 1dedbdf2bbb1ede8d96f35f9845ecae179dc1988 ]

When initializing the USB subsystem before starting the kernel,
OTG overcurrent detection is disabled. In case the OTG polarity of
overcurrent is low active, the overcurrent detection is never enabled
again and events cannot be reported as expected. Because imx usb
overcurrent polarity is low active by default, only detection needs
to be enable in usbmisc init function.

Signed-off-by: Nicolas Adell <nicolas.adell@actia.fr>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/chipidea/usbmisc_imx.c

index 20d02a5e418d936231fcb091e183c6f939d16701..c6577f489d0f6d7bd9ed006545c8d30eb89933d7 100644 (file)
@@ -273,6 +273,8 @@ static int usbmisc_imx6q_init(struct imx_usbmisc_data *data)
        } else if (data->oc_polarity == 1) {
                /* High active */
                reg &= ~(MX6_BM_OVER_CUR_DIS | MX6_BM_OVER_CUR_POLARITY);
+       } else {
+               reg &= ~(MX6_BM_OVER_CUR_DIS);
        }
        writel(reg, usbmisc->base + data->index * 4);