core.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. /**
  2. * core.c - DesignWare USB3 DRD Controller Core file
  3. *
  4. * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com
  5. *
  6. * Authors: Felipe Balbi <balbi@ti.com>,
  7. * Sebastian Andrzej Siewior <bigeasy@linutronix.de>
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions, and the following disclaimer,
  14. * without modification.
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in the
  17. * documentation and/or other materials provided with the distribution.
  18. * 3. The names of the above-listed copyright holders may not be used
  19. * to endorse or promote products derived from this software without
  20. * specific prior written permission.
  21. *
  22. * ALTERNATIVELY, this software may be distributed under the terms of the
  23. * GNU General Public License ("GPL") version 2, as published by the Free
  24. * Software Foundation.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  27. * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  28. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  29. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  30. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  31. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  32. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  33. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  34. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  35. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  36. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  37. */
  38. #include <linux/module.h>
  39. #include <linux/kernel.h>
  40. #include <linux/slab.h>
  41. #include <linux/spinlock.h>
  42. #include <linux/platform_device.h>
  43. #include <linux/pm_runtime.h>
  44. #include <linux/interrupt.h>
  45. #include <linux/ioport.h>
  46. #include <linux/io.h>
  47. #include <linux/list.h>
  48. #include <linux/delay.h>
  49. #include <linux/dma-mapping.h>
  50. #include <linux/of.h>
  51. #include <linux/usb/otg.h>
  52. #include <linux/usb/ch9.h>
  53. #include <linux/usb/gadget.h>
  54. #include "core.h"
  55. #include "gadget.h"
  56. #include "io.h"
  57. #include "debug.h"
  58. static char *maximum_speed = "super";
  59. module_param(maximum_speed, charp, 0);
  60. MODULE_PARM_DESC(maximum_speed, "Maximum supported speed.");
  61. /* -------------------------------------------------------------------------- */
  62. void dwc3_set_mode(struct dwc3 *dwc, u32 mode)
  63. {
  64. u32 reg;
  65. reg = dwc3_readl(dwc->regs, DWC3_GCTL);
  66. reg &= ~(DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG));
  67. reg |= DWC3_GCTL_PRTCAPDIR(mode);
  68. dwc3_writel(dwc->regs, DWC3_GCTL, reg);
  69. }
  70. /**
  71. * dwc3_core_soft_reset - Issues core soft reset and PHY reset
  72. * @dwc: pointer to our context structure
  73. */
  74. static void dwc3_core_soft_reset(struct dwc3 *dwc)
  75. {
  76. u32 reg;
  77. /* Before Resetting PHY, put Core in Reset */
  78. reg = dwc3_readl(dwc->regs, DWC3_GCTL);
  79. reg |= DWC3_GCTL_CORESOFTRESET;
  80. dwc3_writel(dwc->regs, DWC3_GCTL, reg);
  81. /* Assert USB3 PHY reset */
  82. reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
  83. reg |= DWC3_GUSB3PIPECTL_PHYSOFTRST;
  84. dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg);
  85. /* Assert USB2 PHY reset */
  86. reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
  87. reg |= DWC3_GUSB2PHYCFG_PHYSOFTRST;
  88. dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
  89. usb_phy_init(dwc->usb2_phy);
  90. usb_phy_init(dwc->usb3_phy);
  91. mdelay(100);
  92. /* Clear USB3 PHY reset */
  93. reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
  94. reg &= ~DWC3_GUSB3PIPECTL_PHYSOFTRST;
  95. dwc3_writel(dwc->regs, DWC3_GUSB3PIPECTL(0), reg);
  96. /* Clear USB2 PHY reset */
  97. reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
  98. reg &= ~DWC3_GUSB2PHYCFG_PHYSOFTRST;
  99. dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg);
  100. mdelay(100);
  101. /* After PHYs are stable we can take Core out of reset state */
  102. reg = dwc3_readl(dwc->regs, DWC3_GCTL);
  103. reg &= ~DWC3_GCTL_CORESOFTRESET;
  104. dwc3_writel(dwc->regs, DWC3_GCTL, reg);
  105. }
  106. /**
  107. * dwc3_free_one_event_buffer - Frees one event buffer
  108. * @dwc: Pointer to our controller context structure
  109. * @evt: Pointer to event buffer to be freed
  110. */
  111. static void dwc3_free_one_event_buffer(struct dwc3 *dwc,
  112. struct dwc3_event_buffer *evt)
  113. {
  114. dma_free_coherent(dwc->dev, evt->length, evt->buf, evt->dma);
  115. }
  116. /**
  117. * dwc3_alloc_one_event_buffer - Allocates one event buffer structure
  118. * @dwc: Pointer to our controller context structure
  119. * @length: size of the event buffer
  120. *
  121. * Returns a pointer to the allocated event buffer structure on success
  122. * otherwise ERR_PTR(errno).
  123. */
  124. static struct dwc3_event_buffer *__devinit
  125. dwc3_alloc_one_event_buffer(struct dwc3 *dwc, unsigned length)
  126. {
  127. struct dwc3_event_buffer *evt;
  128. evt = devm_kzalloc(dwc->dev, sizeof(*evt), GFP_KERNEL);
  129. if (!evt)
  130. return ERR_PTR(-ENOMEM);
  131. evt->dwc = dwc;
  132. evt->length = length;
  133. evt->buf = dma_alloc_coherent(dwc->dev, length,
  134. &evt->dma, GFP_KERNEL);
  135. if (!evt->buf) {
  136. kfree(evt);
  137. return ERR_PTR(-ENOMEM);
  138. }
  139. return evt;
  140. }
  141. /**
  142. * dwc3_free_event_buffers - frees all allocated event buffers
  143. * @dwc: Pointer to our controller context structure
  144. */
  145. static void dwc3_free_event_buffers(struct dwc3 *dwc)
  146. {
  147. struct dwc3_event_buffer *evt;
  148. int i;
  149. for (i = 0; i < dwc->num_event_buffers; i++) {
  150. evt = dwc->ev_buffs[i];
  151. if (evt)
  152. dwc3_free_one_event_buffer(dwc, evt);
  153. }
  154. }
  155. /**
  156. * dwc3_alloc_event_buffers - Allocates @num event buffers of size @length
  157. * @dwc: pointer to our controller context structure
  158. * @length: size of event buffer
  159. *
  160. * Returns 0 on success otherwise negative errno. In the error case, dwc
  161. * may contain some buffers allocated but not all which were requested.
  162. */
  163. static int __devinit dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length)
  164. {
  165. int num;
  166. int i;
  167. num = DWC3_NUM_INT(dwc->hwparams.hwparams1);
  168. dwc->num_event_buffers = num;
  169. dwc->ev_buffs = devm_kzalloc(dwc->dev, sizeof(*dwc->ev_buffs) * num,
  170. GFP_KERNEL);
  171. if (!dwc->ev_buffs) {
  172. dev_err(dwc->dev, "can't allocate event buffers array\n");
  173. return -ENOMEM;
  174. }
  175. for (i = 0; i < num; i++) {
  176. struct dwc3_event_buffer *evt;
  177. evt = dwc3_alloc_one_event_buffer(dwc, length);
  178. if (IS_ERR(evt)) {
  179. dev_err(dwc->dev, "can't allocate event buffer\n");
  180. return PTR_ERR(evt);
  181. }
  182. dwc->ev_buffs[i] = evt;
  183. }
  184. return 0;
  185. }
  186. /**
  187. * dwc3_event_buffers_setup - setup our allocated event buffers
  188. * @dwc: pointer to our controller context structure
  189. *
  190. * Returns 0 on success otherwise negative errno.
  191. */
  192. static int dwc3_event_buffers_setup(struct dwc3 *dwc)
  193. {
  194. struct dwc3_event_buffer *evt;
  195. int n;
  196. for (n = 0; n < dwc->num_event_buffers; n++) {
  197. evt = dwc->ev_buffs[n];
  198. dev_dbg(dwc->dev, "Event buf %p dma %08llx length %d\n",
  199. evt->buf, (unsigned long long) evt->dma,
  200. evt->length);
  201. evt->lpos = 0;
  202. dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n),
  203. lower_32_bits(evt->dma));
  204. dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n),
  205. upper_32_bits(evt->dma));
  206. dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(n),
  207. evt->length & 0xffff);
  208. dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(n), 0);
  209. }
  210. return 0;
  211. }
  212. static void dwc3_event_buffers_cleanup(struct dwc3 *dwc)
  213. {
  214. struct dwc3_event_buffer *evt;
  215. int n;
  216. for (n = 0; n < dwc->num_event_buffers; n++) {
  217. evt = dwc->ev_buffs[n];
  218. evt->lpos = 0;
  219. dwc3_writel(dwc->regs, DWC3_GEVNTADRLO(n), 0);
  220. dwc3_writel(dwc->regs, DWC3_GEVNTADRHI(n), 0);
  221. dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(n), 0);
  222. dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(n), 0);
  223. }
  224. }
  225. static void __devinit dwc3_cache_hwparams(struct dwc3 *dwc)
  226. {
  227. struct dwc3_hwparams *parms = &dwc->hwparams;
  228. parms->hwparams0 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS0);
  229. parms->hwparams1 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS1);
  230. parms->hwparams2 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS2);
  231. parms->hwparams3 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS3);
  232. parms->hwparams4 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS4);
  233. parms->hwparams5 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS5);
  234. parms->hwparams6 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS6);
  235. parms->hwparams7 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS7);
  236. parms->hwparams8 = dwc3_readl(dwc->regs, DWC3_GHWPARAMS8);
  237. }
  238. /**
  239. * dwc3_core_init - Low-level initialization of DWC3 Core
  240. * @dwc: Pointer to our controller context structure
  241. *
  242. * Returns 0 on success otherwise negative errno.
  243. */
  244. static int __devinit dwc3_core_init(struct dwc3 *dwc)
  245. {
  246. unsigned long timeout;
  247. u32 reg;
  248. int ret;
  249. reg = dwc3_readl(dwc->regs, DWC3_GSNPSID);
  250. /* This should read as U3 followed by revision number */
  251. if ((reg & DWC3_GSNPSID_MASK) != 0x55330000) {
  252. dev_err(dwc->dev, "this is not a DesignWare USB3 DRD Core\n");
  253. ret = -ENODEV;
  254. goto err0;
  255. }
  256. dwc->revision = reg;
  257. /* issue device SoftReset too */
  258. timeout = jiffies + msecs_to_jiffies(500);
  259. dwc3_writel(dwc->regs, DWC3_DCTL, DWC3_DCTL_CSFTRST);
  260. do {
  261. reg = dwc3_readl(dwc->regs, DWC3_DCTL);
  262. if (!(reg & DWC3_DCTL_CSFTRST))
  263. break;
  264. if (time_after(jiffies, timeout)) {
  265. dev_err(dwc->dev, "Reset Timed Out\n");
  266. ret = -ETIMEDOUT;
  267. goto err0;
  268. }
  269. cpu_relax();
  270. } while (true);
  271. dwc3_core_soft_reset(dwc);
  272. dwc3_cache_hwparams(dwc);
  273. reg = dwc3_readl(dwc->regs, DWC3_GCTL);
  274. reg &= ~DWC3_GCTL_SCALEDOWN_MASK;
  275. reg &= ~DWC3_GCTL_DISSCRAMBLE;
  276. switch (DWC3_GHWPARAMS1_EN_PWROPT(dwc->hwparams.hwparams1)) {
  277. case DWC3_GHWPARAMS1_EN_PWROPT_CLK:
  278. reg &= ~DWC3_GCTL_DSBLCLKGTNG;
  279. break;
  280. default:
  281. dev_dbg(dwc->dev, "No power optimization available\n");
  282. }
  283. /*
  284. * WORKAROUND: DWC3 revisions <1.90a have a bug
  285. * where the device can fail to connect at SuperSpeed
  286. * and falls back to high-speed mode which causes
  287. * the device to enter a Connect/Disconnect loop
  288. */
  289. if (dwc->revision < DWC3_REVISION_190A)
  290. reg |= DWC3_GCTL_U2RSTECN;
  291. dwc3_writel(dwc->regs, DWC3_GCTL, reg);
  292. ret = dwc3_event_buffers_setup(dwc);
  293. if (ret) {
  294. dev_err(dwc->dev, "failed to setup event buffers\n");
  295. goto err0;
  296. }
  297. return 0;
  298. err0:
  299. return ret;
  300. }
  301. static void dwc3_core_exit(struct dwc3 *dwc)
  302. {
  303. dwc3_event_buffers_cleanup(dwc);
  304. }
  305. #define DWC3_ALIGN_MASK (16 - 1)
  306. static int __devinit dwc3_probe(struct platform_device *pdev)
  307. {
  308. struct device_node *node = pdev->dev.of_node;
  309. struct resource *res;
  310. struct dwc3 *dwc;
  311. struct device *dev = &pdev->dev;
  312. int ret = -ENOMEM;
  313. void __iomem *regs;
  314. void *mem;
  315. u8 mode;
  316. mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL);
  317. if (!mem) {
  318. dev_err(dev, "not enough memory\n");
  319. return -ENOMEM;
  320. }
  321. dwc = PTR_ALIGN(mem, DWC3_ALIGN_MASK + 1);
  322. dwc->mem = mem;
  323. res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
  324. if (!res) {
  325. dev_err(dev, "missing IRQ\n");
  326. return -ENODEV;
  327. }
  328. dwc->xhci_resources[1].start = res->start;
  329. dwc->xhci_resources[1].end = res->end;
  330. dwc->xhci_resources[1].flags = res->flags;
  331. dwc->xhci_resources[1].name = res->name;
  332. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  333. if (!res) {
  334. dev_err(dev, "missing memory resource\n");
  335. return -ENODEV;
  336. }
  337. dwc->xhci_resources[0].start = res->start;
  338. dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
  339. DWC3_XHCI_REGS_END;
  340. dwc->xhci_resources[0].flags = res->flags;
  341. dwc->xhci_resources[0].name = res->name;
  342. /*
  343. * Request memory region but exclude xHCI regs,
  344. * since it will be requested by the xhci-plat driver.
  345. */
  346. res = devm_request_mem_region(dev, res->start + DWC3_GLOBALS_REGS_START,
  347. resource_size(res) - DWC3_GLOBALS_REGS_START,
  348. dev_name(dev));
  349. if (!res) {
  350. dev_err(dev, "can't request mem region\n");
  351. return -ENOMEM;
  352. }
  353. regs = devm_ioremap_nocache(dev, res->start, resource_size(res));
  354. if (!regs) {
  355. dev_err(dev, "ioremap failed\n");
  356. return -ENOMEM;
  357. }
  358. dwc->usb2_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
  359. if (IS_ERR_OR_NULL(dwc->usb2_phy)) {
  360. dev_err(dev, "no usb2 phy configured\n");
  361. return -EPROBE_DEFER;
  362. }
  363. dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3);
  364. if (IS_ERR_OR_NULL(dwc->usb3_phy)) {
  365. dev_err(dev, "no usb3 phy configured\n");
  366. return -EPROBE_DEFER;
  367. }
  368. spin_lock_init(&dwc->lock);
  369. platform_set_drvdata(pdev, dwc);
  370. dwc->regs = regs;
  371. dwc->regs_size = resource_size(res);
  372. dwc->dev = dev;
  373. if (!strncmp("super", maximum_speed, 5))
  374. dwc->maximum_speed = DWC3_DCFG_SUPERSPEED;
  375. else if (!strncmp("high", maximum_speed, 4))
  376. dwc->maximum_speed = DWC3_DCFG_HIGHSPEED;
  377. else if (!strncmp("full", maximum_speed, 4))
  378. dwc->maximum_speed = DWC3_DCFG_FULLSPEED1;
  379. else if (!strncmp("low", maximum_speed, 3))
  380. dwc->maximum_speed = DWC3_DCFG_LOWSPEED;
  381. else
  382. dwc->maximum_speed = DWC3_DCFG_SUPERSPEED;
  383. if (of_get_property(node, "tx-fifo-resize", NULL))
  384. dwc->needs_fifo_resize = true;
  385. pm_runtime_enable(dev);
  386. pm_runtime_get_sync(dev);
  387. pm_runtime_forbid(dev);
  388. ret = dwc3_alloc_event_buffers(dwc, DWC3_EVENT_BUFFERS_SIZE);
  389. if (ret) {
  390. dev_err(dwc->dev, "failed to allocate event buffers\n");
  391. ret = -ENOMEM;
  392. goto err0;
  393. }
  394. ret = dwc3_core_init(dwc);
  395. if (ret) {
  396. dev_err(dev, "failed to initialize core\n");
  397. goto err0;
  398. }
  399. mode = DWC3_MODE(dwc->hwparams.hwparams0);
  400. switch (mode) {
  401. case DWC3_MODE_DEVICE:
  402. dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE);
  403. ret = dwc3_gadget_init(dwc);
  404. if (ret) {
  405. dev_err(dev, "failed to initialize gadget\n");
  406. goto err1;
  407. }
  408. break;
  409. case DWC3_MODE_HOST:
  410. dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_HOST);
  411. ret = dwc3_host_init(dwc);
  412. if (ret) {
  413. dev_err(dev, "failed to initialize host\n");
  414. goto err1;
  415. }
  416. break;
  417. case DWC3_MODE_DRD:
  418. dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_OTG);
  419. ret = dwc3_host_init(dwc);
  420. if (ret) {
  421. dev_err(dev, "failed to initialize host\n");
  422. goto err1;
  423. }
  424. ret = dwc3_gadget_init(dwc);
  425. if (ret) {
  426. dev_err(dev, "failed to initialize gadget\n");
  427. goto err1;
  428. }
  429. break;
  430. default:
  431. dev_err(dev, "Unsupported mode of operation %d\n", mode);
  432. goto err1;
  433. }
  434. dwc->mode = mode;
  435. ret = dwc3_debugfs_init(dwc);
  436. if (ret) {
  437. dev_err(dev, "failed to initialize debugfs\n");
  438. goto err2;
  439. }
  440. pm_runtime_allow(dev);
  441. return 0;
  442. err2:
  443. switch (mode) {
  444. case DWC3_MODE_DEVICE:
  445. dwc3_gadget_exit(dwc);
  446. break;
  447. case DWC3_MODE_HOST:
  448. dwc3_host_exit(dwc);
  449. break;
  450. case DWC3_MODE_DRD:
  451. dwc3_host_exit(dwc);
  452. dwc3_gadget_exit(dwc);
  453. break;
  454. default:
  455. /* do nothing */
  456. break;
  457. }
  458. err1:
  459. dwc3_core_exit(dwc);
  460. err0:
  461. dwc3_free_event_buffers(dwc);
  462. return ret;
  463. }
  464. static int __devexit dwc3_remove(struct platform_device *pdev)
  465. {
  466. struct dwc3 *dwc = platform_get_drvdata(pdev);
  467. struct resource *res;
  468. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  469. pm_runtime_put(&pdev->dev);
  470. pm_runtime_disable(&pdev->dev);
  471. dwc3_debugfs_exit(dwc);
  472. switch (dwc->mode) {
  473. case DWC3_MODE_DEVICE:
  474. dwc3_gadget_exit(dwc);
  475. break;
  476. case DWC3_MODE_HOST:
  477. dwc3_host_exit(dwc);
  478. break;
  479. case DWC3_MODE_DRD:
  480. dwc3_host_exit(dwc);
  481. dwc3_gadget_exit(dwc);
  482. break;
  483. default:
  484. /* do nothing */
  485. break;
  486. }
  487. dwc3_core_exit(dwc);
  488. return 0;
  489. }
  490. static struct platform_driver dwc3_driver = {
  491. .probe = dwc3_probe,
  492. .remove = __devexit_p(dwc3_remove),
  493. .driver = {
  494. .name = "dwc3",
  495. },
  496. };
  497. module_platform_driver(dwc3_driver);
  498. MODULE_ALIAS("platform:dwc3");
  499. MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
  500. MODULE_LICENSE("Dual BSD/GPL");
  501. MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");