public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] dm: usb: gadget: Fix boot breakage on sunxi platforms
@ 2018-12-21  8:50 Jean-Jacques Hiblot
  2018-12-23 22:14 ` Jagan Teki
  0 siblings, 1 reply; 14+ messages in thread
From: Jean-Jacques Hiblot @ 2018-12-21  8:50 UTC (permalink / raw)
  To: u-boot

Fixes commit 013116243950 ("dm: usb: create a new UCLASS ID for USB gadget
devices")

The UCLASS_DRIVER for id UCLASS_USB_GADGET_GENERIC needs to be declared
even for platforms that do not enable DM_USB_GADGET. Otherwise the driver
for their usb peripheral controller fails to bind.

Reported-by: Priit Laes <plaes@plaes.org>
Reported-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Tested-by: Priit Laes <plaes@plaes.org>

---

build status available here: https://travis-ci.org/jjhiblot/u-boot/builds/470396811


 drivers/usb/gadget/udc/Makefile     | 3 ++-
 drivers/usb/gadget/udc/udc-uclass.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/Makefile b/drivers/usb/gadget/udc/Makefile
index 38ac2dd..95dbf0c 100644
--- a/drivers/usb/gadget/udc/Makefile
+++ b/drivers/usb/gadget/udc/Makefile
@@ -6,4 +6,5 @@ ifndef CONFIG_$(SPL_)DM_USB_GADGET
 obj-$(CONFIG_USB_DWC3_GADGET)	+= udc-core.o
 endif
 
-obj-$(CONFIG_$(SPL_)DM_USB_GADGET)	+= udc-uclass.o udc-core.o
+obj-$(CONFIG_$(SPL_)DM_USB_GADGET)	+= udc-core.o
+obj-$(CONFIG_$(SPL_)DM) += udc-uclass.o
diff --git a/drivers/usb/gadget/udc/udc-uclass.c b/drivers/usb/gadget/udc/udc-uclass.c
index e9f8f5f..8d78647 100644
--- a/drivers/usb/gadget/udc/udc-uclass.c
+++ b/drivers/usb/gadget/udc/udc-uclass.c
@@ -9,6 +9,7 @@
 #include <dm/device-internal.h>
 #include <linux/usb/gadget.h>
 
+#if CONFIG_IS_ENABLED(DM_USB_GADGET)
 #define MAX_UDC_DEVICES 4
 static struct udevice *dev_array[MAX_UDC_DEVICES];
 int usb_gadget_initialize(int index)
@@ -51,6 +52,7 @@ int usb_gadget_handle_interrupts(int index)
 		return -EINVAL;
 	return dm_usb_gadget_handle_interrupts(dev_array[index]);
 }
+#endif
 
 UCLASS_DRIVER(usb_gadget_generic) = {
 	.id		= UCLASS_USB_GADGET_GENERIC,
-- 
2.7.4

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

end of thread, other threads:[~2019-01-04  0:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-21  8:50 [U-Boot] [PATCH] dm: usb: gadget: Fix boot breakage on sunxi platforms Jean-Jacques Hiblot
2018-12-23 22:14 ` Jagan Teki
2018-12-29 18:49   ` Jagan Teki
2018-12-30 15:55     ` Marek Vasut
2019-01-02 10:38     ` Jean-Jacques Hiblot
2019-01-02 12:15       ` Lukasz Majewski
2019-01-02 15:20         ` Jean-Jacques Hiblot
2019-01-02 18:25       ` Jagan Teki
2019-01-03  6:59         ` Lukasz Majewski
2019-01-03 13:44           ` Marek Vasut
2019-01-03 19:53           ` Jagan Teki
2019-01-03 19:54             ` Marek Vasut
2019-01-03 21:47             ` Lukasz Majewski
2019-01-04  0:04               ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox