14 #include <linux/signal.h>
24 #define to_spear_ohci(hcd) (struct spear_ohci *)hcd_to_ohci(hcd)
28 clk_prepare_enable(ohci->
clk);
33 clk_disable_unprepare(ohci->
clk);
36 static int __devinit ohci_spear_start(
struct usb_hcd *hcd)
41 ret = ohci_init(ohci);
44 ohci->
regs = hcd->regs;
48 dev_err(hcd->self.controller,
"can't start\n");
61 static const struct hc_driver ohci_spear_hc_driver = {
62 .description = hcd_name,
63 .product_desc =
"SPEAr OHCI",
68 .flags = HCD_USB11 | HCD_MEMORY,
71 .start = ohci_spear_start,
73 .shutdown = ohci_shutdown,
75 .bus_suspend = ohci_bus_suspend,
76 .bus_resume = ohci_bus_resume,
80 .urb_enqueue = ohci_urb_enqueue,
81 .urb_dequeue = ohci_urb_dequeue,
82 .endpoint_disable = ohci_endpoint_disable,
85 .get_frame_number = ohci_get_frame,
88 .hub_status_data = ohci_hub_status_data,
89 .hub_control = ohci_hub_control,
98 const struct hc_driver *
driver = &ohci_spear_hc_driver;
99 struct usb_hcd *hcd =
NULL;
100 struct clk *usbh_clk;
104 char clk_name[20] =
"usbh_clk";
105 static int instance = -1;
118 if (!pdev->
dev.dma_mask)
119 pdev->
dev.dma_mask = &spear_ohci_dma_mask;
128 sprintf(clk_name,
"usbh.%01d_clk", instance);
131 if (IS_ERR(usbh_clk)) {
132 dev_err(&pdev->
dev,
"Error getting interface clock\n");
133 retval = PTR_ERR(usbh_clk);
134 goto fail_get_usbh_clk;
140 goto fail_create_hcd;
146 goto fail_request_resource;
149 hcd->rsrc_start = pdev->
resource[0].start;
150 hcd->rsrc_len = resource_size(res);
152 dev_dbg(&pdev->
dev,
"request_mem_region failed\n");
154 goto fail_request_resource;
157 hcd->regs =
ioremap(hcd->rsrc_start, hcd->rsrc_len);
164 ohci_p = (
struct spear_ohci *)hcd_to_ohci(hcd);
165 ohci_p->
clk = usbh_clk;
166 spear_start_ohci(ohci_p);
167 ohci_hcd_init(hcd_to_ohci(hcd));
173 spear_stop_ohci(ohci_p);
177 fail_request_resource:
183 dev_err(&pdev->
dev,
"init fail, %d\n", retval);
190 struct usb_hcd *hcd = platform_get_drvdata(pdev);
195 spear_stop_ohci(ohci_p);
203 platform_set_drvdata(pdev,
NULL);
207 #if defined(CONFIG_PM)
211 struct usb_hcd *hcd = platform_get_drvdata(dev);
212 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
219 spear_stop_ohci(ohci_p);
225 struct usb_hcd *hcd = platform_get_drvdata(dev);
226 struct ohci_hcd *ohci = hcd_to_ohci(hcd);
233 spear_start_ohci(ohci_p);
234 ohci_finish_controller_resume(hcd);
240 { .compatible =
"st,spear600-ohci", },
246 .probe = spear_ohci_hcd_drv_probe,
247 .remove = spear_ohci_hcd_drv_remove,
249 .suspend = spear_ohci_hcd_drv_suspend,
250 .resume = spear_ohci_hcd_drv_resume,
254 .name =
"spear-ohci",