blob: 551581734c219ec41c35391d43fd3f352bcc2ae8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * OHCI HCD (Host Controller Driver) for USB.
3 *
4 * (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
5 * (C) Copyright 2000-2002 David Brownell <dbrownell@users.sourceforge.net>
6 * (C) Copyright 2002 Hewlett-Packard Company
7 *
8 * Bus Glue for pxa27x
9 *
10 * Written by Christopher Hoover <ch@hpl.hp.com>
11 * Based on fragments of previous driver by Russell King et al.
12 *
13 * Modified for LH7A404 from ohci-sa1111.c
14 * by Durgesh Pattamatta <pattamattad@sharpsec.com>
15 *
16 * Modified for pxa27x from ohci-lh7a404.c
17 * by Nick Bane <nick@cecomputing.co.uk> 26-8-2004
18 *
19 * This file is licenced under the GPL.
20 */
21
22#include <linux/device.h>
Tim Schmielau4e57b682005-10-30 15:03:48 -080023#include <linux/signal.h>
Russell Kingd052d1b2005-10-29 19:07:23 +010024#include <linux/platform_device.h>
eric miaoa8bcf412007-12-12 08:53:25 +080025#include <linux/clk.h>
Linus Torvalds4fd5f822005-10-31 07:32:56 -080026
Russell Kinga09e64f2008-08-05 16:14:15 +010027#include <mach/hardware.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010028#include <mach/pxa2xx-regs.h> /* FIXME: for PSSR */
29#include <mach/ohci.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
Eric Miao596050b2008-09-27 16:12:32 +080031/*
32 * UHC: USB Host Controller (OHCI-like) register definitions
33 */
34#define UHC_BASE_PHYS (0x4C000000)
35#define UHCREV __REG(0x4C000000) /* UHC HCI Spec Revision */
36#define UHCHCON __REG(0x4C000004) /* UHC Host Control Register */
37#define UHCCOMS __REG(0x4C000008) /* UHC Command Status Register */
38#define UHCINTS __REG(0x4C00000C) /* UHC Interrupt Status Register */
39#define UHCINTE __REG(0x4C000010) /* UHC Interrupt Enable */
40#define UHCINTD __REG(0x4C000014) /* UHC Interrupt Disable */
41#define UHCHCCA __REG(0x4C000018) /* UHC Host Controller Comm. Area */
42#define UHCPCED __REG(0x4C00001C) /* UHC Period Current Endpt Descr */
43#define UHCCHED __REG(0x4C000020) /* UHC Control Head Endpt Descr */
44#define UHCCCED __REG(0x4C000024) /* UHC Control Current Endpt Descr */
45#define UHCBHED __REG(0x4C000028) /* UHC Bulk Head Endpt Descr */
46#define UHCBCED __REG(0x4C00002C) /* UHC Bulk Current Endpt Descr */
47#define UHCDHEAD __REG(0x4C000030) /* UHC Done Head */
48#define UHCFMI __REG(0x4C000034) /* UHC Frame Interval */
49#define UHCFMR __REG(0x4C000038) /* UHC Frame Remaining */
50#define UHCFMN __REG(0x4C00003C) /* UHC Frame Number */
51#define UHCPERS __REG(0x4C000040) /* UHC Periodic Start */
52#define UHCLS __REG(0x4C000044) /* UHC Low Speed Threshold */
53
54#define UHCRHDA __REG(0x4C000048) /* UHC Root Hub Descriptor A */
55#define UHCRHDA_NOCP (1 << 12) /* No over current protection */
56#define UHCRHDA_OCPM (1 << 11) /* Over Current Protection Mode */
57#define UHCRHDA_POTPGT(x) \
58 (((x) & 0xff) << 24) /* Power On To Power Good Time */
59
60#define UHCRHDB __REG(0x4C00004C) /* UHC Root Hub Descriptor B */
61#define UHCRHS __REG(0x4C000050) /* UHC Root Hub Status */
62#define UHCRHPS1 __REG(0x4C000054) /* UHC Root Hub Port 1 Status */
63#define UHCRHPS2 __REG(0x4C000058) /* UHC Root Hub Port 2 Status */
64#define UHCRHPS3 __REG(0x4C00005C) /* UHC Root Hub Port 3 Status */
65
66#define UHCSTAT __REG(0x4C000060) /* UHC Status Register */
67#define UHCSTAT_UPS3 (1 << 16) /* USB Power Sense Port3 */
68#define UHCSTAT_SBMAI (1 << 15) /* System Bus Master Abort Interrupt*/
69#define UHCSTAT_SBTAI (1 << 14) /* System Bus Target Abort Interrupt*/
70#define UHCSTAT_UPRI (1 << 13) /* USB Port Resume Interrupt */
71#define UHCSTAT_UPS2 (1 << 12) /* USB Power Sense Port 2 */
72#define UHCSTAT_UPS1 (1 << 11) /* USB Power Sense Port 1 */
73#define UHCSTAT_HTA (1 << 10) /* HCI Target Abort */
74#define UHCSTAT_HBA (1 << 8) /* HCI Buffer Active */
75#define UHCSTAT_RWUE (1 << 7) /* HCI Remote Wake Up Event */
76
77#define UHCHR __REG(0x4C000064) /* UHC Reset Register */
78#define UHCHR_SSEP3 (1 << 11) /* Sleep Standby Enable for Port3 */
79#define UHCHR_SSEP2 (1 << 10) /* Sleep Standby Enable for Port2 */
80#define UHCHR_SSEP1 (1 << 9) /* Sleep Standby Enable for Port1 */
81#define UHCHR_PCPL (1 << 7) /* Power control polarity low */
82#define UHCHR_PSPL (1 << 6) /* Power sense polarity low */
83#define UHCHR_SSE (1 << 5) /* Sleep Standby Enable */
84#define UHCHR_UIT (1 << 4) /* USB Interrupt Test */
85#define UHCHR_SSDC (1 << 3) /* Simulation Scale Down Clock */
86#define UHCHR_CGR (1 << 2) /* Clock Generation Reset */
87#define UHCHR_FHR (1 << 1) /* Force Host Controller Reset */
88#define UHCHR_FSBIR (1 << 0) /* Force System Bus Iface Reset */
89
90#define UHCHIE __REG(0x4C000068) /* UHC Interrupt Enable Register*/
91#define UHCHIE_UPS3IE (1 << 14) /* Power Sense Port3 IntEn */
92#define UHCHIE_UPRIE (1 << 13) /* Port Resume IntEn */
93#define UHCHIE_UPS2IE (1 << 12) /* Power Sense Port2 IntEn */
94#define UHCHIE_UPS1IE (1 << 11) /* Power Sense Port1 IntEn */
95#define UHCHIE_TAIE (1 << 10) /* HCI Interface Transfer Abort
96 Interrupt Enable*/
97#define UHCHIE_HBAIE (1 << 8) /* HCI Buffer Active IntEn */
98#define UHCHIE_RWIE (1 << 7) /* Remote Wake-up IntEn */
99
100#define UHCHIT __REG(0x4C00006C) /* UHC Interrupt Test register */
101
102
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103#define PXA_UHC_MAX_PORTNUM 3
104
105#define UHCRHPS(x) __REG2( 0x4C000050, (x)<<2 )
106
eric miaoa8bcf412007-12-12 08:53:25 +0800107static struct clk *usb_clk;
108
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109/*
110 PMM_NPS_MODE -- PMM Non-power switching mode
111 Ports are powered continuously.
112
113 PMM_GLOBAL_MODE -- PMM global switching mode
114 All ports are powered at the same time.
115
116 PMM_PERPORT_MODE -- PMM per port switching mode
117 Ports are powered individually.
118 */
119static int pxa27x_ohci_select_pmm( int mode )
120{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121 switch ( mode ) {
122 case PMM_NPS_MODE:
123 UHCRHDA |= RH_A_NPS;
David Brownelldd9048a2006-12-05 03:18:31 -0800124 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 case PMM_GLOBAL_MODE:
126 UHCRHDA &= ~(RH_A_NPS & RH_A_PSM);
127 break;
128 case PMM_PERPORT_MODE:
129 UHCRHDA &= ~(RH_A_NPS);
130 UHCRHDA |= RH_A_PSM;
131
132 /* Set port power control mask bits, only 3 ports. */
133 UHCRHDB |= (0x7<<17);
134 break;
135 default:
136 printk( KERN_ERR
David Brownelldd9048a2006-12-05 03:18:31 -0800137 "Invalid mode %d, set to non-power switch mode.\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138 mode );
139
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140 UHCRHDA |= RH_A_NPS;
141 }
142
143 return 0;
144}
145
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146extern int usb_disabled(void);
147
148/*-------------------------------------------------------------------------*/
149
Eric Miao097b5332008-09-27 15:49:57 +0800150static inline void pxa27x_setup_hc(struct pxaohci_platform_data *inf)
151{
152 uint32_t uhchr = UHCHR;
153 uint32_t uhcrhda = UHCRHDA;
154
155 if (inf->flags & ENABLE_PORT1)
156 uhchr &= ~UHCHR_SSEP1;
157
158 if (inf->flags & ENABLE_PORT2)
159 uhchr &= ~UHCHR_SSEP2;
160
161 if (inf->flags & ENABLE_PORT3)
162 uhchr &= ~UHCHR_SSEP3;
163
164 if (inf->flags & POWER_CONTROL_LOW)
165 uhchr |= UHCHR_PCPL;
166
167 if (inf->flags & POWER_SENSE_LOW)
168 uhchr |= UHCHR_PSPL;
169
170 if (inf->flags & NO_OC_PROTECTION)
171 uhcrhda |= UHCRHDA_NOCP;
172
173 if (inf->flags & OC_MODE_PERPORT)
174 uhcrhda |= UHCRHDA_OCPM;
175
176 if (inf->power_on_delay) {
177 uhcrhda &= ~UHCRHDA_POTPGT(0xff);
178 uhcrhda |= UHCRHDA_POTPGT(inf->power_on_delay / 2);
179 }
180
181 UHCHR = uhchr;
182 UHCRHDA = uhcrhda;
183}
184
Richard Purdie81f280e2005-11-12 14:22:11 +0000185static int pxa27x_start_hc(struct device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186{
Richard Purdie81f280e2005-11-12 14:22:11 +0000187 int retval = 0;
188 struct pxaohci_platform_data *inf;
189
190 inf = dev->platform_data;
191
eric miaoa8bcf412007-12-12 08:53:25 +0800192 clk_enable(usb_clk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700193
194 UHCHR |= UHCHR_FHR;
195 udelay(11);
196 UHCHR &= ~UHCHR_FHR;
197
198 UHCHR |= UHCHR_FSBIR;
199 while (UHCHR & UHCHR_FSBIR)
200 cpu_relax();
201
Eric Miao097b5332008-09-27 15:49:57 +0800202 pxa27x_setup_hc(inf);
203
Richard Purdie81f280e2005-11-12 14:22:11 +0000204 if (inf->init)
205 retval = inf->init(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206
Richard Purdie81f280e2005-11-12 14:22:11 +0000207 if (retval < 0)
208 return retval;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209
210 UHCHR &= ~UHCHR_SSE;
211
212 UHCHIE = (UHCHIE_UPRIE | UHCHIE_RWIE);
David Brownell155faf52005-08-31 11:54:09 -0700213
214 /* Clear any OTG Pin Hold */
Philipp Zabeld438ae52008-06-06 18:40:47 +0100215 if (cpu_is_pxa27x() && (PSSR & PSSR_OTGPH))
David Brownell155faf52005-08-31 11:54:09 -0700216 PSSR |= PSSR_OTGPH;
Richard Purdie81f280e2005-11-12 14:22:11 +0000217
218 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219}
220
Richard Purdie81f280e2005-11-12 14:22:11 +0000221static void pxa27x_stop_hc(struct device *dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222{
Richard Purdie81f280e2005-11-12 14:22:11 +0000223 struct pxaohci_platform_data *inf;
224
225 inf = dev->platform_data;
226
227 if (inf->exit)
228 inf->exit(dev);
229
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230 UHCHR |= UHCHR_FHR;
231 udelay(11);
232 UHCHR &= ~UHCHR_FHR;
233
234 UHCCOMS |= 1;
235 udelay(10);
236
eric miaoa8bcf412007-12-12 08:53:25 +0800237 clk_disable(usb_clk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238}
239
240
241/*-------------------------------------------------------------------------*/
242
243/* configure so an HC device and id are always provided */
244/* always called with process context; sleeping is OK */
245
246
247/**
248 * usb_hcd_pxa27x_probe - initialize pxa27x-based HCDs
249 * Context: !in_interrupt()
250 *
251 * Allocates basic resources for this USB host controller, and
252 * then invokes the start() method for the HCD associated with it
253 * through the hotplug entry's driver_data.
254 *
255 */
Richard Purdie81f280e2005-11-12 14:22:11 +0000256int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device *pdev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257{
258 int retval;
259 struct usb_hcd *hcd;
Richard Purdie81f280e2005-11-12 14:22:11 +0000260 struct pxaohci_platform_data *inf;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700261
Richard Purdie81f280e2005-11-12 14:22:11 +0000262 inf = pdev->dev.platform_data;
263
264 if (!inf)
265 return -ENODEV;
266
267 if (pdev->resource[1].flags != IORESOURCE_IRQ) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700268 pr_debug ("resource[1] is not IORESOURCE_IRQ");
269 return -ENOMEM;
270 }
271
eric miaoa8bcf412007-12-12 08:53:25 +0800272 usb_clk = clk_get(&pdev->dev, "USBCLK");
273 if (IS_ERR(usb_clk))
274 return PTR_ERR(usb_clk);
275
Richard Purdie81f280e2005-11-12 14:22:11 +0000276 hcd = usb_create_hcd (driver, &pdev->dev, "pxa27x");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277 if (!hcd)
278 return -ENOMEM;
Richard Purdie81f280e2005-11-12 14:22:11 +0000279 hcd->rsrc_start = pdev->resource[0].start;
280 hcd->rsrc_len = pdev->resource[0].end - pdev->resource[0].start + 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281
282 if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
283 pr_debug("request_mem_region failed");
284 retval = -EBUSY;
285 goto err1;
286 }
287
288 hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
289 if (!hcd->regs) {
290 pr_debug("ioremap failed");
291 retval = -ENOMEM;
292 goto err2;
293 }
294
Richard Purdie81f280e2005-11-12 14:22:11 +0000295 if ((retval = pxa27x_start_hc(&pdev->dev)) < 0) {
296 pr_debug("pxa27x_start_hc failed");
297 goto err3;
298 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299
300 /* Select Power Management Mode */
Richard Purdie81f280e2005-11-12 14:22:11 +0000301 pxa27x_ohci_select_pmm(inf->port_mode);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302
Richard Purdie0c27c5d2006-06-08 22:44:07 +0100303 if (inf->power_budget)
304 hcd->power_budget = inf->power_budget;
305
Linus Torvalds1da177e2005-04-16 15:20:36 -0700306 ohci_hcd_init(hcd_to_ohci(hcd));
307
Thomas Gleixnerd54b5ca2006-07-01 19:29:44 -0700308 retval = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_DISABLED);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700309 if (retval == 0)
310 return retval;
311
Richard Purdie81f280e2005-11-12 14:22:11 +0000312 pxa27x_stop_hc(&pdev->dev);
313 err3:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314 iounmap(hcd->regs);
315 err2:
316 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
317 err1:
318 usb_put_hcd(hcd);
eric miaoa8bcf412007-12-12 08:53:25 +0800319 clk_put(usb_clk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320 return retval;
321}
322
323
324/* may be called without controller electrically present */
325/* may be called with controller, bus, and devices active */
326
327/**
328 * usb_hcd_pxa27x_remove - shutdown processing for pxa27x-based HCDs
329 * @dev: USB Host Controller being removed
330 * Context: !in_interrupt()
331 *
332 * Reverses the effect of usb_hcd_pxa27x_probe(), first invoking
333 * the HCD's stop() method. It is always called from a thread
334 * context, normally "rmmod", "apmd", or something similar.
335 *
336 */
Richard Purdie81f280e2005-11-12 14:22:11 +0000337void usb_hcd_pxa27x_remove (struct usb_hcd *hcd, struct platform_device *pdev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338{
339 usb_remove_hcd(hcd);
Richard Purdie81f280e2005-11-12 14:22:11 +0000340 pxa27x_stop_hc(&pdev->dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341 iounmap(hcd->regs);
342 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
343 usb_put_hcd(hcd);
eric miaoa8bcf412007-12-12 08:53:25 +0800344 clk_put(usb_clk);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345}
346
347/*-------------------------------------------------------------------------*/
348
349static int __devinit
350ohci_pxa27x_start (struct usb_hcd *hcd)
351{
352 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
353 int ret;
354
355 ohci_dbg (ohci, "ohci_pxa27x_start, ohci:%p", ohci);
356
David Brownellfdd13b32005-08-31 11:52:57 -0700357 /* The value of NDP in roothub_a is incorrect on this hardware */
358 ohci->num_ports = 3;
359
Linus Torvalds1da177e2005-04-16 15:20:36 -0700360 if ((ret = ohci_init(ohci)) < 0)
361 return ret;
362
363 if ((ret = ohci_run (ohci)) < 0) {
364 err ("can't start %s", hcd->self.bus_name);
365 ohci_stop (hcd);
366 return ret;
367 }
368
369 return 0;
370}
371
372/*-------------------------------------------------------------------------*/
373
374static const struct hc_driver ohci_pxa27x_hc_driver = {
375 .description = hcd_name,
376 .product_desc = "PXA27x OHCI",
377 .hcd_priv_size = sizeof(struct ohci_hcd),
378
379 /*
380 * generic hardware linkage
381 */
382 .irq = ohci_irq,
383 .flags = HCD_USB11 | HCD_MEMORY,
384
385 /*
386 * basic lifecycle operations
387 */
388 .start = ohci_pxa27x_start,
389 .stop = ohci_stop,
David Brownelldd9048a2006-12-05 03:18:31 -0800390 .shutdown = ohci_shutdown,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391
392 /*
393 * managing i/o requests and associated device resources
394 */
395 .urb_enqueue = ohci_urb_enqueue,
396 .urb_dequeue = ohci_urb_dequeue,
397 .endpoint_disable = ohci_endpoint_disable,
398
399 /*
400 * scheduling support
401 */
402 .get_frame_number = ohci_get_frame,
403
404 /*
405 * root hub support
406 */
407 .hub_status_data = ohci_hub_status_data,
408 .hub_control = ohci_hub_control,
David Brownell8ad7fe12005-09-13 19:59:11 -0700409#ifdef CONFIG_PM
Alan Stern0c0382e2005-10-13 17:08:02 -0400410 .bus_suspend = ohci_bus_suspend,
411 .bus_resume = ohci_bus_resume,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412#endif
David Brownell92936772005-09-22 22:32:11 -0700413 .start_port_reset = ohci_start_port_reset,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414};
415
416/*-------------------------------------------------------------------------*/
417
Russell King3ae5eae2005-11-09 22:32:44 +0000418static int ohci_hcd_pxa27x_drv_probe(struct platform_device *pdev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700420 pr_debug ("In ohci_hcd_pxa27x_drv_probe");
421
422 if (usb_disabled())
423 return -ENODEV;
424
Richard Purdie81f280e2005-11-12 14:22:11 +0000425 return usb_hcd_pxa27x_probe(&ohci_pxa27x_hc_driver, pdev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700426}
427
Russell King3ae5eae2005-11-09 22:32:44 +0000428static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429{
Russell King3ae5eae2005-11-09 22:32:44 +0000430 struct usb_hcd *hcd = platform_get_drvdata(pdev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431
432 usb_hcd_pxa27x_remove(hcd, pdev);
Richard Purdiea5e36d22005-11-28 22:15:46 +0000433 platform_set_drvdata(pdev, NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434 return 0;
435}
436
Richard Purdie2e1dcc12005-11-12 14:22:14 +0000437#ifdef CONFIG_PM
438static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *pdev, pm_message_t state)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439{
Richard Purdiea5e36d22005-11-28 22:15:46 +0000440 struct usb_hcd *hcd = platform_get_drvdata(pdev);
441 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
Richard Purdie2e1dcc12005-11-12 14:22:14 +0000442
443 if (time_before(jiffies, ohci->next_statechange))
444 msleep(5);
445 ohci->next_statechange = jiffies;
446
447 pxa27x_stop_hc(&pdev->dev);
Richard Purdiea5e36d22005-11-28 22:15:46 +0000448 hcd->state = HC_STATE_SUSPENDED;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449
450 return 0;
451}
452
Richard Purdie2e1dcc12005-11-12 14:22:14 +0000453static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700454{
Richard Purdiea5e36d22005-11-28 22:15:46 +0000455 struct usb_hcd *hcd = platform_get_drvdata(pdev);
456 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
Richard Purdie2e1dcc12005-11-12 14:22:14 +0000457 int status;
458
459 if (time_before(jiffies, ohci->next_statechange))
460 msleep(5);
461 ohci->next_statechange = jiffies;
462
463 if ((status = pxa27x_start_hc(&pdev->dev)) < 0)
464 return status;
465
Alan Stern43bbb7e2008-04-03 18:03:17 -0400466 ohci_finish_controller_resume(hcd);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467 return 0;
468}
Richard Purdie2e1dcc12005-11-12 14:22:14 +0000469#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700470
Kay Sieversf4fce612008-04-10 21:29:22 -0700471/* work with hotplug and coldplug */
472MODULE_ALIAS("platform:pxa27x-ohci");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473
Russell King3ae5eae2005-11-09 22:32:44 +0000474static struct platform_driver ohci_hcd_pxa27x_driver = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475 .probe = ohci_hcd_pxa27x_drv_probe,
476 .remove = ohci_hcd_pxa27x_drv_remove,
David Brownelldd9048a2006-12-05 03:18:31 -0800477 .shutdown = usb_hcd_platform_shutdown,
Richard Purdie2e1dcc12005-11-12 14:22:14 +0000478#ifdef CONFIG_PM
David Brownelldd9048a2006-12-05 03:18:31 -0800479 .suspend = ohci_hcd_pxa27x_drv_suspend,
Russell King3ae5eae2005-11-09 22:32:44 +0000480 .resume = ohci_hcd_pxa27x_drv_resume,
Richard Purdie2e1dcc12005-11-12 14:22:14 +0000481#endif
Russell King3ae5eae2005-11-09 22:32:44 +0000482 .driver = {
483 .name = "pxa27x-ohci",
Kay Sieversf4fce612008-04-10 21:29:22 -0700484 .owner = THIS_MODULE,
Russell King3ae5eae2005-11-09 22:32:44 +0000485 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700486};
487