Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 1 | /* |
| 2 | * OHCI HCD (Host Controller Driver) for USB. |
| 3 | * |
| 4 | * Copyright (C) 2004 SAN People (Pty) Ltd. |
| 5 | * Copyright (C) 2005 Thibaut VARENE <varenet@parisc-linux.org> |
| 6 | * |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 7 | * AT91 Bus Glue |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 8 | * |
| 9 | * Based on fragments of 2.4 driver by Rick Bronson. |
| 10 | * Based on ohci-omap.c |
| 11 | * |
| 12 | * This file is licenced under the GPL. |
| 13 | */ |
| 14 | |
| 15 | #include <linux/clk.h> |
| 16 | #include <linux/platform_device.h> |
| 17 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 18 | #include <mach/hardware.h> |
David Brownell | 4bde4a4 | 2007-12-27 11:19:49 -0800 | [diff] [blame] | 19 | #include <asm/gpio.h> |
| 20 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 21 | #include <mach/board.h> |
| 22 | #include <mach/cpu.h> |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 23 | |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 24 | #ifndef CONFIG_ARCH_AT91 |
| 25 | #error "CONFIG_ARCH_AT91 must be defined." |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 26 | #endif |
| 27 | |
Andrew Victor | ed077bb | 2007-02-16 10:18:58 -0800 | [diff] [blame] | 28 | /* interface and function clocks; sometimes also an AHB clock */ |
| 29 | static struct clk *iclk, *fclk, *hclk; |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 30 | static int clocked; |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 31 | |
| 32 | extern int usb_disabled(void); |
| 33 | |
| 34 | /*-------------------------------------------------------------------------*/ |
| 35 | |
Andrew Victor | ed077bb | 2007-02-16 10:18:58 -0800 | [diff] [blame] | 36 | static void at91_start_clock(void) |
| 37 | { |
Jean-Christophe PLAGNIOL-VILLARD | 0af4316 | 2011-08-30 03:29:28 +0200 | [diff] [blame^] | 38 | clk_enable(hclk); |
Andrew Victor | ed077bb | 2007-02-16 10:18:58 -0800 | [diff] [blame] | 39 | clk_enable(iclk); |
| 40 | clk_enable(fclk); |
| 41 | clocked = 1; |
| 42 | } |
| 43 | |
| 44 | static void at91_stop_clock(void) |
| 45 | { |
| 46 | clk_disable(fclk); |
| 47 | clk_disable(iclk); |
Jean-Christophe PLAGNIOL-VILLARD | 0af4316 | 2011-08-30 03:29:28 +0200 | [diff] [blame^] | 48 | clk_disable(hclk); |
Andrew Victor | ed077bb | 2007-02-16 10:18:58 -0800 | [diff] [blame] | 49 | clocked = 0; |
| 50 | } |
| 51 | |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 52 | static void at91_start_hc(struct platform_device *pdev) |
| 53 | { |
| 54 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 55 | struct ohci_regs __iomem *regs = hcd->regs; |
| 56 | |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 57 | dev_dbg(&pdev->dev, "start\n"); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 58 | |
| 59 | /* |
| 60 | * Start the USB clocks. |
| 61 | */ |
Andrew Victor | ed077bb | 2007-02-16 10:18:58 -0800 | [diff] [blame] | 62 | at91_start_clock(); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 63 | |
| 64 | /* |
| 65 | * The USB host controller must remain in reset. |
| 66 | */ |
| 67 | writel(0, ®s->control); |
| 68 | } |
| 69 | |
| 70 | static void at91_stop_hc(struct platform_device *pdev) |
| 71 | { |
| 72 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 73 | struct ohci_regs __iomem *regs = hcd->regs; |
| 74 | |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 75 | dev_dbg(&pdev->dev, "stop\n"); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 76 | |
| 77 | /* |
| 78 | * Put the USB host controller into reset. |
| 79 | */ |
| 80 | writel(0, ®s->control); |
| 81 | |
| 82 | /* |
| 83 | * Stop the USB clocks. |
| 84 | */ |
Andrew Victor | ed077bb | 2007-02-16 10:18:58 -0800 | [diff] [blame] | 85 | at91_stop_clock(); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | |
| 89 | /*-------------------------------------------------------------------------*/ |
| 90 | |
Pete Zaitcev | 421b4bf | 2008-06-01 14:38:43 -0700 | [diff] [blame] | 91 | static void usb_hcd_at91_remove (struct usb_hcd *, struct platform_device *); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 92 | |
| 93 | /* configure so an HC device and id are always provided */ |
| 94 | /* always called with process context; sleeping is OK */ |
| 95 | |
| 96 | |
| 97 | /** |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 98 | * usb_hcd_at91_probe - initialize AT91-based HCDs |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 99 | * Context: !in_interrupt() |
| 100 | * |
| 101 | * Allocates basic resources for this USB host controller, and |
| 102 | * then invokes the start() method for the HCD associated with it |
| 103 | * through the hotplug entry's driver_data. |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 104 | */ |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 105 | static int usb_hcd_at91_probe(const struct hc_driver *driver, |
| 106 | struct platform_device *pdev) |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 107 | { |
| 108 | int retval; |
| 109 | struct usb_hcd *hcd = NULL; |
| 110 | |
| 111 | if (pdev->num_resources != 2) { |
| 112 | pr_debug("hcd probe: invalid num_resources"); |
| 113 | return -ENODEV; |
| 114 | } |
| 115 | |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 116 | if ((pdev->resource[0].flags != IORESOURCE_MEM) |
| 117 | || (pdev->resource[1].flags != IORESOURCE_IRQ)) { |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 118 | pr_debug("hcd probe: invalid resource type\n"); |
| 119 | return -ENODEV; |
| 120 | } |
| 121 | |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 122 | hcd = usb_create_hcd(driver, &pdev->dev, "at91"); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 123 | if (!hcd) |
| 124 | return -ENOMEM; |
| 125 | hcd->rsrc_start = pdev->resource[0].start; |
| 126 | hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1; |
| 127 | |
| 128 | if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) { |
| 129 | pr_debug("request_mem_region failed\n"); |
| 130 | retval = -EBUSY; |
| 131 | goto err1; |
| 132 | } |
| 133 | |
| 134 | hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); |
| 135 | if (!hcd->regs) { |
| 136 | pr_debug("ioremap failed\n"); |
| 137 | retval = -EIO; |
| 138 | goto err2; |
| 139 | } |
| 140 | |
| 141 | iclk = clk_get(&pdev->dev, "ohci_clk"); |
| 142 | fclk = clk_get(&pdev->dev, "uhpck"); |
Jean-Christophe PLAGNIOL-VILLARD | 0af4316 | 2011-08-30 03:29:28 +0200 | [diff] [blame^] | 143 | hclk = clk_get(&pdev->dev, "hclk"); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 144 | |
| 145 | at91_start_hc(pdev); |
| 146 | ohci_hcd_init(hcd_to_ohci(hcd)); |
| 147 | |
Nicolas Ferre | 2f2cac3 | 2009-07-27 14:59:24 -0700 | [diff] [blame] | 148 | retval = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 149 | if (retval == 0) |
| 150 | return retval; |
| 151 | |
| 152 | /* Error handling */ |
| 153 | at91_stop_hc(pdev); |
| 154 | |
Jean-Christophe PLAGNIOL-VILLARD | 0af4316 | 2011-08-30 03:29:28 +0200 | [diff] [blame^] | 155 | clk_put(hclk); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 156 | clk_put(fclk); |
| 157 | clk_put(iclk); |
| 158 | |
| 159 | iounmap(hcd->regs); |
| 160 | |
| 161 | err2: |
| 162 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); |
| 163 | |
| 164 | err1: |
| 165 | usb_put_hcd(hcd); |
| 166 | return retval; |
| 167 | } |
| 168 | |
| 169 | |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 170 | /* may be called with controller, bus, and devices active */ |
| 171 | |
| 172 | /** |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 173 | * usb_hcd_at91_remove - shutdown processing for AT91-based HCDs |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 174 | * @dev: USB Host Controller being removed |
| 175 | * Context: !in_interrupt() |
| 176 | * |
| 177 | * Reverses the effect of usb_hcd_at91_probe(), first invoking |
| 178 | * the HCD's stop() method. It is always called from a thread |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 179 | * context, "rmmod" or something similar. |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 180 | * |
| 181 | */ |
Pete Zaitcev | 421b4bf | 2008-06-01 14:38:43 -0700 | [diff] [blame] | 182 | static void usb_hcd_at91_remove(struct usb_hcd *hcd, |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 183 | struct platform_device *pdev) |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 184 | { |
| 185 | usb_remove_hcd(hcd); |
| 186 | at91_stop_hc(pdev); |
| 187 | iounmap(hcd->regs); |
David Brownell | 68ba61b | 2006-04-02 20:26:21 -0800 | [diff] [blame] | 188 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); |
Pete Zaitcev | 421b4bf | 2008-06-01 14:38:43 -0700 | [diff] [blame] | 189 | usb_put_hcd(hcd); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 190 | |
Jean-Christophe PLAGNIOL-VILLARD | 0af4316 | 2011-08-30 03:29:28 +0200 | [diff] [blame^] | 191 | clk_put(hclk); |
David Brownell | 68ba61b | 2006-04-02 20:26:21 -0800 | [diff] [blame] | 192 | clk_put(fclk); |
| 193 | clk_put(iclk); |
Andrew Victor | ed077bb | 2007-02-16 10:18:58 -0800 | [diff] [blame] | 194 | fclk = iclk = hclk = NULL; |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 195 | |
| 196 | dev_set_drvdata(&pdev->dev, NULL); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 197 | } |
| 198 | |
| 199 | /*-------------------------------------------------------------------------*/ |
| 200 | |
| 201 | static int __devinit |
| 202 | ohci_at91_start (struct usb_hcd *hcd) |
| 203 | { |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 204 | struct at91_usbh_data *board = hcd->self.controller->platform_data; |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 205 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
| 206 | int ret; |
| 207 | |
| 208 | if ((ret = ohci_init(ohci)) < 0) |
| 209 | return ret; |
| 210 | |
David Brownell | cd22afd | 2006-09-03 12:21:50 -0700 | [diff] [blame] | 211 | ohci->num_ports = board->ports; |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 212 | |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 213 | if ((ret = ohci_run(ohci)) < 0) { |
| 214 | err("can't start %s", hcd->self.bus_name); |
| 215 | ohci_stop(hcd); |
| 216 | return ret; |
| 217 | } |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 218 | return 0; |
| 219 | } |
| 220 | |
| 221 | /*-------------------------------------------------------------------------*/ |
| 222 | |
| 223 | static const struct hc_driver ohci_at91_hc_driver = { |
| 224 | .description = hcd_name, |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 225 | .product_desc = "AT91 OHCI", |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 226 | .hcd_priv_size = sizeof(struct ohci_hcd), |
| 227 | |
| 228 | /* |
| 229 | * generic hardware linkage |
| 230 | */ |
| 231 | .irq = ohci_irq, |
| 232 | .flags = HCD_USB11 | HCD_MEMORY, |
| 233 | |
| 234 | /* |
| 235 | * basic lifecycle operations |
| 236 | */ |
| 237 | .start = ohci_at91_start, |
| 238 | .stop = ohci_stop, |
David Brownell | dd9048a | 2006-12-05 03:18:31 -0800 | [diff] [blame] | 239 | .shutdown = ohci_shutdown, |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 240 | |
| 241 | /* |
| 242 | * managing i/o requests and associated device resources |
| 243 | */ |
| 244 | .urb_enqueue = ohci_urb_enqueue, |
| 245 | .urb_dequeue = ohci_urb_dequeue, |
| 246 | .endpoint_disable = ohci_endpoint_disable, |
| 247 | |
| 248 | /* |
| 249 | * scheduling support |
| 250 | */ |
| 251 | .get_frame_number = ohci_get_frame, |
| 252 | |
| 253 | /* |
| 254 | * root hub support |
| 255 | */ |
| 256 | .hub_status_data = ohci_hub_status_data, |
| 257 | .hub_control = ohci_hub_control, |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 258 | #ifdef CONFIG_PM |
David Brownell | 68ba61b | 2006-04-02 20:26:21 -0800 | [diff] [blame] | 259 | .bus_suspend = ohci_bus_suspend, |
| 260 | .bus_resume = ohci_bus_resume, |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 261 | #endif |
| 262 | .start_port_reset = ohci_start_port_reset, |
| 263 | }; |
| 264 | |
| 265 | /*-------------------------------------------------------------------------*/ |
| 266 | |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 267 | static int ohci_hcd_at91_drv_probe(struct platform_device *pdev) |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 268 | { |
David Brownell | 4bde4a4 | 2007-12-27 11:19:49 -0800 | [diff] [blame] | 269 | struct at91_usbh_data *pdata = pdev->dev.platform_data; |
| 270 | int i; |
| 271 | |
| 272 | if (pdata) { |
| 273 | /* REVISIT make the driver support per-port power switching, |
| 274 | * and also overcurrent detection. Here we assume the ports |
| 275 | * are always powered while this driver is active, and use |
| 276 | * active-low power switches. |
| 277 | */ |
Justin Waters | 3d6fdf7 | 2009-04-03 21:06:53 +0100 | [diff] [blame] | 278 | for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) { |
David Brownell | 4bde4a4 | 2007-12-27 11:19:49 -0800 | [diff] [blame] | 279 | if (pdata->vbus_pin[i] <= 0) |
| 280 | continue; |
| 281 | gpio_request(pdata->vbus_pin[i], "ohci_vbus"); |
| 282 | gpio_direction_output(pdata->vbus_pin[i], 0); |
| 283 | } |
| 284 | } |
| 285 | |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 286 | device_init_wakeup(&pdev->dev, 1); |
| 287 | return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 288 | } |
| 289 | |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 290 | static int ohci_hcd_at91_drv_remove(struct platform_device *pdev) |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 291 | { |
David Brownell | 4bde4a4 | 2007-12-27 11:19:49 -0800 | [diff] [blame] | 292 | struct at91_usbh_data *pdata = pdev->dev.platform_data; |
| 293 | int i; |
| 294 | |
| 295 | if (pdata) { |
Justin Waters | 3d6fdf7 | 2009-04-03 21:06:53 +0100 | [diff] [blame] | 296 | for (i = 0; i < ARRAY_SIZE(pdata->vbus_pin); i++) { |
David Brownell | 4bde4a4 | 2007-12-27 11:19:49 -0800 | [diff] [blame] | 297 | if (pdata->vbus_pin[i] <= 0) |
| 298 | continue; |
| 299 | gpio_direction_output(pdata->vbus_pin[i], 1); |
| 300 | gpio_free(pdata->vbus_pin[i]); |
| 301 | } |
| 302 | } |
| 303 | |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 304 | device_init_wakeup(&pdev->dev, 0); |
Pete Zaitcev | 421b4bf | 2008-06-01 14:38:43 -0700 | [diff] [blame] | 305 | usb_hcd_at91_remove(platform_get_drvdata(pdev), pdev); |
| 306 | return 0; |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 307 | } |
| 308 | |
| 309 | #ifdef CONFIG_PM |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 310 | |
David Brownell | 68ba61b | 2006-04-02 20:26:21 -0800 | [diff] [blame] | 311 | static int |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 312 | ohci_hcd_at91_drv_suspend(struct platform_device *pdev, pm_message_t mesg) |
David Brownell | 68ba61b | 2006-04-02 20:26:21 -0800 | [diff] [blame] | 313 | { |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 314 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 315 | struct ohci_hcd *ohci = hcd_to_ohci(hcd); |
| 316 | |
| 317 | if (device_may_wakeup(&pdev->dev)) |
| 318 | enable_irq_wake(hcd->irq); |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 319 | |
| 320 | /* |
| 321 | * The integrated transceivers seem unable to notice disconnect, |
| 322 | * reconnect, or wakeup without the 48 MHz clock active. so for |
| 323 | * correctness, always discard connection state (using reset). |
| 324 | * |
| 325 | * REVISIT: some boards will be able to turn VBUS off... |
| 326 | */ |
| 327 | if (at91_suspend_entering_slow_clock()) { |
| 328 | ohci_usb_reset (ohci); |
Patrice Vilchez | 869aa98 | 2010-04-28 13:45:40 +0200 | [diff] [blame] | 329 | /* flush the writes */ |
| 330 | (void) ohci_readl (ohci, &ohci->regs->control); |
Andrew Victor | ed077bb | 2007-02-16 10:18:58 -0800 | [diff] [blame] | 331 | at91_stop_clock(); |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 332 | } |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 333 | |
| 334 | return 0; |
| 335 | } |
| 336 | |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 337 | static int ohci_hcd_at91_drv_resume(struct platform_device *pdev) |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 338 | { |
Marc Pignat | 6dde896 | 2007-01-09 14:00:11 -0800 | [diff] [blame] | 339 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
| 340 | |
| 341 | if (device_may_wakeup(&pdev->dev)) |
| 342 | disable_irq_wake(hcd->irq); |
| 343 | |
Andrew Victor | ed077bb | 2007-02-16 10:18:58 -0800 | [diff] [blame] | 344 | if (!clocked) |
| 345 | at91_start_clock(); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 346 | |
Alan Stern | 43bbb7e | 2008-04-03 18:03:17 -0400 | [diff] [blame] | 347 | ohci_finish_controller_resume(hcd); |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 348 | return 0; |
| 349 | } |
| 350 | #else |
| 351 | #define ohci_hcd_at91_drv_suspend NULL |
| 352 | #define ohci_hcd_at91_drv_resume NULL |
| 353 | #endif |
| 354 | |
Kay Sievers | f4fce61 | 2008-04-10 21:29:22 -0700 | [diff] [blame] | 355 | MODULE_ALIAS("platform:at91_ohci"); |
David Brownell | 68ba61b | 2006-04-02 20:26:21 -0800 | [diff] [blame] | 356 | |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 357 | static struct platform_driver ohci_hcd_at91_driver = { |
| 358 | .probe = ohci_hcd_at91_drv_probe, |
| 359 | .remove = ohci_hcd_at91_drv_remove, |
Aleksey Gorelov | 64a21d0 | 2006-08-08 17:24:08 -0700 | [diff] [blame] | 360 | .shutdown = usb_hcd_platform_shutdown, |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 361 | .suspend = ohci_hcd_at91_drv_suspend, |
| 362 | .resume = ohci_hcd_at91_drv_resume, |
| 363 | .driver = { |
David Brownell | 0365ee0 | 2006-06-19 14:27:20 -0700 | [diff] [blame] | 364 | .name = "at91_ohci", |
Andrew Victor | 39a269c | 2006-01-22 10:32:13 -0800 | [diff] [blame] | 365 | .owner = THIS_MODULE, |
| 366 | }, |
| 367 | }; |