From: Kishon Vijay Abraham I <kishon@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/3] usb: gadget: ether: Perform board initialization from ethernet gadget driver
Date: Wed, 19 Aug 2015 13:49:46 +0530 [thread overview]
Message-ID: <1439972388-15547-2-git-send-email-kishon@ti.com> (raw)
In-Reply-To: <1439972388-15547-1-git-send-email-kishon@ti.com>
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.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
---
drivers/usb/gadget/ether.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 141ff8b..850ba02 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -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(ð_driver);
+ board_usb_cleanup(0, USB_INIT_DEVICE);
}
static struct usb_gadget_driver eth_driver = {
--
1.7.9.5
next prev parent reply other threads:[~2015-08-19 8:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-19 8:19 [U-Boot] [PATCH v2 0/3] usb: host/gadget: Miscellaneous fixes Kishon Vijay Abraham I
2015-08-19 8:19 ` Kishon Vijay Abraham I [this message]
2015-08-19 8:19 ` [U-Boot] [PATCH v2 2/3] usb: host: xhci-omap: invoke board_usb_cleanup in xhci_hcd_stop Kishon Vijay Abraham I
2015-08-19 8:19 ` [U-Boot] [PATCH v2 3/3] usb: gadget: ether: populate _reset_ callback Kishon Vijay Abraham I
2015-08-19 20:30 ` [U-Boot] [PATCH v2 0/3] usb: host/gadget: Miscellaneous fixes Marek Vasut
2015-08-20 5:52 ` Kishon Vijay Abraham I
2015-08-20 5:53 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1439972388-15547-2-git-send-email-kishon@ti.com \
--to=kishon@ti.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox