Skip to contentSkip to conversation

usb: host/gadget: Miscellaneous fixes

PATCH Superseded Kishon Vijay Abraham I 2 participants 7 messages Aug 19, 2015 – Aug 20, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover usb: host/gadget: Miscellaneous fixes

Changes from v1:
Added reviewed-by.

This patch series is split from [1] to contain only the usb host/gadget fixes.

[1] -> http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/229188

Kishon Vijay Abraham I (3):
usb: gadget: ether: Perform board initialization from ethernet gadget
driver
usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop
usb: gadget: ether: populate _reset_ callback

 drivers/usb/gadget/ether.c   |    5 +++++
 drivers/usb/host/xhci-omap.c |    1 +
 2 files changed, 6 insertions(+)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/3 usb: gadget: ether: Perform board initialization from ethernet gadget driver

Ethernet gadget driver can be used both by both SPL and u-boot. Since usb_eth_init() is the entry point for ethernet gadget driver, perform board initialization there. Also perform the cleanup in usb_eth_halt.

---
 drivers/usb/gadget/ether.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/gadget/ether.c +4 -0
index 141ff8b..850ba02 100644
@@ -15,6 +15,7 @@
 #include <linux/usb/cdc.h>
 #include <linux/usb/gadget.h>
 #include <net.h>
+#include <usb.h>
 #include <malloc.h>
 #include <linux/ctype.h>
 
@@ -2312,6 +2313,8 @@ static int usb_eth_init(struct eth_device *netdev, bd_t *bd)
 		goto fail;
 	}
 
+	board_usb_init(0, USB_INIT_DEVICE);
+
 	/* Configure default mac-addresses for the USB ethernet device */
 #ifdef CONFIG_USBNET_DEV_ADDR
 	strlcpy(dev_addr, CONFIG_USBNET_DEV_ADDR, sizeof(dev_addr));
@@ -2492,6 +2495,7 @@ void usb_eth_halt(struct eth_device *netdev)
 	}
 
 	usb_gadget_unregister_driver(&eth_driver);
+	board_usb_cleanup(0, USB_INIT_DEVICE);
 }
 
 static struct usb_gadget_driver eth_driver = {
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v2 2/3 usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop

In reply to Kishon Vijay Abraham I

xhci omap driver has board_usb_init in xhci_hcd_init but doesn't have the corresponding cleanup function in xhci_hcd_stop.

Fix it here by invoking board_usb_cleanup() in xhci_hcd_stop().

---
 drivers/usb/host/xhci-omap.c |    1 +
 1 file changed, 1 insertion(+)
drivers/usb/host/xhci-omap.c +1 -0
index 3a55208..104e7a7 100644
@@ -96,4 +96,5 @@ void xhci_hcd_stop(int index)
 	struct omap_xhci *ctx = &omap;
 
 	omap_xhci_core_exit(ctx);
+	board_usb_cleanup(index, USB_INIT_HOST);
 }
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH v2 3/3 usb: gadget: ether: populate _reset_ callback

In reply to Kishon Vijay Abraham I

populate _reset_ callback to the USB ethernet gadget since UDC core expects every gadget driver to have the reset callback. This shouldn't be needed once the ethernet gadget driver is adapted to use the composite driver.

---
 drivers/usb/gadget/ether.c |    1 +
 1 file changed, 1 insertion(+)
drivers/usb/gadget/ether.c +1 -0
index 850ba02..53f4672 100644
@@ -2505,6 +2505,7 @@ static struct usb_gadget_driver eth_driver = {
 	.unbind		= eth_unbind,
 
 	.setup		= eth_setup,
+	.reset		= eth_disconnect,
 	.disconnect	= eth_disconnect,
 
 	.suspend	= eth_suspend,
Signature · 1 line
1.7.9.5
#6 lore raw

v2 cover usb: host/gadget: Miscellaneous fixes

Quoted 5 lines · Kishon Vijay Abraham I
Quoted 4 lines · Marek Vasut
Quoted 3 lines · Kishon Vijay Abraham I

Changes from v1:
Added reviewed-by.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

This patch series is split from [1] to contain only the usb host/gadget fixes.

[1] -> http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/229188

Applied all three to u-boot-usb/master, thanks !

Thanks Marek!

No problem, PR is out too, so it should reach Tom quickly.

Best regards,
Marek Vasut