22 #define EHCI_INSNREG00(base) (base + 0x90)
23 #define EHCI_INSNREG00_ENA_INCR16 (0x1 << 25)
24 #define EHCI_INSNREG00_ENA_INCR8 (0x1 << 24)
25 #define EHCI_INSNREG00_ENA_INCR4 (0x1 << 23)
26 #define EHCI_INSNREG00_ENA_INCRX_ALIGN (0x1 << 22)
27 #define EHCI_INSNREG00_ENABLE_DMA_BURST \
28 (EHCI_INSNREG00_ENA_INCR16 | EHCI_INSNREG00_ENA_INCR8 | \
29 EHCI_INSNREG00_ENA_INCR4 | EHCI_INSNREG00_ENA_INCRX_ALIGN)
37 static const struct hc_driver s5p_ehci_hc_driver = {
38 .description = hcd_name,
39 .product_desc =
"S5P EHCI Host Controller",
40 .hcd_priv_size =
sizeof(
struct ehci_hcd),
43 .flags = HCD_MEMORY | HCD_USB2,
50 .get_frame_number = ehci_get_frame,
52 .urb_enqueue = ehci_urb_enqueue,
53 .urb_dequeue = ehci_urb_dequeue,
54 .endpoint_disable = ehci_endpoint_disable,
55 .endpoint_reset = ehci_endpoint_reset,
57 .hub_status_data = ehci_hub_status_data,
58 .hub_control = ehci_hub_control,
62 .relinquish_port = ehci_relinquish_port,
63 .port_handed_over = ehci_port_handed_over,
65 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
73 if (!pdev->
dev.of_node)
76 gpio = of_get_named_gpio(pdev->
dev.of_node,
77 "samsung,vbus-gpio", 0);
78 if (!gpio_is_valid(gpio))
83 dev_err(&pdev->
dev,
"can't request ehci vbus gpio %d", gpio);
98 pdata = pdev->
dev.platform_data;
100 dev_err(&pdev->
dev,
"No platform data defined\n");
109 if (!pdev->
dev.dma_mask)
110 pdev->
dev.dma_mask = &ehci_s5p_dma_mask;
111 if (!pdev->
dev.coherent_dma_mask)
114 s5p_setup_vbus_gpio(pdev);
121 s5p_ehci->
dev = &pdev->
dev;
124 dev_name(&pdev->
dev));
126 dev_err(&pdev->
dev,
"Unable to create HCD\n");
133 if (IS_ERR(s5p_ehci->
clk)) {
134 dev_err(&pdev->
dev,
"Failed to get usbhost clock\n");
135 err = PTR_ERR(s5p_ehci->
clk);
145 dev_err(&pdev->
dev,
"Failed to get I/O memory\n");
150 hcd->rsrc_start = res->
start;
151 hcd->rsrc_len = resource_size(res);
154 dev_err(&pdev->
dev,
"Failed to remap I/O memory\n");
169 ehci = hcd_to_ehci(hcd);
170 ehci->
caps = hcd->regs;
177 dev_err(&pdev->
dev,
"Failed to add USB HCD\n");
181 platform_set_drvdata(pdev, s5p_ehci);
195 struct s5p_ehci_hcd *s5p_ehci = platform_get_drvdata(pdev);
196 struct usb_hcd *hcd = s5p_ehci->
hcd;
212 struct s5p_ehci_hcd *s5p_ehci = platform_get_drvdata(pdev);
213 struct usb_hcd *hcd = s5p_ehci->
hcd;
215 if (hcd->driver->shutdown)
216 hcd->driver->shutdown(hcd);
223 struct usb_hcd *hcd = s5p_ehci->
hcd;
224 bool do_wakeup = device_may_wakeup(dev);
229 rc = ehci_suspend(hcd, do_wakeup);
242 struct usb_hcd *hcd = s5p_ehci->
hcd;
254 ehci_resume(hcd,
false);
258 #define s5p_ehci_suspend NULL
259 #define s5p_ehci_resume NULL
262 static const struct dev_pm_ops s5p_ehci_pm_ops = {
268 static const struct of_device_id exynos_ehci_match[] = {
276 .probe = s5p_ehci_probe,
278 .shutdown = s5p_ehci_shutdown,
282 .pm = &s5p_ehci_pm_ops,