Patchwork [U-Boot] musb: set MUSB speed based on CONFIG

login
register
mail settings
Submitter Bin Liu
Date March 21, 2013, 3:27 p.m.
Message ID <1363879669-30747-2-git-send-email-b-liu@ti.com>
Download mbox | patch
Permalink /patch/229731/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Bin Liu - March 21, 2013, 3:27 p.m.
Do not config MUSB to highspeed mode if CONFIG_USB_GADGET_DUALSPEED
is not set, in which case Ether gadget only operates in fullspeed.

Reviewed-by: Tom Rini <trini@ti.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
---
 drivers/usb/musb-new/musb_core.c  |    2 ++
 drivers/usb/musb-new/musb_uboot.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
Tom Rini - April 8, 2013, 4:56 p.m.
On Thu, Mar 21, 2013 at 05:27:49AM -0000, Bin Liu wrote:

> Do not config MUSB to highspeed mode if CONFIG_USB_GADGET_DUALSPEED
> is not set, in which case Ether gadget only operates in fullspeed.
> 
> Reviewed-by: Tom Rini <trini@ti.com>
> Signed-off-by: Bin Liu <b-liu@ti.com>

Applied to u-boot-ti/master, thanks!

Patch

diff --git a/drivers/usb/musb-new/musb_core.c b/drivers/usb/musb-new/musb_core.c
index aa647e6..da93571 100644
--- a/drivers/usb/musb-new/musb_core.c
+++ b/drivers/usb/musb-new/musb_core.c
@@ -943,7 +943,9 @@  void musb_start(struct musb *musb)
 
 	/* put into basic highspeed mode and start session */
 	musb_writeb(regs, MUSB_POWER, MUSB_POWER_ISOUPDATE
+#ifdef CONFIG_USB_GADGET_DUALSPEED
 						| MUSB_POWER_HSENAB
+#endif
 						/* ENSUSPEND wedges tusb */
 						/* | MUSB_POWER_ENSUSPEND */
 						);
diff --git a/drivers/usb/musb-new/musb_uboot.c b/drivers/usb/musb-new/musb_uboot.c
index 096c4f4..ee3e6c5 100644
--- a/drivers/usb/musb-new/musb_uboot.c
+++ b/drivers/usb/musb-new/musb_uboot.c
@@ -174,7 +174,7 @@  int usb_gadget_register_driver(struct usb_gadget_driver *driver)
 {
 	int ret;
 
-	if (!driver || driver->speed < USB_SPEED_HIGH || !driver->bind ||
+	if (!driver || driver->speed < USB_SPEED_FULL || !driver->bind ||
 	    !driver->setup) {
 		printf("bad parameter.\n");
 		return -EINVAL;