All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: ux500: Do not redefine ops if CONFIG_USB_MUSB_HOST set
@ 2024-08-18 20:04 Marek Vasut
  2024-08-19 13:15 ` Mattijs Korpershoek
  2024-08-20  6:09 ` Mattijs Korpershoek
  0 siblings, 2 replies; 3+ messages in thread
From: Marek Vasut @ 2024-08-18 20:04 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, Linus Walleij, Mattijs Korpershoek, Stephan Gerhold,
	Tom Rini

In case CONFIG_USB_MUSB_HOST is set, the ux500_gadget_ops get overridden
to musb_usb_ops . Simply set the ops one way or the other depending on
whether CONFIG_USB_MUSB_HOST is set or not.

Fixes: ac4bf5d48a9e ("usb: gadget: ux500: Convert interrupt handling to usb_gadget_generic_ops")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de
---
 drivers/usb/musb-new/ux500.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/musb-new/ux500.c b/drivers/usb/musb-new/ux500.c
index 89dd75b7d05..be0085f403d 100644
--- a/drivers/usb/musb-new/ux500.c
+++ b/drivers/usb/musb-new/ux500.c
@@ -169,16 +169,14 @@ U_BOOT_DRIVER(ux500_musb) = {
 	.name		= "ux500-musb",
 #ifdef CONFIG_USB_MUSB_HOST
 	.id		= UCLASS_USB,
+	.ops		= &musb_usb_ops,
 #else
 	.id		= UCLASS_USB_GADGET_GENERIC,
+	.ops		= &ux500_gadget_ops,
 #endif
 	.of_match	= ux500_musb_ids,
-	.ops		= &ux500_gadget_ops,
 	.probe		= ux500_musb_probe,
 	.remove		= ux500_musb_remove,
-#ifdef CONFIG_USB_MUSB_HOST
-	.ops		= &musb_usb_ops,
-#endif
 	.plat_auto	= sizeof(struct usb_plat),
 	.priv_auto	= sizeof(struct ux500_glue),
 };
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: gadget: ux500: Do not redefine ops if CONFIG_USB_MUSB_HOST set
  2024-08-18 20:04 [PATCH] usb: gadget: ux500: Do not redefine ops if CONFIG_USB_MUSB_HOST set Marek Vasut
@ 2024-08-19 13:15 ` Mattijs Korpershoek
  2024-08-20  6:09 ` Mattijs Korpershoek
  1 sibling, 0 replies; 3+ messages in thread
From: Mattijs Korpershoek @ 2024-08-19 13:15 UTC (permalink / raw)
  To: Marek Vasut, u-boot; +Cc: Marek Vasut, Linus Walleij, Stephan Gerhold, Tom Rini

Hi Marek,

Thank you for the patch.

On dim., août 18, 2024 at 22:04, Marek Vasut <marek.vasut+renesas@mailbox.org> wrote:

> In case CONFIG_USB_MUSB_HOST is set, the ux500_gadget_ops get overridden
> to musb_usb_ops . Simply set the ops one way or the other depending on
> whether CONFIG_USB_MUSB_HOST is set or not.
>
> Fixes: ac4bf5d48a9e ("usb: gadget: ux500: Convert interrupt handling to usb_gadget_generic_ops")
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> Cc: Stephan Gerhold <stephan@gerhold.net>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: u-boot@lists.denx.de
> ---
>  drivers/usb/musb-new/ux500.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/musb-new/ux500.c b/drivers/usb/musb-new/ux500.c
> index 89dd75b7d05..be0085f403d 100644
> --- a/drivers/usb/musb-new/ux500.c
> +++ b/drivers/usb/musb-new/ux500.c
> @@ -169,16 +169,14 @@ U_BOOT_DRIVER(ux500_musb) = {
>  	.name		= "ux500-musb",
>  #ifdef CONFIG_USB_MUSB_HOST
>  	.id		= UCLASS_USB,
> +	.ops		= &musb_usb_ops,
>  #else
>  	.id		= UCLASS_USB_GADGET_GENERIC,
> +	.ops		= &ux500_gadget_ops,
>  #endif
>  	.of_match	= ux500_musb_ids,
> -	.ops		= &ux500_gadget_ops,
>  	.probe		= ux500_musb_probe,
>  	.remove		= ux500_musb_remove,
> -#ifdef CONFIG_USB_MUSB_HOST
> -	.ops		= &musb_usb_ops,
> -#endif
>  	.plat_auto	= sizeof(struct usb_plat),
>  	.priv_auto	= sizeof(struct ux500_glue),
>  };
> -- 
> 2.43.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: gadget: ux500: Do not redefine ops if CONFIG_USB_MUSB_HOST set
  2024-08-18 20:04 [PATCH] usb: gadget: ux500: Do not redefine ops if CONFIG_USB_MUSB_HOST set Marek Vasut
  2024-08-19 13:15 ` Mattijs Korpershoek
@ 2024-08-20  6:09 ` Mattijs Korpershoek
  1 sibling, 0 replies; 3+ messages in thread
From: Mattijs Korpershoek @ 2024-08-20  6:09 UTC (permalink / raw)
  To: u-boot, Marek Vasut; +Cc: Linus Walleij, Stephan Gerhold, Tom Rini

Hi,

On Sun, 18 Aug 2024 22:04:15 +0200, Marek Vasut wrote:
> In case CONFIG_USB_MUSB_HOST is set, the ux500_gadget_ops get overridden
> to musb_usb_ops . Simply set the ops one way or the other depending on
> whether CONFIG_USB_MUSB_HOST is set or not.
> 
> 

Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu)

[1/1] usb: gadget: ux500: Do not redefine ops if CONFIG_USB_MUSB_HOST set
      https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/cc4424db44f62edfcb96fef16102ad769a3909de

--
Mattijs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-20  6:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-18 20:04 [PATCH] usb: gadget: ux500: Do not redefine ops if CONFIG_USB_MUSB_HOST set Marek Vasut
2024-08-19 13:15 ` Mattijs Korpershoek
2024-08-20  6:09 ` Mattijs Korpershoek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.