ehci-tegra.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. /*
  2. * EHCI-compliant USB host controller driver for NVIDIA Tegra SoCs
  3. *
  4. * Copyright (C) 2010 Google, Inc.
  5. * Copyright (C) 2009 - 2013 NVIDIA Corporation
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  15. * more details.
  16. *
  17. */
  18. #include <linux/clk.h>
  19. #include <linux/dma-mapping.h>
  20. #include <linux/err.h>
  21. #include <linux/gpio.h>
  22. #include <linux/io.h>
  23. #include <linux/irq.h>
  24. #include <linux/module.h>
  25. #include <linux/of.h>
  26. #include <linux/of_device.h>
  27. #include <linux/of_gpio.h>
  28. #include <linux/platform_device.h>
  29. #include <linux/pm_runtime.h>
  30. #include <linux/reset.h>
  31. #include <linux/slab.h>
  32. #include <linux/usb/ehci_def.h>
  33. #include <linux/usb/tegra_usb_phy.h>
  34. #include <linux/usb.h>
  35. #include <linux/usb/hcd.h>
  36. #include <linux/usb/otg.h>
  37. #include "ehci.h"
  38. #define PORT_WAKE_BITS (PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E)
  39. #define TEGRA_USB_DMA_ALIGN 32
  40. #define DRIVER_DESC "Tegra EHCI driver"
  41. #define DRV_NAME "tegra-ehci"
  42. static struct hc_driver __read_mostly tegra_ehci_hc_driver;
  43. static bool usb1_reset_attempted;
  44. struct tegra_ehci_soc_config {
  45. bool has_hostpc;
  46. };
  47. struct tegra_ehci_hcd {
  48. struct tegra_usb_phy *phy;
  49. struct clk *clk;
  50. struct reset_control *rst;
  51. int port_resuming;
  52. bool needs_double_reset;
  53. enum tegra_usb_phy_port_speed port_speed;
  54. };
  55. /*
  56. * The 1st USB controller contains some UTMI pad registers that are global for
  57. * all the controllers on the chip. Those registers are also cleared when
  58. * reset is asserted to the 1st controller. This means that the 1st controller
  59. * can only be reset when no other controlled has finished probing. So we'll
  60. * reset the 1st controller before doing any other setup on any of the
  61. * controllers, and then never again.
  62. *
  63. * Since this is a PHY issue, the Tegra PHY driver should probably be doing
  64. * the resetting of the USB controllers. But to keep compatibility with old
  65. * device trees that don't have reset phandles in the PHYs, do it here.
  66. * Those old DTs will be vulnerable to total USB breakage if the 1st EHCI
  67. * device isn't the first one to finish probing, so warn them.
  68. */
  69. static int tegra_reset_usb_controller(struct platform_device *pdev)
  70. {
  71. struct device_node *phy_np;
  72. struct usb_hcd *hcd = platform_get_drvdata(pdev);
  73. struct tegra_ehci_hcd *tegra =
  74. (struct tegra_ehci_hcd *)hcd_to_ehci(hcd)->priv;
  75. phy_np = of_parse_phandle(pdev->dev.of_node, "nvidia,phy", 0);
  76. if (!phy_np)
  77. return -ENOENT;
  78. if (!usb1_reset_attempted) {
  79. struct reset_control *usb1_reset;
  80. usb1_reset = of_reset_control_get(phy_np, "utmi-pads");
  81. if (IS_ERR(usb1_reset)) {
  82. dev_warn(&pdev->dev,
  83. "can't get utmi-pads reset from the PHY\n");
  84. dev_warn(&pdev->dev,
  85. "continuing, but please update your DT\n");
  86. } else {
  87. reset_control_assert(usb1_reset);
  88. udelay(1);
  89. reset_control_deassert(usb1_reset);
  90. }
  91. reset_control_put(usb1_reset);
  92. usb1_reset_attempted = true;
  93. }
  94. if (!of_property_read_bool(phy_np, "nvidia,has-utmi-pad-registers")) {
  95. reset_control_assert(tegra->rst);
  96. udelay(1);
  97. reset_control_deassert(tegra->rst);
  98. }
  99. of_node_put(phy_np);
  100. return 0;
  101. }
  102. static int tegra_ehci_internal_port_reset(
  103. struct ehci_hcd *ehci,
  104. u32 __iomem *portsc_reg
  105. )
  106. {
  107. u32 temp;
  108. unsigned long flags;
  109. int retval = 0;
  110. int i, tries;
  111. u32 saved_usbintr;
  112. spin_lock_irqsave(&ehci->lock, flags);
  113. saved_usbintr = ehci_readl(ehci, &ehci->regs->intr_enable);
  114. /* disable USB interrupt */
  115. ehci_writel(ehci, 0, &ehci->regs->intr_enable);
  116. spin_unlock_irqrestore(&ehci->lock, flags);
  117. /*
  118. * Here we have to do Port Reset at most twice for
  119. * Port Enable bit to be set.
  120. */
  121. for (i = 0; i < 2; i++) {
  122. temp = ehci_readl(ehci, portsc_reg);
  123. temp |= PORT_RESET;
  124. ehci_writel(ehci, temp, portsc_reg);
  125. mdelay(10);
  126. temp &= ~PORT_RESET;
  127. ehci_writel(ehci, temp, portsc_reg);
  128. mdelay(1);
  129. tries = 100;
  130. do {
  131. mdelay(1);
  132. /*
  133. * Up to this point, Port Enable bit is
  134. * expected to be set after 2 ms waiting.
  135. * USB1 usually takes extra 45 ms, for safety,
  136. * we take 100 ms as timeout.
  137. */
  138. temp = ehci_readl(ehci, portsc_reg);
  139. } while (!(temp & PORT_PE) && tries--);
  140. if (temp & PORT_PE)
  141. break;
  142. }
  143. if (i == 2)
  144. retval = -ETIMEDOUT;
  145. /*
  146. * Clear Connect Status Change bit if it's set.
  147. * We can't clear PORT_PEC. It will also cause PORT_PE to be cleared.
  148. */
  149. if (temp & PORT_CSC)
  150. ehci_writel(ehci, PORT_CSC, portsc_reg);
  151. /*
  152. * Write to clear any interrupt status bits that might be set
  153. * during port reset.
  154. */
  155. temp = ehci_readl(ehci, &ehci->regs->status);
  156. ehci_writel(ehci, temp, &ehci->regs->status);
  157. /* restore original interrupt enable bits */
  158. ehci_writel(ehci, saved_usbintr, &ehci->regs->intr_enable);
  159. return retval;
  160. }
  161. static int tegra_ehci_hub_control(
  162. struct usb_hcd *hcd,
  163. u16 typeReq,
  164. u16 wValue,
  165. u16 wIndex,
  166. char *buf,
  167. u16 wLength
  168. )
  169. {
  170. struct ehci_hcd *ehci = hcd_to_ehci(hcd);
  171. struct tegra_ehci_hcd *tegra = (struct tegra_ehci_hcd *)ehci->priv;
  172. u32 __iomem *status_reg;
  173. u32 temp;
  174. unsigned long flags;
  175. int retval = 0;
  176. status_reg = &ehci->regs->port_status[(wIndex & 0xff) - 1];
  177. spin_lock_irqsave(&ehci->lock, flags);
  178. if (typeReq == GetPortStatus) {
  179. temp = ehci_readl(ehci, status_reg);
  180. if (tegra->port_resuming && !(temp & PORT_SUSPEND)) {
  181. /* Resume completed, re-enable disconnect detection */
  182. tegra->port_resuming = 0;
  183. tegra_usb_phy_postresume(hcd->usb_phy);
  184. }
  185. }
  186. else if (typeReq == SetPortFeature && wValue == USB_PORT_FEAT_SUSPEND) {
  187. temp = ehci_readl(ehci, status_reg);
  188. if ((temp & PORT_PE) == 0 || (temp & PORT_RESET) != 0) {
  189. retval = -EPIPE;
  190. goto done;
  191. }
  192. temp &= ~(PORT_RWC_BITS | PORT_WKCONN_E);
  193. temp |= PORT_WKDISC_E | PORT_WKOC_E;
  194. ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
  195. /*
  196. * If a transaction is in progress, there may be a delay in
  197. * suspending the port. Poll until the port is suspended.
  198. */
  199. if (ehci_handshake(ehci, status_reg, PORT_SUSPEND,
  200. PORT_SUSPEND, 5000))
  201. pr_err("%s: timeout waiting for SUSPEND\n", __func__);
  202. set_bit((wIndex & 0xff) - 1, &ehci->suspended_ports);
  203. goto done;
  204. }
  205. /* For USB1 port we need to issue Port Reset twice internally */
  206. if (tegra->needs_double_reset &&
  207. (typeReq == SetPortFeature && wValue == USB_PORT_FEAT_RESET)) {
  208. spin_unlock_irqrestore(&ehci->lock, flags);
  209. return tegra_ehci_internal_port_reset(ehci, status_reg);
  210. }
  211. /*
  212. * Tegra host controller will time the resume operation to clear the bit
  213. * when the port control state switches to HS or FS Idle. This behavior
  214. * is different from EHCI where the host controller driver is required
  215. * to set this bit to a zero after the resume duration is timed in the
  216. * driver.
  217. */
  218. else if (typeReq == ClearPortFeature &&
  219. wValue == USB_PORT_FEAT_SUSPEND) {
  220. temp = ehci_readl(ehci, status_reg);
  221. if ((temp & PORT_RESET) || !(temp & PORT_PE)) {
  222. retval = -EPIPE;
  223. goto done;
  224. }
  225. if (!(temp & PORT_SUSPEND))
  226. goto done;
  227. /* Disable disconnect detection during port resume */
  228. tegra_usb_phy_preresume(hcd->usb_phy);
  229. ehci->reset_done[wIndex-1] = jiffies + msecs_to_jiffies(25);
  230. temp &= ~(PORT_RWC_BITS | PORT_WAKE_BITS);
  231. /* start resume signalling */
  232. ehci_writel(ehci, temp | PORT_RESUME, status_reg);
  233. set_bit(wIndex-1, &ehci->resuming_ports);
  234. spin_unlock_irqrestore(&ehci->lock, flags);
  235. msleep(20);
  236. spin_lock_irqsave(&ehci->lock, flags);
  237. /* Poll until the controller clears RESUME and SUSPEND */
  238. if (ehci_handshake(ehci, status_reg, PORT_RESUME, 0, 2000))
  239. pr_err("%s: timeout waiting for RESUME\n", __func__);
  240. if (ehci_handshake(ehci, status_reg, PORT_SUSPEND, 0, 2000))
  241. pr_err("%s: timeout waiting for SUSPEND\n", __func__);
  242. ehci->reset_done[wIndex-1] = 0;
  243. clear_bit(wIndex-1, &ehci->resuming_ports);
  244. tegra->port_resuming = 1;
  245. goto done;
  246. }
  247. spin_unlock_irqrestore(&ehci->lock, flags);
  248. /* Handle the hub control events here */
  249. return ehci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength);
  250. done:
  251. spin_unlock_irqrestore(&ehci->lock, flags);
  252. return retval;
  253. }
  254. struct dma_aligned_buffer {
  255. void *kmalloc_ptr;
  256. void *old_xfer_buffer;
  257. u8 data[0];
  258. };
  259. static void free_dma_aligned_buffer(struct urb *urb)
  260. {
  261. struct dma_aligned_buffer *temp;
  262. size_t length;
  263. if (!(urb->transfer_flags & URB_ALIGNED_TEMP_BUFFER))
  264. return;
  265. temp = container_of(urb->transfer_buffer,
  266. struct dma_aligned_buffer, data);
  267. if (usb_urb_dir_in(urb)) {
  268. if (usb_pipeisoc(urb->pipe))
  269. length = urb->transfer_buffer_length;
  270. else
  271. length = urb->actual_length;
  272. memcpy(temp->old_xfer_buffer, temp->data, length);
  273. }
  274. urb->transfer_buffer = temp->old_xfer_buffer;
  275. kfree(temp->kmalloc_ptr);
  276. urb->transfer_flags &= ~URB_ALIGNED_TEMP_BUFFER;
  277. }
  278. static int alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags)
  279. {
  280. struct dma_aligned_buffer *temp, *kmalloc_ptr;
  281. size_t kmalloc_size;
  282. if (urb->num_sgs || urb->sg ||
  283. urb->transfer_buffer_length == 0 ||
  284. !((uintptr_t)urb->transfer_buffer & (TEGRA_USB_DMA_ALIGN - 1)))
  285. return 0;
  286. /* Allocate a buffer with enough padding for alignment */
  287. kmalloc_size = urb->transfer_buffer_length +
  288. sizeof(struct dma_aligned_buffer) + TEGRA_USB_DMA_ALIGN - 1;
  289. kmalloc_ptr = kmalloc(kmalloc_size, mem_flags);
  290. if (!kmalloc_ptr)
  291. return -ENOMEM;
  292. /* Position our struct dma_aligned_buffer such that data is aligned */
  293. temp = PTR_ALIGN(kmalloc_ptr + 1, TEGRA_USB_DMA_ALIGN) - 1;
  294. temp->kmalloc_ptr = kmalloc_ptr;
  295. temp->old_xfer_buffer = urb->transfer_buffer;
  296. if (usb_urb_dir_out(urb))
  297. memcpy(temp->data, urb->transfer_buffer,
  298. urb->transfer_buffer_length);
  299. urb->transfer_buffer = temp->data;
  300. urb->transfer_flags |= URB_ALIGNED_TEMP_BUFFER;
  301. return 0;
  302. }
  303. static int tegra_ehci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
  304. gfp_t mem_flags)
  305. {
  306. int ret;
  307. ret = alloc_dma_aligned_buffer(urb, mem_flags);
  308. if (ret)
  309. return ret;
  310. ret = usb_hcd_map_urb_for_dma(hcd, urb, mem_flags);
  311. if (ret)
  312. free_dma_aligned_buffer(urb);
  313. return ret;
  314. }
  315. static void tegra_ehci_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb)
  316. {
  317. usb_hcd_unmap_urb_for_dma(hcd, urb);
  318. free_dma_aligned_buffer(urb);
  319. }
  320. static const struct tegra_ehci_soc_config tegra30_soc_config = {
  321. .has_hostpc = true,
  322. };
  323. static const struct tegra_ehci_soc_config tegra20_soc_config = {
  324. .has_hostpc = false,
  325. };
  326. static const struct of_device_id tegra_ehci_of_match[] = {
  327. { .compatible = "nvidia,tegra30-ehci", .data = &tegra30_soc_config },
  328. { .compatible = "nvidia,tegra20-ehci", .data = &tegra20_soc_config },
  329. { },
  330. };
  331. static int tegra_ehci_probe(struct platform_device *pdev)
  332. {
  333. const struct of_device_id *match;
  334. const struct tegra_ehci_soc_config *soc_config;
  335. struct resource *res;
  336. struct usb_hcd *hcd;
  337. struct ehci_hcd *ehci;
  338. struct tegra_ehci_hcd *tegra;
  339. int err = 0;
  340. int irq;
  341. struct usb_phy *u_phy;
  342. match = of_match_device(tegra_ehci_of_match, &pdev->dev);
  343. if (!match) {
  344. dev_err(&pdev->dev, "Error: No device match found\n");
  345. return -ENODEV;
  346. }
  347. soc_config = match->data;
  348. /* Right now device-tree probed devices don't get dma_mask set.
  349. * Since shared usb code relies on it, set it here for now.
  350. * Once we have dma capability bindings this can go away.
  351. */
  352. err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
  353. if (err)
  354. return err;
  355. hcd = usb_create_hcd(&tegra_ehci_hc_driver, &pdev->dev,
  356. dev_name(&pdev->dev));
  357. if (!hcd) {
  358. dev_err(&pdev->dev, "Unable to create HCD\n");
  359. return -ENOMEM;
  360. }
  361. platform_set_drvdata(pdev, hcd);
  362. ehci = hcd_to_ehci(hcd);
  363. tegra = (struct tegra_ehci_hcd *)ehci->priv;
  364. hcd->has_tt = 1;
  365. tegra->clk = devm_clk_get(&pdev->dev, NULL);
  366. if (IS_ERR(tegra->clk)) {
  367. dev_err(&pdev->dev, "Can't get ehci clock\n");
  368. err = PTR_ERR(tegra->clk);
  369. goto cleanup_hcd_create;
  370. }
  371. tegra->rst = devm_reset_control_get(&pdev->dev, "usb");
  372. if (IS_ERR(tegra->rst)) {
  373. dev_err(&pdev->dev, "Can't get ehci reset\n");
  374. err = PTR_ERR(tegra->rst);
  375. goto cleanup_hcd_create;
  376. }
  377. err = clk_prepare_enable(tegra->clk);
  378. if (err)
  379. goto cleanup_hcd_create;
  380. err = tegra_reset_usb_controller(pdev);
  381. if (err)
  382. goto cleanup_clk_en;
  383. u_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0);
  384. if (IS_ERR(u_phy)) {
  385. err = -EPROBE_DEFER;
  386. goto cleanup_clk_en;
  387. }
  388. hcd->usb_phy = u_phy;
  389. tegra->needs_double_reset = of_property_read_bool(pdev->dev.of_node,
  390. "nvidia,needs-double-reset");
  391. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  392. hcd->regs = devm_ioremap_resource(&pdev->dev, res);
  393. if (IS_ERR(hcd->regs)) {
  394. err = PTR_ERR(hcd->regs);
  395. goto cleanup_clk_en;
  396. }
  397. hcd->rsrc_start = res->start;
  398. hcd->rsrc_len = resource_size(res);
  399. ehci->caps = hcd->regs + 0x100;
  400. ehci->has_hostpc = soc_config->has_hostpc;
  401. err = usb_phy_init(hcd->usb_phy);
  402. if (err) {
  403. dev_err(&pdev->dev, "Failed to initialize phy\n");
  404. goto cleanup_clk_en;
  405. }
  406. u_phy->otg = devm_kzalloc(&pdev->dev, sizeof(struct usb_otg),
  407. GFP_KERNEL);
  408. if (!u_phy->otg) {
  409. err = -ENOMEM;
  410. goto cleanup_phy;
  411. }
  412. u_phy->otg->host = hcd_to_bus(hcd);
  413. err = usb_phy_set_suspend(hcd->usb_phy, 0);
  414. if (err) {
  415. dev_err(&pdev->dev, "Failed to power on the phy\n");
  416. goto cleanup_phy;
  417. }
  418. irq = platform_get_irq(pdev, 0);
  419. if (!irq) {
  420. dev_err(&pdev->dev, "Failed to get IRQ\n");
  421. err = -ENODEV;
  422. goto cleanup_phy;
  423. }
  424. otg_set_host(u_phy->otg, &hcd->self);
  425. err = usb_add_hcd(hcd, irq, IRQF_SHARED);
  426. if (err) {
  427. dev_err(&pdev->dev, "Failed to add USB HCD\n");
  428. goto cleanup_otg_set_host;
  429. }
  430. device_wakeup_enable(hcd->self.controller);
  431. return err;
  432. cleanup_otg_set_host:
  433. otg_set_host(u_phy->otg, NULL);
  434. cleanup_phy:
  435. usb_phy_shutdown(hcd->usb_phy);
  436. cleanup_clk_en:
  437. clk_disable_unprepare(tegra->clk);
  438. cleanup_hcd_create:
  439. usb_put_hcd(hcd);
  440. return err;
  441. }
  442. static int tegra_ehci_remove(struct platform_device *pdev)
  443. {
  444. struct usb_hcd *hcd = platform_get_drvdata(pdev);
  445. struct tegra_ehci_hcd *tegra =
  446. (struct tegra_ehci_hcd *)hcd_to_ehci(hcd)->priv;
  447. otg_set_host(hcd->usb_phy->otg, NULL);
  448. usb_phy_shutdown(hcd->usb_phy);
  449. usb_remove_hcd(hcd);
  450. clk_disable_unprepare(tegra->clk);
  451. usb_put_hcd(hcd);
  452. return 0;
  453. }
  454. static void tegra_ehci_hcd_shutdown(struct platform_device *pdev)
  455. {
  456. struct usb_hcd *hcd = platform_get_drvdata(pdev);
  457. if (hcd->driver->shutdown)
  458. hcd->driver->shutdown(hcd);
  459. }
  460. static struct platform_driver tegra_ehci_driver = {
  461. .probe = tegra_ehci_probe,
  462. .remove = tegra_ehci_remove,
  463. .shutdown = tegra_ehci_hcd_shutdown,
  464. .driver = {
  465. .name = DRV_NAME,
  466. .of_match_table = tegra_ehci_of_match,
  467. }
  468. };
  469. static int tegra_ehci_reset(struct usb_hcd *hcd)
  470. {
  471. struct ehci_hcd *ehci = hcd_to_ehci(hcd);
  472. int retval;
  473. int txfifothresh;
  474. retval = ehci_setup(hcd);
  475. if (retval)
  476. return retval;
  477. /*
  478. * We should really pull this value out of tegra_ehci_soc_config, but
  479. * to avoid needing access to it, make use of the fact that Tegra20 is
  480. * the only one so far that needs a value of 10, and Tegra20 is the
  481. * only one which doesn't set has_hostpc.
  482. */
  483. txfifothresh = ehci->has_hostpc ? 0x10 : 10;
  484. ehci_writel(ehci, txfifothresh << 16, &ehci->regs->txfill_tuning);
  485. return 0;
  486. }
  487. static const struct ehci_driver_overrides tegra_overrides __initconst = {
  488. .extra_priv_size = sizeof(struct tegra_ehci_hcd),
  489. .reset = tegra_ehci_reset,
  490. };
  491. static int __init ehci_tegra_init(void)
  492. {
  493. if (usb_disabled())
  494. return -ENODEV;
  495. pr_info(DRV_NAME ": " DRIVER_DESC "\n");
  496. ehci_init_driver(&tegra_ehci_hc_driver, &tegra_overrides);
  497. /*
  498. * The Tegra HW has some unusual quirks, which require Tegra-specific
  499. * workarounds. We override certain hc_driver functions here to
  500. * achieve that. We explicitly do not enhance ehci_driver_overrides to
  501. * allow this more easily, since this is an unusual case, and we don't
  502. * want to encourage others to override these functions by making it
  503. * too easy.
  504. */
  505. tegra_ehci_hc_driver.map_urb_for_dma = tegra_ehci_map_urb_for_dma;
  506. tegra_ehci_hc_driver.unmap_urb_for_dma = tegra_ehci_unmap_urb_for_dma;
  507. tegra_ehci_hc_driver.hub_control = tegra_ehci_hub_control;
  508. return platform_driver_register(&tegra_ehci_driver);
  509. }
  510. module_init(ehci_tegra_init);
  511. static void __exit ehci_tegra_cleanup(void)
  512. {
  513. platform_driver_unregister(&tegra_ehci_driver);
  514. }
  515. module_exit(ehci_tegra_cleanup);
  516. MODULE_DESCRIPTION(DRIVER_DESC);
  517. MODULE_LICENSE("GPL");
  518. MODULE_ALIAS("platform:" DRV_NAME);
  519. MODULE_DEVICE_TABLE(of, tegra_ehci_of_match);