aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-w90x900.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/ehci-w90x900.c')
-rw-r--r--drivers/usb/host/ehci-w90x900.c89
1 files changed, 37 insertions, 52 deletions
diff --git a/drivers/usb/host/ehci-w90x900.c b/drivers/usb/host/ehci-w90x900.c
index 59e0e24c753f..cdad8438c02b 100644
--- a/drivers/usb/host/ehci-w90x900.c
+++ b/drivers/usb/host/ehci-w90x900.c
@@ -11,13 +11,28 @@
11 * 11 *
12 */ 12 */
13 13
14#include <linux/dma-mapping.h>
15#include <linux/io.h>
16#include <linux/kernel.h>
17#include <linux/module.h>
18#include <linux/of.h>
14#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/usb.h>
21#include <linux/usb/hcd.h>
22
23#include "ehci.h"
15 24
16/* enable phy0 and phy1 for w90p910 */ 25/* enable phy0 and phy1 for w90p910 */
17#define ENPHY (0x01<<8) 26#define ENPHY (0x01<<8)
18#define PHY0_CTR (0xA4) 27#define PHY0_CTR (0xA4)
19#define PHY1_CTR (0xA8) 28#define PHY1_CTR (0xA8)
20 29
30#define DRIVER_DESC "EHCI w90x900 driver"
31
32static const char hcd_name[] = "ehci-w90x900 ";
33
34static struct hc_driver __read_mostly ehci_w90x900_hc_driver;
35
21static int usb_w90x900_probe(const struct hc_driver *driver, 36static int usb_w90x900_probe(const struct hc_driver *driver,
22 struct platform_device *pdev) 37 struct platform_device *pdev)
23{ 38{
@@ -90,8 +105,8 @@ err1:
90 return retval; 105 return retval;
91} 106}
92 107
93static 108static void usb_w90x900_remove(struct usb_hcd *hcd,
94void usb_w90x900_remove(struct usb_hcd *hcd, struct platform_device *pdev) 109 struct platform_device *pdev)
95{ 110{
96 usb_remove_hcd(hcd); 111 usb_remove_hcd(hcd);
97 iounmap(hcd->regs); 112 iounmap(hcd->regs);
@@ -99,54 +114,6 @@ void usb_w90x900_remove(struct usb_hcd *hcd, struct platform_device *pdev)
99 usb_put_hcd(hcd); 114 usb_put_hcd(hcd);
100} 115}
101 116
102static const struct hc_driver ehci_w90x900_hc_driver = {
103 .description = hcd_name,
104 .product_desc = "Nuvoton w90x900 EHCI Host Controller",
105 .hcd_priv_size = sizeof(struct ehci_hcd),
106
107 /*
108 * generic hardware linkage
109 */
110 .irq = ehci_irq,
111 .flags = HCD_USB2|HCD_MEMORY,
112
113 /*
114 * basic lifecycle operations
115 */
116 .reset = ehci_setup,
117 .start = ehci_run,
118
119 .stop = ehci_stop,
120 .shutdown = ehci_shutdown,
121
122 /*
123 * managing i/o requests and associated device resources
124 */
125 .urb_enqueue = ehci_urb_enqueue,
126 .urb_dequeue = ehci_urb_dequeue,
127 .endpoint_disable = ehci_endpoint_disable,
128 .endpoint_reset = ehci_endpoint_reset,
129
130 /*
131 * scheduling support
132 */
133 .get_frame_number = ehci_get_frame,
134
135 /*
136 * root hub support
137 */
138 .hub_status_data = ehci_hub_status_data,
139 .hub_control = ehci_hub_control,
140#ifdef CONFIG_PM
141 .bus_suspend = ehci_bus_suspend,
142 .bus_resume = ehci_bus_resume,
143#endif
144 .relinquish_port = ehci_relinquish_port,
145 .port_handed_over = ehci_port_handed_over,
146
147 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
148};
149
150static int ehci_w90x900_probe(struct platform_device *pdev) 117static int ehci_w90x900_probe(struct platform_device *pdev)
151{ 118{
152 if (usb_disabled()) 119 if (usb_disabled())
@@ -173,7 +140,25 @@ static struct platform_driver ehci_hcd_w90x900_driver = {
173 }, 140 },
174}; 141};
175 142
143static int __init ehci_w90X900_init(void)
144{
145 if (usb_disabled())
146 return -ENODEV;
147
148 pr_info("%s: " DRIVER_DESC "\n", hcd_name);
149
150 ehci_init_driver(&ehci_w90x900_hc_driver, NULL);
151 return platform_driver_register(&ehci_hcd_w90x900_driver);
152}
153module_init(ehci_w90X900_init);
154
155static void __exit ehci_w90X900_cleanup(void)
156{
157 platform_driver_unregister(&ehci_hcd_w90x900_driver);
158}
159module_exit(ehci_w90X900_cleanup);
160
161MODULE_DESCRIPTION(DRIVER_DESC);
176MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>"); 162MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
177MODULE_DESCRIPTION("w90p910 usb ehci driver!");
178MODULE_LICENSE("GPL");
179MODULE_ALIAS("platform:w90p910-ehci"); 163MODULE_ALIAS("platform:w90p910-ehci");
164MODULE_LICENSE("GPL v2");