Hello Fabio, On Fri, Nov 30, 2018 at 07:16:39PM -0200, Fabio Estevam wrote: > [Adding Matt] > > On Fri, Nov 30, 2018 at 6:53 PM Uwe Kleine-König > <u.kleine-koenig@xxxxxxxxxxxxxx> wrote: > > > > The status quo is: > > - on i.MX25 the overcurrent polarity is always explicitly configured as > > active high which matches the reset default. > > - on i.MX6 and i.MX7 the overcurrent polarity is active high after > > reset. usbmisc_imx6q_init() and usbmisc_imx7d_init() keep the current > > state (probably as setup by the bootloader or still the reset > > default) unless the polarity is explicitly configured as active high > > which then is configured. (So if the pin is active low and the > > bootloader didn't set this up the configuration is wrong.) > > > > To improve the situation always configure the reset default value unless > > the device tree configures the polarity (and then use this one). > > > > Note that as the reset default is active high on all platforms there is > > no need to check for the presence of "over-current-active-high". In the > > absence of "over-current-active-low" it doesn't matter if active high is > > configured because that's the default or because it is configured > > explicitly. > > > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> > > It seems that Matt is also interested in adding the > 'over-current-active-low' property: > https://patchwork.kernel.org/patch/10701311/ Looking at Matt's patch I noticed that I applied my patch on an old kernel version (4.14) :-| But I think Matt's patch is broken because in usbmisc_imx6q_init() in the last else branch MX6_BM_OVER_CUR_POLARITY isn't cleared. Other than that they don't look that different semantically. I will respin my patch on Monday. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |