diff options
Diffstat (limited to 'recipes/linux/linux-omap-psp-2.6.32/0042-musb-allow-host-io-without-gadget-module.patch')
-rw-r--r-- | recipes/linux/linux-omap-psp-2.6.32/0042-musb-allow-host-io-without-gadget-module.patch | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/recipes/linux/linux-omap-psp-2.6.32/0042-musb-allow-host-io-without-gadget-module.patch b/recipes/linux/linux-omap-psp-2.6.32/0042-musb-allow-host-io-without-gadget-module.patch new file mode 100644 index 0000000000..a8540c4ce5 --- /dev/null +++ b/recipes/linux/linux-omap-psp-2.6.32/0042-musb-allow-host-io-without-gadget-module.patch @@ -0,0 +1,90 @@ +From f769159cae4d1ae42589d180ac8a376ac3ad687f Mon Sep 17 00:00:00 2001 +From: Ajay Kumar Gupta <ajay.gupta@ti.com> +Date: Wed, 14 Apr 2010 16:08:37 +0530 +Subject: [PATCH 42/43] musb: allow host io without gadget module + +Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> +--- + drivers/usb/musb/musb_core.c | 14 +++++++++----- + drivers/usb/musb/musb_gadget.c | 26 -------------------------- + 2 files changed, 9 insertions(+), 31 deletions(-) + +diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c +index 98874c5..a448fa6 100644 +--- a/drivers/usb/musb/musb_core.c ++++ b/drivers/usb/musb/musb_core.c +@@ -2101,10 +2101,12 @@ bad_config: + * (We expect the ID pin to be forcibly grounded!!) + * Otherwise, wait till the gadget driver hooks up. + */ +- if (!is_otg_enabled(musb) && is_host_enabled(musb)) { +- MUSB_HST_MODE(musb); +- musb->xceiv->default_a = 1; +- musb->xceiv->state = OTG_STATE_A_IDLE; ++ if (is_host_enabled(musb)) { ++ if (!is_otg_enabled(musb)) { ++ MUSB_HST_MODE(musb); ++ musb->xceiv->default_a = 1; ++ musb->xceiv->state = OTG_STATE_A_IDLE; ++ } + + status = usb_add_hcd(musb_to_hcd(musb), -1, 0); + +@@ -2115,7 +2117,9 @@ bad_config: + & MUSB_DEVCTL_BDEVICE + ? 'B' : 'A')); + +- } else /* peripheral is enabled */ { ++ } ++ /* peripheral is enabled */ ++ if (is_peripheral_enabled(musb)) { + MUSB_DEV_MODE(musb); + musb->xceiv->default_a = 0; + musb->xceiv->state = OTG_STATE_B_IDLE; +diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c +index c0e2efc..e0a6015 100644 +--- a/drivers/usb/musb/musb_gadget.c ++++ b/drivers/usb/musb/musb_gadget.c +@@ -1765,24 +1765,6 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) + otg_set_peripheral(musb->xceiv, &musb->g); + + spin_unlock_irqrestore(&musb->lock, flags); +- +- if (is_otg_enabled(musb)) { +- DBG(3, "OTG startup...\n"); +- +- /* REVISIT: funcall to other code, which also +- * handles power budgeting ... this way also +- * ensures HdrcStart is indirectly called. +- */ +- retval = usb_add_hcd(musb_to_hcd(musb), -1, 0); +- if (retval < 0) { +- DBG(1, "add_hcd failed, %d\n", retval); +- spin_lock_irqsave(&musb->lock, flags); +- otg_set_peripheral(musb->xceiv, NULL); +- musb->gadget_driver = NULL; +- musb->g.dev.driver = NULL; +- spin_unlock_irqrestore(&musb->lock, flags); +- } +- } + } + + return retval; +@@ -1878,14 +1860,6 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) + retval = -EINVAL; + spin_unlock_irqrestore(&musb->lock, flags); + +- if (is_otg_enabled(musb) && retval == 0) { +- usb_remove_hcd(musb_to_hcd(musb)); +- /* FIXME we need to be able to register another +- * gadget driver here and have everything work; +- * that currently misbehaves. +- */ +- } +- + return retval; + } + EXPORT_SYMBOL(usb_gadget_unregister_driver); +-- +1.6.6.1 + |