* [PATCH 1/2] usb: imx: fix overcurrent polarity handling on i.MX7
@ 2021-02-02 18:54 Michael Grzeschik
2021-02-02 18:54 ` [PATCH 2/2] usb: imx: add overcurrent polarity handling on i.MX6 Michael Grzeschik
2021-02-04 10:28 ` [PATCH 1/2] usb: imx: fix overcurrent polarity handling on i.MX7 Sascha Hauer
0 siblings, 2 replies; 3+ messages in thread
From: Michael Grzeschik @ 2021-02-02 18:54 UTC (permalink / raw)
To: barebox
The reference manual says the overcurrent polarity is changed to low
with the bit set. We fix that according to the description.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
drivers/usb/imx/imx-usb-misc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/imx/imx-usb-misc.c b/drivers/usb/imx/imx-usb-misc.c
index b663d073aa..660ebecd78 100644
--- a/drivers/usb/imx/imx-usb-misc.c
+++ b/drivers/usb/imx/imx-usb-misc.c
@@ -353,7 +353,7 @@ static __maybe_unused struct imx_usb_misc_data mx5_data = {
#define MX6_USB_CTRL(n) ((n) * 4)
#define MX6_USB_CTRL_OVER_CUR_DIS (1 << 7)
-#define MX6_USB_CTRL_OVER_CUR_ACT_HIGH (1 << 8)
+#define MX6_USB_CTRL_OVER_CUR_ACT_LOW (1 << 8)
#define MX6_USB_CTRL_PWR_POLARITY (1 << 9)
static void mx6_hsic_pullup(unsigned long reg, int on)
@@ -453,9 +453,9 @@ static int usbmisc_imx7d_init(void __iomem *base, int port,
} else {
reg &= ~MX6_USB_CTRL_OVER_CUR_DIS;
if (flags & MXC_EHCI_OC_PIN_ACTIVE_LOW)
- reg &= ~MX6_USB_CTRL_OVER_CUR_ACT_HIGH;
+ reg |= MX6_USB_CTRL_OVER_CUR_ACT_LOW;
else
- reg |= MX6_USB_CTRL_OVER_CUR_ACT_HIGH;
+ reg &= ~MX6_USB_CTRL_OVER_CUR_ACT_LOW;
}
if (flags & MXC_EHCI_PWR_PIN_ACTIVE_HIGH)
reg |= MX6_USB_CTRL_PWR_POLARITY;
--
2.30.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] usb: imx: add overcurrent polarity handling on i.MX6
2021-02-02 18:54 [PATCH 1/2] usb: imx: fix overcurrent polarity handling on i.MX7 Michael Grzeschik
@ 2021-02-02 18:54 ` Michael Grzeschik
2021-02-04 10:28 ` [PATCH 1/2] usb: imx: fix overcurrent polarity handling on i.MX7 Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Michael Grzeschik @ 2021-02-02 18:54 UTC (permalink / raw)
To: barebox
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
drivers/usb/imx/imx-usb-misc.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/imx/imx-usb-misc.c b/drivers/usb/imx/imx-usb-misc.c
index 660ebecd78..c16b4cf0ab 100644
--- a/drivers/usb/imx/imx-usb-misc.c
+++ b/drivers/usb/imx/imx-usb-misc.c
@@ -379,8 +379,15 @@ static __maybe_unused int mx6_initialize_usb_hw(void __iomem *base, int port,
case 0:
case 1:
val = readl(base + MX6_USB_CTRL(port));
- if (flags & MXC_EHCI_DISABLE_OVERCURRENT)
+ if (flags & MXC_EHCI_DISABLE_OVERCURRENT) {
val |= MX6_USB_CTRL_OVER_CUR_DIS;
+ } else {
+ val &= ~MX6_USB_CTRL_OVER_CUR_DIS;
+ if (flags & MXC_EHCI_OC_PIN_ACTIVE_LOW)
+ val |= MX6_USB_CTRL_OVER_CUR_ACT_LOW;
+ else
+ val &= ~MX6_USB_CTRL_OVER_CUR_ACT_LOW;
+ }
if (flags & MXC_EHCI_PWR_PIN_ACTIVE_HIGH)
val |= MX6_USB_CTRL_PWR_POLARITY;
writel(val, base + MX6_USB_CTRL(port));
--
2.30.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] usb: imx: fix overcurrent polarity handling on i.MX7
2021-02-02 18:54 [PATCH 1/2] usb: imx: fix overcurrent polarity handling on i.MX7 Michael Grzeschik
2021-02-02 18:54 ` [PATCH 2/2] usb: imx: add overcurrent polarity handling on i.MX6 Michael Grzeschik
@ 2021-02-04 10:28 ` Sascha Hauer
1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2021-02-04 10:28 UTC (permalink / raw)
To: Michael Grzeschik; +Cc: barebox
On Tue, Feb 02, 2021 at 07:54:12PM +0100, Michael Grzeschik wrote:
> The reference manual says the overcurrent polarity is changed to low
> with the bit set. We fix that according to the description.
>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
> drivers/usb/imx/imx-usb-misc.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/drivers/usb/imx/imx-usb-misc.c b/drivers/usb/imx/imx-usb-misc.c
> index b663d073aa..660ebecd78 100644
> --- a/drivers/usb/imx/imx-usb-misc.c
> +++ b/drivers/usb/imx/imx-usb-misc.c
> @@ -353,7 +353,7 @@ static __maybe_unused struct imx_usb_misc_data mx5_data = {
>
> #define MX6_USB_CTRL(n) ((n) * 4)
> #define MX6_USB_CTRL_OVER_CUR_DIS (1 << 7)
> -#define MX6_USB_CTRL_OVER_CUR_ACT_HIGH (1 << 8)
> +#define MX6_USB_CTRL_OVER_CUR_ACT_LOW (1 << 8)
> #define MX6_USB_CTRL_PWR_POLARITY (1 << 9)
>
> static void mx6_hsic_pullup(unsigned long reg, int on)
> @@ -453,9 +453,9 @@ static int usbmisc_imx7d_init(void __iomem *base, int port,
> } else {
> reg &= ~MX6_USB_CTRL_OVER_CUR_DIS;
> if (flags & MXC_EHCI_OC_PIN_ACTIVE_LOW)
> - reg &= ~MX6_USB_CTRL_OVER_CUR_ACT_HIGH;
> + reg |= MX6_USB_CTRL_OVER_CUR_ACT_LOW;
> else
> - reg |= MX6_USB_CTRL_OVER_CUR_ACT_HIGH;
> + reg &= ~MX6_USB_CTRL_OVER_CUR_ACT_LOW;
> }
> if (flags & MXC_EHCI_PWR_PIN_ACTIVE_HIGH)
> reg |= MX6_USB_CTRL_PWR_POLARITY;
> --
> 2.30.0
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-04 10:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 18:54 [PATCH 1/2] usb: imx: fix overcurrent polarity handling on i.MX7 Michael Grzeschik
2021-02-02 18:54 ` [PATCH 2/2] usb: imx: add overcurrent polarity handling on i.MX6 Michael Grzeschik
2021-02-04 10:28 ` [PATCH 1/2] usb: imx: fix overcurrent polarity handling on i.MX7 Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox