25 static void atmel_start_clock(
void)
32 static void atmel_stop_clock(
void)
53 static int ehci_atmel_setup(
struct usb_hcd *hcd)
55 struct ehci_hcd *ehci = hcd_to_ehci(hcd);
59 ehci->
caps = hcd->regs;
61 retval = ehci_setup(hcd);
65 ehci_port_power(ehci, 0);
70 static const struct hc_driver ehci_atmel_hc_driver = {
71 .description = hcd_name,
72 .product_desc =
"Atmel EHCI UHP HS",
73 .hcd_priv_size =
sizeof(
struct ehci_hcd),
77 .flags = HCD_MEMORY | HCD_USB2,
80 .reset = ehci_atmel_setup,
83 .shutdown = ehci_shutdown,
86 .urb_enqueue = ehci_urb_enqueue,
87 .urb_dequeue = ehci_urb_dequeue,
88 .endpoint_disable = ehci_endpoint_disable,
89 .endpoint_reset = ehci_endpoint_reset,
92 .get_frame_number = ehci_get_frame,
95 .hub_status_data = ehci_hub_status_data,
96 .hub_control = ehci_hub_control,
99 .relinquish_port = ehci_relinquish_port,
100 .port_handed_over = ehci_port_handed_over,
102 .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete,
110 const struct hc_driver *
driver = &ehci_atmel_hc_driver;
118 pr_debug(
"Initializing Atmel-SoC USB Host Controller\n");
123 "Found HC with no IRQ. Check %s setup!\n",
124 dev_name(&pdev->
dev));
126 goto fail_create_hcd;
133 if (!pdev->
dev.dma_mask)
134 pdev->
dev.dma_mask = &at91_ehci_dma_mask;
139 goto fail_create_hcd;
145 "Found HC with no register addr. Check %s setup!\n",
146 dev_name(&pdev->
dev));
148 goto fail_request_resource;
150 hcd->rsrc_start = res->
start;
151 hcd->rsrc_len = resource_size(res);
154 if (hcd->regs ==
NULL) {
155 dev_dbg(&pdev->
dev,
"error mapping memory\n");
157 goto fail_request_resource;
162 dev_err(&pdev->
dev,
"Error getting interface clock\n");
164 goto fail_request_resource;
168 dev_err(&pdev->
dev,
"Error getting function clock\n");
170 goto fail_request_resource;
173 atmel_start_ehci(pdev);
182 atmel_stop_ehci(pdev);
183 fail_request_resource:
187 dev_name(&pdev->
dev), retval);
194 struct usb_hcd *hcd = platform_get_drvdata(pdev);
200 atmel_stop_ehci(pdev);
207 static const struct of_device_id atmel_ehci_dt_ids[] = {
216 .probe = ehci_atmel_drv_probe,
220 .name =
"atmel-ehci",