omap24xx: Fix MUSB compile
[openwrt/staging/jogo.git] / target / linux / omap24xx / patches-3.1 / 850-musb-tusb-modular-fixes.patch
1 Index: linux-3.1-rc4/drivers/Makefile
2 ===================================================================
3 --- linux-3.1-rc4.orig/drivers/Makefile 2011-10-30 00:12:03.959808922 +0200
4 +++ linux-3.1-rc4/drivers/Makefile 2011-10-30 00:12:06.543770526 +0200
5 @@ -71,6 +71,7 @@ obj-$(CONFIG_USB_OTG_UTILS) += usb/
6 obj-$(CONFIG_USB) += usb/
7 obj-$(CONFIG_PCI) += usb/
8 obj-$(CONFIG_USB_GADGET) += usb/
9 +obj-y += usb/
10 obj-$(CONFIG_SERIO) += input/serio/
11 obj-$(CONFIG_GAMEPORT) += input/gameport/
12 obj-$(CONFIG_INPUT) += input/
13 Index: linux-3.1-rc4/drivers/usb/musb/tusb6010.c
14 ===================================================================
15 --- linux-3.1-rc4.orig/drivers/usb/musb/tusb6010.c 2011-10-30 00:12:03.951809040 +0200
16 +++ linux-3.1-rc4/drivers/usb/musb/tusb6010.c 2011-10-30 00:12:06.543770526 +0200
17 @@ -56,6 +56,7 @@ u8 tusb_get_revision(struct musb *musb)
18
19 return rev;
20 }
21 +EXPORT_SYMBOL(tusb_get_revision);
22
23 static int tusb_print_revision(struct musb *musb)
24 {
25 @@ -220,6 +221,7 @@ void musb_write_fifo(struct musb_hw_ep *
26 if (len > 0)
27 tusb_fifo_write_unaligned(fifo, buf, len);
28 }
29 +EXPORT_SYMBOL(musb_write_fifo);
30
31 void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *buf)
32 {
33 @@ -267,6 +269,7 @@ void musb_read_fifo(struct musb_hw_ep *h
34 if (len > 0)
35 tusb_fifo_read_unaligned(fifo, buf, len);
36 }
37 +EXPORT_SYMBOL(musb_read_fifo);
38
39 static struct musb *the_musb;
40
41 @@ -1244,18 +1247,18 @@ static struct platform_driver tusb_drive
42 },
43 };
44
45 -MODULE_DESCRIPTION("TUSB6010 MUSB Glue Layer");
46 -MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
47 -MODULE_LICENSE("GPL v2");
48 +//MODULE_DESCRIPTION("TUSB6010 MUSB Glue Layer");
49 +//MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
50 +//MODULE_LICENSE("GPL v2");
51
52 -static int __init tusb_init(void)
53 +int musb_hdrc_glue_init(void)
54 {
55 return platform_driver_probe(&tusb_driver, tusb_probe);
56 }
57 -subsys_initcall(tusb_init);
58 +EXPORT_SYMBOL(musb_hdrc_glue_init);
59
60 -static void __exit tusb_exit(void)
61 +void musb_hdrc_glue_exit(void)
62 {
63 platform_driver_unregister(&tusb_driver);
64 }
65 -module_exit(tusb_exit);
66 +EXPORT_SYMBOL(musb_hdrc_glue_exit);
67 Index: linux-3.1-rc4/drivers/usb/musb/musb_core.c
68 ===================================================================
69 --- linux-3.1-rc4.orig/drivers/usb/musb/musb_core.c 2011-10-30 00:12:03.943809160 +0200
70 +++ linux-3.1-rc4/drivers/usb/musb/musb_core.c 2011-10-30 00:20:44.156218000 +0200
71 @@ -207,7 +207,7 @@ static struct otg_io_access_ops musb_ulp
72
73 /*-------------------------------------------------------------------------*/
74
75 -#if !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_BLACKFIN)
76 +#if !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_TUSB6010_MODULE) && !defined(CONFIG_USB_MUSB_BLACKFIN)
77
78 /*
79 * Load an endpoint's FIFO
80 @@ -250,7 +250,7 @@ void musb_write_fifo(struct musb_hw_ep *
81 }
82 }
83
84 -#if !defined(CONFIG_USB_MUSB_AM35X)
85 +#if !defined(CONFIG_USB_MUSB_AM35X) && !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
86 /*
87 * Unload an endpoint's FIFO
88 */
89 @@ -1432,7 +1432,7 @@ static int __init musb_core_init(u16 mus
90 struct musb_hw_ep *hw_ep = musb->endpoints + i;
91
92 hw_ep->fifo = MUSB_FIFO_OFFSET(i) + mbase;
93 -#ifdef CONFIG_USB_MUSB_TUSB6010
94 +#if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
95 hw_ep->fifo_async = musb->async + 0x400 + MUSB_FIFO_OFFSET(i);
96 hw_ep->fifo_sync = musb->sync + 0x400 + MUSB_FIFO_OFFSET(i);
97 hw_ep->fifo_sync_va =
98 @@ -2376,8 +2376,13 @@ static struct platform_driver musb_drive
99
100 /*-------------------------------------------------------------------------*/
101
102 +extern int musb_hdrc_glue_init(void);
103 +extern void musb_hdrc_glue_exit(void);
104 +
105 static int __init musb_init(void)
106 {
107 + int err;
108 +
109 if (usb_disabled())
110 return 0;
111
112 @@ -2386,7 +2391,17 @@ static int __init musb_init(void)
113 ", "
114 "otg (peripheral+host)",
115 musb_driver_name);
116 - return platform_driver_probe(&musb_driver, musb_probe);
117 +
118 + err = musb_hdrc_glue_init();
119 + if (err)
120 + return err;
121 + err = platform_driver_probe(&musb_driver, musb_probe);
122 + if (err) {
123 + musb_hdrc_glue_exit();
124 + return err;
125 + }
126 +
127 + return 0;
128 }
129
130 /* make us init after usbcore and i2c (transceivers, regulators, etc)
131 @@ -2397,5 +2412,6 @@ fs_initcall(musb_init);
132 static void __exit musb_cleanup(void)
133 {
134 platform_driver_unregister(&musb_driver);
135 + musb_hdrc_glue_exit();
136 }
137 module_exit(musb_cleanup);
138 Index: linux-3.1-rc4/drivers/usb/Makefile
139 ===================================================================
140 --- linux-3.1-rc4.orig/drivers/usb/Makefile 2011-10-30 00:12:03.939809220 +0200
141 +++ linux-3.1-rc4/drivers/usb/Makefile 2011-10-30 00:12:06.543770526 +0200
142 @@ -47,7 +47,7 @@ obj-$(CONFIG_EARLY_PRINTK_DBGP) += early
143 obj-$(CONFIG_USB_ATM) += atm/
144 obj-$(CONFIG_USB_SPEEDTOUCH) += atm/
145
146 -obj-$(CONFIG_USB_MUSB_HDRC) += musb/
147 +obj-y += musb/
148 obj-$(CONFIG_USB_RENESAS_USBHS) += renesas_usbhs/
149 obj-$(CONFIG_USB_OTG_UTILS) += otg/
150 obj-$(CONFIG_USB_GADGET) += gadget/
151 Index: linux-3.1-rc4/drivers/usb/musb/Makefile
152 ===================================================================
153 --- linux-3.1-rc4.orig/drivers/usb/musb/Makefile 2011-10-30 00:11:34.852241963 +0200
154 +++ linux-3.1-rc4/drivers/usb/musb/Makefile 2011-10-30 00:14:52.945312862 +0200
155 @@ -13,7 +13,7 @@ musb_hdrc-$(CONFIG_DEBUG_FS) += musb_d
156 # Hardware Glue Layer
157 obj-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o
158 obj-$(CONFIG_USB_MUSB_AM35X) += am35x.o
159 -obj-$(CONFIG_USB_MUSB_TUSB6010) += tusb6010.o
160 +musb_hdrc-$(subst m,y,$(CONFIG_USB_MUSB_TUSB6010)) += tusb6010.o
161 obj-$(CONFIG_USB_MUSB_DAVINCI) += davinci.o
162 obj-$(CONFIG_USB_MUSB_DA8XX) += da8xx.o
163 obj-$(CONFIG_USB_MUSB_BLACKFIN) += blackfin.o