diff mbox series

[2/6] usb: chipidea: usbmisc_imx: Fix setting i.MX6SX wakeup source

Message ID 20221011082924.884123-3-s.hauer@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series usb: chipidea: Export more phy tuning parameters to device tree | expand

Commit Message

Sascha Hauer Oct. 11, 2022, 8:29 a.m. UTC
MX6SX_USB_VBUS_WAKEUP_SOURCE are two bits containing an enum value,
so when read/modify/write that we have to clear both bits bits before
setting the desired bits. The clearing of the bits was forgotten, add
it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/usb/chipidea/usbmisc_imx.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Xu Yang Oct. 18, 2022, 8:46 a.m. UTC | #1
On Tue, Oct 11, 2022 at 4:41 PM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> MX6SX_USB_VBUS_WAKEUP_SOURCE are two bits containing an enum value,
> so when read/modify/write that we have to clear both bits bits before
> setting the desired bits. The clearing of the bits was forgotten, add
> it.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Reviewed-by: Xu Yang <xu.yang_2@nxp.com>

Thanks,
Xu Yang

> ---
>  drivers/usb/chipidea/usbmisc_imx.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index 8f805aa9c383c..e1b4b7f9b3f31 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -551,6 +551,7 @@ static int usbmisc_imx6sx_init(struct imx_usbmisc_data *data)
>                 spin_lock_irqsave(&usbmisc->lock, flags);
>                 /* Set vbus wakeup source as bvalid */
>                 val = readl(reg);
> +               val &= ~MX6SX_USB_VBUS_WAKEUP_SOURCE(3);
>                 writel(val | MX6SX_USB_VBUS_WAKEUP_SOURCE_BVALID, reg);
>                 /*
>                  * Disable dp/dm wakeup in device mode when vbus is
> --
> 2.30.2
>
diff mbox series

Patch

diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
index 8f805aa9c383c..e1b4b7f9b3f31 100644
--- a/drivers/usb/chipidea/usbmisc_imx.c
+++ b/drivers/usb/chipidea/usbmisc_imx.c
@@ -551,6 +551,7 @@  static int usbmisc_imx6sx_init(struct imx_usbmisc_data *data)
 		spin_lock_irqsave(&usbmisc->lock, flags);
 		/* Set vbus wakeup source as bvalid */
 		val = readl(reg);
+		val &= ~MX6SX_USB_VBUS_WAKEUP_SOURCE(3);
 		writel(val | MX6SX_USB_VBUS_WAKEUP_SOURCE_BVALID, reg);
 		/*
 		 * Disable dp/dm wakeup in device mode when vbus is