usb: chipidea: imx: Warn if oc polarity isn't specified
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 4 Dec 2018 08:31:30 +0000 (09:31 +0100)
committerPeter Chen <peter.chen@nxp.com>
Tue, 11 Dec 2018 01:13:10 +0000 (09:13 +0800)
The polarity of the over current detection pin isn't configured on i.MX6/7
if it's unspecified in the device tree. So the actual configuration depends
on bootloader behavior which is bad.

So encourage users to fix their device tree by issuing a warning in this
case.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/chipidea/ci_hdrc_imx.c

index 1951b37aa39dcaec61a7c5d57659998845676bcb..e81de9ca8729e2e7101ce0e6bcb8e15977377ff0 100644 (file)
@@ -148,6 +148,8 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
        } else if (of_find_property(np, "over-current-active-low", NULL)) {
                data->oc_pol_active_low = 1;
                data->oc_pol_configured = 1;
+       } else {
+               dev_warn(dev, "No over current polarity defined\n");
        }
 
        if (of_find_property(np, "external-vbus-divider", NULL))