summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/0042-musb-allow-host-io-without-gadget-module.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-psp-2.6.32/0042-musb-allow-host-io-without-gadget-module.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap-psp-2.6.32/0042-musb-allow-host-io-without-gadget-module.patch90
1 files changed, 90 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/0042-musb-allow-host-io-without-gadget-module.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/0042-musb-allow-host-io-without-gadget-module.patch
new file mode 100644
index 00000000..65c12c8e
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/0042-musb-allow-host-io-without-gadget-module.patch
@@ -0,0 +1,90 @@
1From 97283f52ea7fbb9b611a65d031c997e4ae44d465 Mon Sep 17 00:00:00 2001
2From: Ajay Kumar Gupta <ajay.gupta@ti.com>
3Date: Wed, 14 Apr 2010 16:08:37 +0530
4Subject: [PATCH 42/45] musb: allow host io without gadget module
5
6Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
7---
8 drivers/usb/musb/musb_core.c | 14 +++++++++-----
9 drivers/usb/musb/musb_gadget.c | 26 --------------------------
10 2 files changed, 9 insertions(+), 31 deletions(-)
11
12diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
13index 71ec7e8..9988553 100644
14--- a/drivers/usb/musb/musb_core.c
15+++ b/drivers/usb/musb/musb_core.c
16@@ -2101,10 +2101,12 @@ bad_config:
17 * (We expect the ID pin to be forcibly grounded!!)
18 * Otherwise, wait till the gadget driver hooks up.
19 */
20- if (!is_otg_enabled(musb) && is_host_enabled(musb)) {
21- MUSB_HST_MODE(musb);
22- musb->xceiv->default_a = 1;
23- musb->xceiv->state = OTG_STATE_A_IDLE;
24+ if (is_host_enabled(musb)) {
25+ if (!is_otg_enabled(musb)) {
26+ MUSB_HST_MODE(musb);
27+ musb->xceiv->default_a = 1;
28+ musb->xceiv->state = OTG_STATE_A_IDLE;
29+ }
30
31 status = usb_add_hcd(musb_to_hcd(musb), -1, 0);
32
33@@ -2115,7 +2117,9 @@ bad_config:
34 & MUSB_DEVCTL_BDEVICE
35 ? 'B' : 'A'));
36
37- } else /* peripheral is enabled */ {
38+ }
39+ /* peripheral is enabled */
40+ if (is_peripheral_enabled(musb)) {
41 MUSB_DEV_MODE(musb);
42 musb->xceiv->default_a = 0;
43 musb->xceiv->state = OTG_STATE_B_IDLE;
44diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
45index 454f6db..d0d1cee 100644
46--- a/drivers/usb/musb/musb_gadget.c
47+++ b/drivers/usb/musb/musb_gadget.c
48@@ -1768,24 +1768,6 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
49 otg_set_peripheral(musb->xceiv, &musb->g);
50
51 spin_unlock_irqrestore(&musb->lock, flags);
52-
53- if (is_otg_enabled(musb)) {
54- DBG(3, "OTG startup...\n");
55-
56- /* REVISIT: funcall to other code, which also
57- * handles power budgeting ... this way also
58- * ensures HdrcStart is indirectly called.
59- */
60- retval = usb_add_hcd(musb_to_hcd(musb), -1, 0);
61- if (retval < 0) {
62- DBG(1, "add_hcd failed, %d\n", retval);
63- spin_lock_irqsave(&musb->lock, flags);
64- otg_set_peripheral(musb->xceiv, NULL);
65- musb->gadget_driver = NULL;
66- musb->g.dev.driver = NULL;
67- spin_unlock_irqrestore(&musb->lock, flags);
68- }
69- }
70 }
71
72 return retval;
73@@ -1881,14 +1863,6 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
74 retval = -EINVAL;
75 spin_unlock_irqrestore(&musb->lock, flags);
76
77- if (is_otg_enabled(musb) && retval == 0) {
78- usb_remove_hcd(musb_to_hcd(musb));
79- /* FIXME we need to be able to register another
80- * gadget driver here and have everything work;
81- * that currently misbehaves.
82- */
83- }
84-
85 return retval;
86 }
87 EXPORT_SYMBOL(usb_gadget_unregister_driver);
88--
891.6.6.1
90