27 #include <linux/device.h>
28 #include <linux/signal.h>
31 static struct clk *usb_host_clock;
33 static void ep93xx_start_hc(
struct device *
dev)
38 static void ep93xx_stop_hc(
struct device *
dev)
43 static int usb_hcd_ep93xx_probe(
const struct hc_driver *
driver,
50 dev_dbg(&pdev->
dev,
"resource[1] is not IORESOURCE_IRQ\n");
58 hcd->rsrc_start = pdev->
resource[0].start;
66 hcd->regs =
ioremap(hcd->rsrc_start, hcd->rsrc_len);
67 if (hcd->regs ==
NULL) {
74 if (IS_ERR(usb_host_clock)) {
76 retval = PTR_ERR(usb_host_clock);
80 ep93xx_start_hc(&pdev->
dev);
82 ohci_hcd_init(hcd_to_ohci(hcd));
88 ep93xx_stop_hc(&pdev->
dev);
99 static void usb_hcd_ep93xx_remove(
struct usb_hcd *hcd,
103 ep93xx_stop_hc(&pdev->
dev);
110 static int __devinit ohci_ep93xx_start(
struct usb_hcd *hcd)
115 if ((ret = ohci_init(ohci)) < 0)
118 if ((ret = ohci_run(ohci)) < 0) {
119 dev_err(hcd->self.controller,
"can't start %s\n",
128 static struct hc_driver ohci_ep93xx_hc_driver = {
129 .description = hcd_name,
130 .product_desc =
"EP93xx OHCI",
131 .hcd_priv_size =
sizeof(
struct ohci_hcd),
133 .flags = HCD_USB11 | HCD_MEMORY,
134 .start = ohci_ep93xx_start,
136 .shutdown = ohci_shutdown,
137 .urb_enqueue = ohci_urb_enqueue,
138 .urb_dequeue = ohci_urb_dequeue,
139 .endpoint_disable = ohci_endpoint_disable,
140 .get_frame_number = ohci_get_frame,
141 .hub_status_data = ohci_hub_status_data,
142 .hub_control = ohci_hub_control,
144 .bus_suspend = ohci_bus_suspend,
145 .bus_resume = ohci_bus_resume,
158 ret = usb_hcd_ep93xx_probe(&ohci_ep93xx_hc_driver, pdev);
165 struct usb_hcd *hcd = platform_get_drvdata(pdev);
167 usb_hcd_ep93xx_remove(hcd, pdev);
175 struct usb_hcd *hcd = platform_get_drvdata(pdev);
176 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
182 ep93xx_stop_hc(&pdev->
dev);
188 struct usb_hcd *hcd = platform_get_drvdata(pdev);
189 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
195 ep93xx_start_hc(&pdev->
dev);
197 ohci_finish_controller_resume(hcd);
204 .probe = ohci_hcd_ep93xx_drv_probe,
205 .remove = ohci_hcd_ep93xx_drv_remove,
208 .suspend = ohci_hcd_ep93xx_drv_suspend,
209 .resume = ohci_hcd_ep93xx_drv_resume,
212 .name =
"ep93xx-ohci",