Root/target/linux/omap24xx/patches-3.3/850-musb-tusb-modular-fixes.patch

1--- a/drivers/usb/musb/tusb6010.c
2+++ b/drivers/usb/musb/tusb6010.c
3@@ -221,6 +221,7 @@ void musb_write_fifo(struct musb_hw_ep *
4     if (len > 0)
5         tusb_fifo_write_unaligned(fifo, buf, len);
6 }
7+EXPORT_SYMBOL(musb_write_fifo);
8 
9 void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *buf)
10 {
11@@ -268,6 +269,7 @@ void musb_read_fifo(struct musb_hw_ep *h
12     if (len > 0)
13         tusb_fifo_read_unaligned(fifo, buf, len);
14 }
15+EXPORT_SYMBOL(musb_read_fifo);
16 
17 static struct musb *the_musb;
18 
19@@ -1165,7 +1167,7 @@ static const struct musb_platform_ops tu
20 
21 static u64 tusb_dmamask = DMA_BIT_MASK(32);
22 
23-static int __init tusb_probe(struct platform_device *pdev)
24+static int tusb_probe(struct platform_device *pdev)
25 {
26     struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
27     struct platform_device *musb;
28@@ -1245,18 +1247,18 @@ static struct platform_driver tusb_drive
29     },
30 };
31 
32-MODULE_DESCRIPTION("TUSB6010 MUSB Glue Layer");
33-MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
34-MODULE_LICENSE("GPL v2");
35+//MODULE_DESCRIPTION("TUSB6010 MUSB Glue Layer");
36+//MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
37+//MODULE_LICENSE("GPL v2");
38 
39-static int __init tusb_init(void)
40+int musb_hdrc_glue_init(void)
41 {
42     return platform_driver_probe(&tusb_driver, tusb_probe);
43 }
44-subsys_initcall(tusb_init);
45+EXPORT_SYMBOL(musb_hdrc_glue_init);
46 
47-static void __exit tusb_exit(void)
48+void musb_hdrc_glue_exit(void)
49 {
50     platform_driver_unregister(&tusb_driver);
51 }
52-module_exit(tusb_exit);
53+EXPORT_SYMBOL(musb_hdrc_glue_exit);
54--- a/drivers/usb/musb/musb_core.c
55+++ b/drivers/usb/musb/musb_core.c
56@@ -207,7 +207,7 @@ static struct otg_io_access_ops musb_ulp
57 
58 /*-------------------------------------------------------------------------*/
59 
60-#if !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_BLACKFIN)
61+#if !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_TUSB6010_MODULE) && !defined(CONFIG_USB_MUSB_BLACKFIN)
62 
63 /*
64  * Load an endpoint's FIFO
65@@ -250,7 +250,7 @@ void musb_write_fifo(struct musb_hw_ep *
66     }
67 }
68 
69-#if !defined(CONFIG_USB_MUSB_AM35X)
70+#if !defined(CONFIG_USB_MUSB_AM35X) && !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
71 /*
72  * Unload an endpoint's FIFO
73  */
74@@ -2370,8 +2370,13 @@ static struct platform_driver musb_drive
75 
76 /*-------------------------------------------------------------------------*/
77 
78+extern int musb_hdrc_glue_init(void);
79+extern void musb_hdrc_glue_exit(void);
80+
81 static int __init musb_init(void)
82 {
83+ int err;
84+
85     if (usb_disabled())
86         return 0;
87 
88@@ -2380,7 +2385,17 @@ static int __init musb_init(void)
89         ", "
90         "otg (peripheral+host)",
91         musb_driver_name);
92- return platform_driver_probe(&musb_driver, musb_probe);
93+
94+ err = musb_hdrc_glue_init();
95+ if (err)
96+ return err;
97+ err = platform_driver_probe(&musb_driver, musb_probe);
98+ if (err) {
99+ musb_hdrc_glue_exit();
100+ return err;
101+ }
102+
103+ return 0;
104 }
105 
106 /* make us init after usbcore and i2c (transceivers, regulators, etc)
107@@ -2391,5 +2406,6 @@ fs_initcall(musb_init);
108 static void __exit musb_cleanup(void)
109 {
110     platform_driver_unregister(&musb_driver);
111+ musb_hdrc_glue_exit();
112 }
113 module_exit(musb_cleanup);
114--- a/drivers/usb/Makefile
115+++ b/drivers/usb/Makefile
116@@ -51,7 +51,7 @@ obj-$(CONFIG_EARLY_PRINTK_DBGP) += early
117 obj-$(CONFIG_USB_ATM) += atm/
118 obj-$(CONFIG_USB_SPEEDTOUCH) += atm/
119 
120-obj-$(CONFIG_USB_MUSB_HDRC) += musb/
121+obj-y += musb/
122 obj-$(CONFIG_USB_RENESAS_USBHS) += renesas_usbhs/
123 obj-$(CONFIG_USB_GADGET) += gadget/
124 
125--- a/drivers/usb/musb/Makefile
126+++ b/drivers/usb/musb/Makefile
127@@ -13,7 +13,7 @@ musb_hdrc-$(CONFIG_DEBUG_FS) += musb_d
128 # Hardware Glue Layer
129 obj-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o
130 obj-$(CONFIG_USB_MUSB_AM35X) += am35x.o
131-obj-$(CONFIG_USB_MUSB_TUSB6010) += tusb6010.o
132+musb_hdrc-$(subst m,y,$(CONFIG_USB_MUSB_TUSB6010)) += tusb6010.o
133 obj-$(CONFIG_USB_MUSB_DAVINCI) += davinci.o
134 obj-$(CONFIG_USB_MUSB_DA8XX) += da8xx.o
135 obj-$(CONFIG_USB_MUSB_BLACKFIN) += blackfin.o
136

Archive Download this file



interactive