am35x.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. /*
  2. * Texas Instruments AM35x "glue layer"
  3. *
  4. * Copyright (c) 2010, by Texas Instruments
  5. *
  6. * Based on the DA8xx "glue layer" code.
  7. * Copyright (c) 2008-2009, MontaVista Software, Inc. <source@mvista.com>
  8. *
  9. * This file is part of the Inventra Controller Driver for Linux.
  10. *
  11. * The Inventra Controller Driver for Linux is free software; you
  12. * can redistribute it and/or modify it under the terms of the GNU
  13. * General Public License version 2 as published by the Free Software
  14. * Foundation.
  15. *
  16. * The Inventra Controller Driver for Linux is distributed in
  17. * the hope that it will be useful, but WITHOUT ANY WARRANTY;
  18. * without even the implied warranty of MERCHANTABILITY or
  19. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  20. * License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with The Inventra Controller Driver for Linux ; if not,
  24. * write to the Free Software Foundation, Inc., 59 Temple Place,
  25. * Suite 330, Boston, MA 02111-1307 USA
  26. *
  27. */
  28. #include <linux/module.h>
  29. #include <linux/clk.h>
  30. #include <linux/err.h>
  31. #include <linux/io.h>
  32. #include <linux/platform_device.h>
  33. #include <linux/dma-mapping.h>
  34. #include <linux/usb/usb_phy_gen_xceiv.h>
  35. #include <linux/platform_data/usb-omap.h>
  36. #include "musb_core.h"
  37. /*
  38. * AM35x specific definitions
  39. */
  40. /* USB 2.0 OTG module registers */
  41. #define USB_REVISION_REG 0x00
  42. #define USB_CTRL_REG 0x04
  43. #define USB_STAT_REG 0x08
  44. #define USB_EMULATION_REG 0x0c
  45. /* 0x10 Reserved */
  46. #define USB_AUTOREQ_REG 0x14
  47. #define USB_SRP_FIX_TIME_REG 0x18
  48. #define USB_TEARDOWN_REG 0x1c
  49. #define EP_INTR_SRC_REG 0x20
  50. #define EP_INTR_SRC_SET_REG 0x24
  51. #define EP_INTR_SRC_CLEAR_REG 0x28
  52. #define EP_INTR_MASK_REG 0x2c
  53. #define EP_INTR_MASK_SET_REG 0x30
  54. #define EP_INTR_MASK_CLEAR_REG 0x34
  55. #define EP_INTR_SRC_MASKED_REG 0x38
  56. #define CORE_INTR_SRC_REG 0x40
  57. #define CORE_INTR_SRC_SET_REG 0x44
  58. #define CORE_INTR_SRC_CLEAR_REG 0x48
  59. #define CORE_INTR_MASK_REG 0x4c
  60. #define CORE_INTR_MASK_SET_REG 0x50
  61. #define CORE_INTR_MASK_CLEAR_REG 0x54
  62. #define CORE_INTR_SRC_MASKED_REG 0x58
  63. /* 0x5c Reserved */
  64. #define USB_END_OF_INTR_REG 0x60
  65. /* Control register bits */
  66. #define AM35X_SOFT_RESET_MASK 1
  67. /* USB interrupt register bits */
  68. #define AM35X_INTR_USB_SHIFT 16
  69. #define AM35X_INTR_USB_MASK (0x1ff << AM35X_INTR_USB_SHIFT)
  70. #define AM35X_INTR_DRVVBUS 0x100
  71. #define AM35X_INTR_RX_SHIFT 16
  72. #define AM35X_INTR_TX_SHIFT 0
  73. #define AM35X_TX_EP_MASK 0xffff /* EP0 + 15 Tx EPs */
  74. #define AM35X_RX_EP_MASK 0xfffe /* 15 Rx EPs */
  75. #define AM35X_TX_INTR_MASK (AM35X_TX_EP_MASK << AM35X_INTR_TX_SHIFT)
  76. #define AM35X_RX_INTR_MASK (AM35X_RX_EP_MASK << AM35X_INTR_RX_SHIFT)
  77. #define USB_MENTOR_CORE_OFFSET 0x400
  78. struct am35x_glue {
  79. struct device *dev;
  80. struct platform_device *musb;
  81. struct clk *phy_clk;
  82. struct clk *clk;
  83. };
  84. /*
  85. * am35x_musb_enable - enable interrupts
  86. */
  87. static void am35x_musb_enable(struct musb *musb)
  88. {
  89. void __iomem *reg_base = musb->ctrl_base;
  90. u32 epmask;
  91. /* Workaround: setup IRQs through both register sets. */
  92. epmask = ((musb->epmask & AM35X_TX_EP_MASK) << AM35X_INTR_TX_SHIFT) |
  93. ((musb->epmask & AM35X_RX_EP_MASK) << AM35X_INTR_RX_SHIFT);
  94. musb_writel(reg_base, EP_INTR_MASK_SET_REG, epmask);
  95. musb_writel(reg_base, CORE_INTR_MASK_SET_REG, AM35X_INTR_USB_MASK);
  96. /* Force the DRVVBUS IRQ so we can start polling for ID change. */
  97. musb_writel(reg_base, CORE_INTR_SRC_SET_REG,
  98. AM35X_INTR_DRVVBUS << AM35X_INTR_USB_SHIFT);
  99. }
  100. /*
  101. * am35x_musb_disable - disable HDRC and flush interrupts
  102. */
  103. static void am35x_musb_disable(struct musb *musb)
  104. {
  105. void __iomem *reg_base = musb->ctrl_base;
  106. musb_writel(reg_base, CORE_INTR_MASK_CLEAR_REG, AM35X_INTR_USB_MASK);
  107. musb_writel(reg_base, EP_INTR_MASK_CLEAR_REG,
  108. AM35X_TX_INTR_MASK | AM35X_RX_INTR_MASK);
  109. musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
  110. musb_writel(reg_base, USB_END_OF_INTR_REG, 0);
  111. }
  112. #define portstate(stmt) stmt
  113. static void am35x_musb_set_vbus(struct musb *musb, int is_on)
  114. {
  115. WARN_ON(is_on && is_peripheral_active(musb));
  116. }
  117. #define POLL_SECONDS 2
  118. static struct timer_list otg_workaround;
  119. static void otg_timer(unsigned long _musb)
  120. {
  121. struct musb *musb = (void *)_musb;
  122. void __iomem *mregs = musb->mregs;
  123. u8 devctl;
  124. unsigned long flags;
  125. /*
  126. * We poll because AM35x's won't expose several OTG-critical
  127. * status change events (from the transceiver) otherwise.
  128. */
  129. devctl = musb_readb(mregs, MUSB_DEVCTL);
  130. dev_dbg(musb->controller, "Poll devctl %02x (%s)\n", devctl,
  131. usb_otg_state_string(musb->xceiv->state));
  132. spin_lock_irqsave(&musb->lock, flags);
  133. switch (musb->xceiv->state) {
  134. case OTG_STATE_A_WAIT_BCON:
  135. devctl &= ~MUSB_DEVCTL_SESSION;
  136. musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
  137. devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
  138. if (devctl & MUSB_DEVCTL_BDEVICE) {
  139. musb->xceiv->state = OTG_STATE_B_IDLE;
  140. MUSB_DEV_MODE(musb);
  141. } else {
  142. musb->xceiv->state = OTG_STATE_A_IDLE;
  143. MUSB_HST_MODE(musb);
  144. }
  145. break;
  146. case OTG_STATE_A_WAIT_VFALL:
  147. musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
  148. musb_writel(musb->ctrl_base, CORE_INTR_SRC_SET_REG,
  149. MUSB_INTR_VBUSERROR << AM35X_INTR_USB_SHIFT);
  150. break;
  151. case OTG_STATE_B_IDLE:
  152. devctl = musb_readb(mregs, MUSB_DEVCTL);
  153. if (devctl & MUSB_DEVCTL_BDEVICE)
  154. mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
  155. else
  156. musb->xceiv->state = OTG_STATE_A_IDLE;
  157. break;
  158. default:
  159. break;
  160. }
  161. spin_unlock_irqrestore(&musb->lock, flags);
  162. }
  163. static void am35x_musb_try_idle(struct musb *musb, unsigned long timeout)
  164. {
  165. static unsigned long last_timer;
  166. if (timeout == 0)
  167. timeout = jiffies + msecs_to_jiffies(3);
  168. /* Never idle if active, or when VBUS timeout is not set as host */
  169. if (musb->is_active || (musb->a_wait_bcon == 0 &&
  170. musb->xceiv->state == OTG_STATE_A_WAIT_BCON)) {
  171. dev_dbg(musb->controller, "%s active, deleting timer\n",
  172. usb_otg_state_string(musb->xceiv->state));
  173. del_timer(&otg_workaround);
  174. last_timer = jiffies;
  175. return;
  176. }
  177. if (time_after(last_timer, timeout) && timer_pending(&otg_workaround)) {
  178. dev_dbg(musb->controller, "Longer idle timer already pending, ignoring...\n");
  179. return;
  180. }
  181. last_timer = timeout;
  182. dev_dbg(musb->controller, "%s inactive, starting idle timer for %u ms\n",
  183. usb_otg_state_string(musb->xceiv->state),
  184. jiffies_to_msecs(timeout - jiffies));
  185. mod_timer(&otg_workaround, timeout);
  186. }
  187. static irqreturn_t am35x_musb_interrupt(int irq, void *hci)
  188. {
  189. struct musb *musb = hci;
  190. void __iomem *reg_base = musb->ctrl_base;
  191. struct device *dev = musb->controller;
  192. struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
  193. struct omap_musb_board_data *data = plat->board_data;
  194. struct usb_otg *otg = musb->xceiv->otg;
  195. unsigned long flags;
  196. irqreturn_t ret = IRQ_NONE;
  197. u32 epintr, usbintr;
  198. spin_lock_irqsave(&musb->lock, flags);
  199. /* Get endpoint interrupts */
  200. epintr = musb_readl(reg_base, EP_INTR_SRC_MASKED_REG);
  201. if (epintr) {
  202. musb_writel(reg_base, EP_INTR_SRC_CLEAR_REG, epintr);
  203. musb->int_rx =
  204. (epintr & AM35X_RX_INTR_MASK) >> AM35X_INTR_RX_SHIFT;
  205. musb->int_tx =
  206. (epintr & AM35X_TX_INTR_MASK) >> AM35X_INTR_TX_SHIFT;
  207. }
  208. /* Get usb core interrupts */
  209. usbintr = musb_readl(reg_base, CORE_INTR_SRC_MASKED_REG);
  210. if (!usbintr && !epintr)
  211. goto eoi;
  212. if (usbintr) {
  213. musb_writel(reg_base, CORE_INTR_SRC_CLEAR_REG, usbintr);
  214. musb->int_usb =
  215. (usbintr & AM35X_INTR_USB_MASK) >> AM35X_INTR_USB_SHIFT;
  216. }
  217. /*
  218. * DRVVBUS IRQs are the only proxy we have (a very poor one!) for
  219. * AM35x's missing ID change IRQ. We need an ID change IRQ to
  220. * switch appropriately between halves of the OTG state machine.
  221. * Managing DEVCTL.SESSION per Mentor docs requires that we know its
  222. * value but DEVCTL.BDEVICE is invalid without DEVCTL.SESSION set.
  223. * Also, DRVVBUS pulses for SRP (but not at 5V) ...
  224. */
  225. if (usbintr & (AM35X_INTR_DRVVBUS << AM35X_INTR_USB_SHIFT)) {
  226. int drvvbus = musb_readl(reg_base, USB_STAT_REG);
  227. void __iomem *mregs = musb->mregs;
  228. u8 devctl = musb_readb(mregs, MUSB_DEVCTL);
  229. int err;
  230. err = musb->int_usb & MUSB_INTR_VBUSERROR;
  231. if (err) {
  232. /*
  233. * The Mentor core doesn't debounce VBUS as needed
  234. * to cope with device connect current spikes. This
  235. * means it's not uncommon for bus-powered devices
  236. * to get VBUS errors during enumeration.
  237. *
  238. * This is a workaround, but newer RTL from Mentor
  239. * seems to allow a better one: "re"-starting sessions
  240. * without waiting for VBUS to stop registering in
  241. * devctl.
  242. */
  243. musb->int_usb &= ~MUSB_INTR_VBUSERROR;
  244. musb->xceiv->state = OTG_STATE_A_WAIT_VFALL;
  245. mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
  246. WARNING("VBUS error workaround (delay coming)\n");
  247. } else if (drvvbus) {
  248. MUSB_HST_MODE(musb);
  249. otg->default_a = 1;
  250. musb->xceiv->state = OTG_STATE_A_WAIT_VRISE;
  251. portstate(musb->port1_status |= USB_PORT_STAT_POWER);
  252. del_timer(&otg_workaround);
  253. } else {
  254. musb->is_active = 0;
  255. MUSB_DEV_MODE(musb);
  256. otg->default_a = 0;
  257. musb->xceiv->state = OTG_STATE_B_IDLE;
  258. portstate(musb->port1_status &= ~USB_PORT_STAT_POWER);
  259. }
  260. /* NOTE: this must complete power-on within 100 ms. */
  261. dev_dbg(musb->controller, "VBUS %s (%s)%s, devctl %02x\n",
  262. drvvbus ? "on" : "off",
  263. usb_otg_state_string(musb->xceiv->state),
  264. err ? " ERROR" : "",
  265. devctl);
  266. ret = IRQ_HANDLED;
  267. }
  268. /* Drop spurious RX and TX if device is disconnected */
  269. if (musb->int_usb & MUSB_INTR_DISCONNECT) {
  270. musb->int_tx = 0;
  271. musb->int_rx = 0;
  272. }
  273. if (musb->int_tx || musb->int_rx || musb->int_usb)
  274. ret |= musb_interrupt(musb);
  275. eoi:
  276. /* EOI needs to be written for the IRQ to be re-asserted. */
  277. if (ret == IRQ_HANDLED || epintr || usbintr) {
  278. /* clear level interrupt */
  279. if (data->clear_irq)
  280. data->clear_irq();
  281. /* write EOI */
  282. musb_writel(reg_base, USB_END_OF_INTR_REG, 0);
  283. }
  284. /* Poll for ID change */
  285. if (musb->xceiv->state == OTG_STATE_B_IDLE)
  286. mod_timer(&otg_workaround, jiffies + POLL_SECONDS * HZ);
  287. spin_unlock_irqrestore(&musb->lock, flags);
  288. return ret;
  289. }
  290. static int am35x_musb_set_mode(struct musb *musb, u8 musb_mode)
  291. {
  292. struct device *dev = musb->controller;
  293. struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
  294. struct omap_musb_board_data *data = plat->board_data;
  295. int retval = 0;
  296. if (data->set_mode)
  297. data->set_mode(musb_mode);
  298. else
  299. retval = -EIO;
  300. return retval;
  301. }
  302. static int am35x_musb_init(struct musb *musb)
  303. {
  304. struct device *dev = musb->controller;
  305. struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
  306. struct omap_musb_board_data *data = plat->board_data;
  307. void __iomem *reg_base = musb->ctrl_base;
  308. u32 rev;
  309. musb->mregs += USB_MENTOR_CORE_OFFSET;
  310. /* Returns zero if e.g. not clocked */
  311. rev = musb_readl(reg_base, USB_REVISION_REG);
  312. if (!rev)
  313. return -ENODEV;
  314. usb_nop_xceiv_register();
  315. musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
  316. if (IS_ERR_OR_NULL(musb->xceiv))
  317. return -EPROBE_DEFER;
  318. setup_timer(&otg_workaround, otg_timer, (unsigned long) musb);
  319. /* Reset the musb */
  320. if (data->reset)
  321. data->reset();
  322. /* Reset the controller */
  323. musb_writel(reg_base, USB_CTRL_REG, AM35X_SOFT_RESET_MASK);
  324. /* Start the on-chip PHY and its PLL. */
  325. if (data->set_phy_power)
  326. data->set_phy_power(1);
  327. msleep(5);
  328. musb->isr = am35x_musb_interrupt;
  329. /* clear level interrupt */
  330. if (data->clear_irq)
  331. data->clear_irq();
  332. return 0;
  333. }
  334. static int am35x_musb_exit(struct musb *musb)
  335. {
  336. struct device *dev = musb->controller;
  337. struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
  338. struct omap_musb_board_data *data = plat->board_data;
  339. del_timer_sync(&otg_workaround);
  340. /* Shutdown the on-chip PHY and its PLL. */
  341. if (data->set_phy_power)
  342. data->set_phy_power(0);
  343. usb_put_phy(musb->xceiv);
  344. usb_nop_xceiv_unregister();
  345. return 0;
  346. }
  347. /* AM35x supports only 32bit read operation */
  348. void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
  349. {
  350. void __iomem *fifo = hw_ep->fifo;
  351. u32 val;
  352. int i;
  353. /* Read for 32bit-aligned destination address */
  354. if (likely((0x03 & (unsigned long) dst) == 0) && len >= 4) {
  355. readsl(fifo, dst, len >> 2);
  356. dst += len & ~0x03;
  357. len &= 0x03;
  358. }
  359. /*
  360. * Now read the remaining 1 to 3 byte or complete length if
  361. * unaligned address.
  362. */
  363. if (len > 4) {
  364. for (i = 0; i < (len >> 2); i++) {
  365. *(u32 *) dst = musb_readl(fifo, 0);
  366. dst += 4;
  367. }
  368. len &= 0x03;
  369. }
  370. if (len > 0) {
  371. val = musb_readl(fifo, 0);
  372. memcpy(dst, &val, len);
  373. }
  374. }
  375. static const struct musb_platform_ops am35x_ops = {
  376. .init = am35x_musb_init,
  377. .exit = am35x_musb_exit,
  378. .enable = am35x_musb_enable,
  379. .disable = am35x_musb_disable,
  380. .set_mode = am35x_musb_set_mode,
  381. .try_idle = am35x_musb_try_idle,
  382. .set_vbus = am35x_musb_set_vbus,
  383. };
  384. static const struct platform_device_info am35x_dev_info = {
  385. .name = "musb-hdrc",
  386. .id = PLATFORM_DEVID_AUTO,
  387. .dma_mask = DMA_BIT_MASK(32),
  388. };
  389. static int am35x_probe(struct platform_device *pdev)
  390. {
  391. struct musb_hdrc_platform_data *pdata = dev_get_platdata(&pdev->dev);
  392. struct platform_device *musb;
  393. struct am35x_glue *glue;
  394. struct platform_device_info pinfo;
  395. struct clk *phy_clk;
  396. struct clk *clk;
  397. int ret = -ENOMEM;
  398. glue = kzalloc(sizeof(*glue), GFP_KERNEL);
  399. if (!glue) {
  400. dev_err(&pdev->dev, "failed to allocate glue context\n");
  401. goto err0;
  402. }
  403. phy_clk = clk_get(&pdev->dev, "fck");
  404. if (IS_ERR(phy_clk)) {
  405. dev_err(&pdev->dev, "failed to get PHY clock\n");
  406. ret = PTR_ERR(phy_clk);
  407. goto err3;
  408. }
  409. clk = clk_get(&pdev->dev, "ick");
  410. if (IS_ERR(clk)) {
  411. dev_err(&pdev->dev, "failed to get clock\n");
  412. ret = PTR_ERR(clk);
  413. goto err4;
  414. }
  415. ret = clk_enable(phy_clk);
  416. if (ret) {
  417. dev_err(&pdev->dev, "failed to enable PHY clock\n");
  418. goto err5;
  419. }
  420. ret = clk_enable(clk);
  421. if (ret) {
  422. dev_err(&pdev->dev, "failed to enable clock\n");
  423. goto err6;
  424. }
  425. glue->dev = &pdev->dev;
  426. glue->phy_clk = phy_clk;
  427. glue->clk = clk;
  428. pdata->platform_ops = &am35x_ops;
  429. platform_set_drvdata(pdev, glue);
  430. pinfo = am35x_dev_info;
  431. pinfo.parent = &pdev->dev;
  432. pinfo.res = pdev->resource;
  433. pinfo.num_res = pdev->num_resources;
  434. pinfo.data = pdata;
  435. pinfo.size_data = sizeof(*pdata);
  436. glue->musb = musb = platform_device_register_full(&pinfo);
  437. if (IS_ERR(musb)) {
  438. ret = PTR_ERR(musb);
  439. dev_err(&pdev->dev, "failed to register musb device: %d\n", ret);
  440. goto err7;
  441. }
  442. return 0;
  443. err7:
  444. clk_disable(clk);
  445. err6:
  446. clk_disable(phy_clk);
  447. err5:
  448. clk_put(clk);
  449. err4:
  450. clk_put(phy_clk);
  451. err3:
  452. kfree(glue);
  453. err0:
  454. return ret;
  455. }
  456. static int am35x_remove(struct platform_device *pdev)
  457. {
  458. struct am35x_glue *glue = platform_get_drvdata(pdev);
  459. platform_device_unregister(glue->musb);
  460. clk_disable(glue->clk);
  461. clk_disable(glue->phy_clk);
  462. clk_put(glue->clk);
  463. clk_put(glue->phy_clk);
  464. kfree(glue);
  465. return 0;
  466. }
  467. #ifdef CONFIG_PM
  468. static int am35x_suspend(struct device *dev)
  469. {
  470. struct am35x_glue *glue = dev_get_drvdata(dev);
  471. struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
  472. struct omap_musb_board_data *data = plat->board_data;
  473. /* Shutdown the on-chip PHY and its PLL. */
  474. if (data->set_phy_power)
  475. data->set_phy_power(0);
  476. clk_disable(glue->phy_clk);
  477. clk_disable(glue->clk);
  478. return 0;
  479. }
  480. static int am35x_resume(struct device *dev)
  481. {
  482. struct am35x_glue *glue = dev_get_drvdata(dev);
  483. struct musb_hdrc_platform_data *plat = dev_get_platdata(dev);
  484. struct omap_musb_board_data *data = plat->board_data;
  485. int ret;
  486. /* Start the on-chip PHY and its PLL. */
  487. if (data->set_phy_power)
  488. data->set_phy_power(1);
  489. ret = clk_enable(glue->phy_clk);
  490. if (ret) {
  491. dev_err(dev, "failed to enable PHY clock\n");
  492. return ret;
  493. }
  494. ret = clk_enable(glue->clk);
  495. if (ret) {
  496. dev_err(dev, "failed to enable clock\n");
  497. return ret;
  498. }
  499. return 0;
  500. }
  501. #endif
  502. static SIMPLE_DEV_PM_OPS(am35x_pm_ops, am35x_suspend, am35x_resume);
  503. static struct platform_driver am35x_driver = {
  504. .probe = am35x_probe,
  505. .remove = am35x_remove,
  506. .driver = {
  507. .name = "musb-am35x",
  508. .pm = &am35x_pm_ops,
  509. },
  510. };
  511. MODULE_DESCRIPTION("AM35x MUSB Glue Layer");
  512. MODULE_AUTHOR("Ajay Kumar Gupta <ajay.gupta@ti.com>");
  513. MODULE_LICENSE("GPL v2");
  514. module_platform_driver(am35x_driver);