* [v2,2/3] usb: chipidea: imx: Warn if oc polarity isn't specified
@ 2018-12-04 6:19 Peter Chen
0 siblings, 0 replies; 3+ messages in thread
From: Peter Chen @ 2018-12-04 6:19 UTC (permalink / raw)
To: Uwe Kleine-König, Shawn Guo
Cc: Fabio Estevam, linux-usb, linux-arm-kernel, kernel, mstarr
> 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(+)
>
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> index 80b4e4ef9b68..3dcfd0d97f94 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -141,6 +141,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 the platform doesn't support OC, the polarity setting is not needed. You could consider
getting polarity property only "disable-over-current" is not found at patch 1.
Peter
^ permalink raw reply [flat|nested] 3+ messages in thread
* [v2,2/3] usb: chipidea: imx: Warn if oc polarity isn't specified
@ 2018-12-04 8:20 Uwe Kleine-König
0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2018-12-04 8:20 UTC (permalink / raw)
To: PETER CHEN
Cc: Shawn Guo, Fabio Estevam, linux-usb, linux-arm-kernel, kernel, mstarr
Hello Peter,
On Tue, Dec 04, 2018 at 06:19:11AM +0000, PETER CHEN wrote:
> > diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> > index 80b4e4ef9b68..3dcfd0d97f94 100644
> > --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> > +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> > @@ -141,6 +141,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 the platform doesn't support OC, the polarity setting is not needed. You could consider
> getting polarity property only "disable-over-current" is not found at patch 1.
Right, just fixed that up and will send out v3 in a moment.
Best regards
Uwe
^ permalink raw reply [flat|nested] 3+ messages in thread
* [v2,2/3] usb: chipidea: imx: Warn if oc polarity isn't specified
@ 2018-12-02 21:33 Uwe Kleine-König
0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2018-12-02 21:33 UTC (permalink / raw)
To: Peter Chen, Shawn Guo
Cc: Fabio Estevam, linux-usb, linux-arm-kernel, kernel, Matthew Starr
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(+)
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index 80b4e4ef9b68..3dcfd0d97f94 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -141,6 +141,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))
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-12-04 8:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-04 6:19 [v2,2/3] usb: chipidea: imx: Warn if oc polarity isn't specified Peter Chen
-- strict thread matches above, loose matches on Subject: below --
2018-12-04 8:20 Uwe Kleine-König
2018-12-02 21:33 Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).