d09540d981daa4a5f52ae3a3f23419e1ab04a8fc
[openwrt.git] / target / linux / omap24xx / patches-3.1 / 850-musb-tusb-modular-fixes.patch
1 Index: linux-3.1-rc4/drivers/usb/musb/tusb6010.c
2 ===================================================================
3 --- linux-3.1-rc4.orig/drivers/usb/musb/tusb6010.c      2011-08-29 06:16:01.000000000 +0200
4 +++ linux-3.1-rc4/drivers/usb/musb/tusb6010.c   2011-10-27 17:04:58.637191966 +0200
5 @@ -56,6 +56,7 @@ u8 tusb_get_revision(struct musb *musb)
6  
7         return rev;
8  }
9 +EXPORT_SYMBOL(tusb_get_revision);
10  
11  static int tusb_print_revision(struct musb *musb)
12  {
13 @@ -220,6 +221,7 @@ void musb_write_fifo(struct musb_hw_ep *
14         if (len > 0)
15                 tusb_fifo_write_unaligned(fifo, buf, len);
16  }
17 +EXPORT_SYMBOL(musb_write_fifo);
18  
19  void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *buf)
20  {
21 @@ -267,6 +269,7 @@ void musb_read_fifo(struct musb_hw_ep *h
22         if (len > 0)
23                 tusb_fifo_read_unaligned(fifo, buf, len);
24  }
25 +EXPORT_SYMBOL(musb_read_fifo);
26  
27  static struct musb *the_musb;
28  
29 @@ -1244,18 +1247,16 @@ static struct platform_driver tusb_drive
30         },
31  };
32  
33 -MODULE_DESCRIPTION("TUSB6010 MUSB Glue Layer");
34 -MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
35 -MODULE_LICENSE("GPL v2");
36 +//MODULE_DESCRIPTION("TUSB6010 MUSB Glue Layer");
37 +//MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
38 +//MODULE_LICENSE("GPL v2");
39  
40 -static int __init tusb_init(void)
41 +int musb_hdrc_glue_init(void)
42  {
43         return platform_driver_probe(&tusb_driver, tusb_probe);
44  }
45 -subsys_initcall(tusb_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 Index: linux-3.1-rc4/drivers/usb/musb/Makefile
54 ===================================================================
55 --- linux-3.1-rc4.orig/drivers/usb/musb/Makefile        2011-08-29 06:16:01.000000000 +0200
56 +++ linux-3.1-rc4/drivers/usb/musb/Makefile     2011-10-27 17:04:58.637191966 +0200
57 @@ -11,13 +11,13 @@ musb_hdrc-y                                 += musb_virthub.o musb_h
58  musb_hdrc-$(CONFIG_DEBUG_FS)                   += musb_debugfs.o
59  
60  # Hardware Glue Layer
61 -obj-$(CONFIG_USB_MUSB_OMAP2PLUS)               += omap2430.o
62 -obj-$(CONFIG_USB_MUSB_AM35X)                   += am35x.o
63 -obj-$(CONFIG_USB_MUSB_TUSB6010)                        += tusb6010.o
64 -obj-$(CONFIG_USB_MUSB_DAVINCI)                 += davinci.o
65 -obj-$(CONFIG_USB_MUSB_DA8XX)                   += da8xx.o
66 -obj-$(CONFIG_USB_MUSB_BLACKFIN)                        += blackfin.o
67 -obj-$(CONFIG_USB_MUSB_UX500)                   += ux500.o
68 +musb_hdrc-$(CONFIG_USB_MUSB_OMAP2PLUS)         += omap2430.o
69 +musb_hdrc-$(CONFIG_USB_MUSB_AM35X)             += am35x.o
70 +musb_hdrc-$(CONFIG_USB_MUSB_TUSB6010)          += tusb6010.o
71 +musb_hdrc-$(CONFIG_USB_MUSB_DAVINCI)           += davinci.o
72 +musb_hdrc-$(CONFIG_USB_MUSB_DA8XX)             += da8xx.o
73 +musb_hdrc-$(CONFIG_USB_MUSB_BLACKFIN)          += blackfin.o
74 +musb_hdrc-$(CONFIG_USB_MUSB_UX500)             += ux500.o
75  
76  # the kconfig must guarantee that only one of the
77  # possible I/O schemes will be enabled at a time ...
78 Index: linux-3.1-rc4/drivers/usb/musb/musb_core.c
79 ===================================================================
80 --- linux-3.1-rc4.orig/drivers/usb/musb/musb_core.c     2011-08-29 06:16:01.000000000 +0200
81 +++ linux-3.1-rc4/drivers/usb/musb/musb_core.c  2011-10-27 17:09:45.216071368 +0200
82 @@ -2376,8 +2376,13 @@ static struct platform_driver musb_drive
83  
84  /*-------------------------------------------------------------------------*/
85  
86 +extern int musb_hdrc_glue_init(void);
87 +extern void musb_hdrc_glue_exit(void);
88 +
89  static int __init musb_init(void)
90  {
91 +       int err;
92 +
93         if (usb_disabled())
94                 return 0;
95  
96 @@ -2386,7 +2391,17 @@ static int __init musb_init(void)
97                 ", "
98                 "otg (peripheral+host)",
99                 musb_driver_name);
100 -       return platform_driver_probe(&musb_driver, musb_probe);
101 +
102 +       err = musb_hdrc_glue_init();
103 +       if (err)
104 +               return err;
105 +       err = platform_driver_probe(&musb_driver, musb_probe);
106 +       if (err) {
107 +               musb_hdrc_glue_exit();
108 +               return err;
109 +       }
110 +
111 +       return 0;
112  }
113  
114  /* make us init after usbcore and i2c (transceivers, regulators, etc)
115 @@ -2397,5 +2412,6 @@ fs_initcall(musb_init);
116  static void __exit musb_cleanup(void)
117  {
118         platform_driver_unregister(&musb_driver);
119 +       musb_hdrc_glue_exit();
120  }
121  module_exit(musb_cleanup);
122 Index: linux-3.1-rc4/drivers/usb/Makefile
123 ===================================================================
124 --- linux-3.1-rc4.orig/drivers/usb/Makefile     2011-08-29 06:16:01.000000000 +0200
125 +++ linux-3.1-rc4/drivers/usb/Makefile  2011-10-27 17:07:22.608628530 +0200
126 @@ -47,7 +47,7 @@ obj-$(CONFIG_EARLY_PRINTK_DBGP)       += early
127  obj-$(CONFIG_USB_ATM)          += atm/
128  obj-$(CONFIG_USB_SPEEDTOUCH)   += atm/
129  
130 -obj-$(CONFIG_USB_MUSB_HDRC)    += musb/
131 +obj-y                          += musb/
132  obj-$(CONFIG_USB_RENESAS_USBHS)        += renesas_usbhs/
133  obj-$(CONFIG_USB_OTG_UTILS)    += otg/
134  obj-$(CONFIG_USB_GADGET)       += gadget/