Patchwork [v3,2/3] usb: chipidea: imx: Warn if oc polarity isn't specified

login
register
mail settings
Submitter Uwe Kleine-König
Date Dec. 4, 2018, 8:31 a.m.
Message ID <20181204083131.12524-3-u.kleine-koenig@pengutronix.de>
Download mbox | patch
Permalink /patch/671647/
State New
Headers show

Comments

Uwe Kleine-König - Dec. 4, 2018, 8:31 a.m.
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>
---
 drivers/usb/chipidea/ci_hdrc_imx.c | 2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index 18b0ca87799c..1e7182272fb5 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -144,6 +144,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))