spi-mxs.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. /*
  2. * Freescale MXS SPI master driver
  3. *
  4. * Copyright 2012 DENX Software Engineering, GmbH.
  5. * Copyright 2012 Freescale Semiconductor, Inc.
  6. * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
  7. *
  8. * Rework and transition to new API by:
  9. * Marek Vasut <marex@denx.de>
  10. *
  11. * Based on previous attempt by:
  12. * Fabio Estevam <fabio.estevam@freescale.com>
  13. *
  14. * Based on code from U-Boot bootloader by:
  15. * Marek Vasut <marex@denx.de>
  16. *
  17. * Based on spi-stmp.c, which is:
  18. * Author: Dmitry Pervushin <dimka@embeddedalley.com>
  19. *
  20. * This program is free software; you can redistribute it and/or modify
  21. * it under the terms of the GNU General Public License as published by
  22. * the Free Software Foundation; either version 2 of the License, or
  23. * (at your option) any later version.
  24. *
  25. * This program is distributed in the hope that it will be useful,
  26. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  27. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  28. * GNU General Public License for more details.
  29. */
  30. #include <linux/kernel.h>
  31. #include <linux/init.h>
  32. #include <linux/ioport.h>
  33. #include <linux/of.h>
  34. #include <linux/of_device.h>
  35. #include <linux/of_gpio.h>
  36. #include <linux/platform_device.h>
  37. #include <linux/delay.h>
  38. #include <linux/interrupt.h>
  39. #include <linux/dma-mapping.h>
  40. #include <linux/dmaengine.h>
  41. #include <linux/highmem.h>
  42. #include <linux/clk.h>
  43. #include <linux/err.h>
  44. #include <linux/completion.h>
  45. #include <linux/gpio.h>
  46. #include <linux/regulator/consumer.h>
  47. #include <linux/module.h>
  48. #include <linux/pinctrl/consumer.h>
  49. #include <linux/stmp_device.h>
  50. #include <linux/spi/spi.h>
  51. #include <linux/spi/mxs-spi.h>
  52. #define DRIVER_NAME "mxs-spi"
  53. #define SSP_TIMEOUT 1000 /* 1000 ms */
  54. #define SG_NUM 4
  55. #define SG_MAXLEN 0xff00
  56. struct mxs_spi {
  57. struct mxs_ssp ssp;
  58. struct completion c;
  59. };
  60. static int mxs_spi_setup_transfer(struct spi_device *dev,
  61. struct spi_transfer *t)
  62. {
  63. struct mxs_spi *spi = spi_master_get_devdata(dev->master);
  64. struct mxs_ssp *ssp = &spi->ssp;
  65. uint8_t bits_per_word;
  66. uint32_t hz = 0;
  67. bits_per_word = dev->bits_per_word;
  68. if (t && t->bits_per_word)
  69. bits_per_word = t->bits_per_word;
  70. if (bits_per_word != 8) {
  71. dev_err(&dev->dev, "%s, unsupported bits_per_word=%d\n",
  72. __func__, bits_per_word);
  73. return -EINVAL;
  74. }
  75. hz = dev->max_speed_hz;
  76. if (t && t->speed_hz)
  77. hz = min(hz, t->speed_hz);
  78. if (hz == 0) {
  79. dev_err(&dev->dev, "Cannot continue with zero clock\n");
  80. return -EINVAL;
  81. }
  82. mxs_ssp_set_clk_rate(ssp, hz);
  83. writel(BF_SSP_CTRL1_SSP_MODE(BV_SSP_CTRL1_SSP_MODE__SPI) |
  84. BF_SSP_CTRL1_WORD_LENGTH
  85. (BV_SSP_CTRL1_WORD_LENGTH__EIGHT_BITS) |
  86. ((dev->mode & SPI_CPOL) ? BM_SSP_CTRL1_POLARITY : 0) |
  87. ((dev->mode & SPI_CPHA) ? BM_SSP_CTRL1_PHASE : 0),
  88. ssp->base + HW_SSP_CTRL1(ssp));
  89. writel(0x0, ssp->base + HW_SSP_CMD0);
  90. writel(0x0, ssp->base + HW_SSP_CMD1);
  91. return 0;
  92. }
  93. static int mxs_spi_setup(struct spi_device *dev)
  94. {
  95. int err = 0;
  96. if (!dev->bits_per_word)
  97. dev->bits_per_word = 8;
  98. if (dev->mode & ~(SPI_CPOL | SPI_CPHA))
  99. return -EINVAL;
  100. err = mxs_spi_setup_transfer(dev, NULL);
  101. if (err) {
  102. dev_err(&dev->dev,
  103. "Failed to setup transfer, error = %d\n", err);
  104. }
  105. return err;
  106. }
  107. static uint32_t mxs_spi_cs_to_reg(unsigned cs)
  108. {
  109. uint32_t select = 0;
  110. /*
  111. * i.MX28 Datasheet: 17.10.1: HW_SSP_CTRL0
  112. *
  113. * The bits BM_SSP_CTRL0_WAIT_FOR_CMD and BM_SSP_CTRL0_WAIT_FOR_IRQ
  114. * in HW_SSP_CTRL0 register do have multiple usage, please refer to
  115. * the datasheet for further details. In SPI mode, they are used to
  116. * toggle the chip-select lines (nCS pins).
  117. */
  118. if (cs & 1)
  119. select |= BM_SSP_CTRL0_WAIT_FOR_CMD;
  120. if (cs & 2)
  121. select |= BM_SSP_CTRL0_WAIT_FOR_IRQ;
  122. return select;
  123. }
  124. static void mxs_spi_set_cs(struct mxs_spi *spi, unsigned cs)
  125. {
  126. const uint32_t mask =
  127. BM_SSP_CTRL0_WAIT_FOR_CMD | BM_SSP_CTRL0_WAIT_FOR_IRQ;
  128. uint32_t select;
  129. struct mxs_ssp *ssp = &spi->ssp;
  130. writel(mask, ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_CLR);
  131. select = mxs_spi_cs_to_reg(cs);
  132. writel(select, ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET);
  133. }
  134. static inline void mxs_spi_enable(struct mxs_spi *spi)
  135. {
  136. struct mxs_ssp *ssp = &spi->ssp;
  137. writel(BM_SSP_CTRL0_LOCK_CS,
  138. ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET);
  139. writel(BM_SSP_CTRL0_IGNORE_CRC,
  140. ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_CLR);
  141. }
  142. static inline void mxs_spi_disable(struct mxs_spi *spi)
  143. {
  144. struct mxs_ssp *ssp = &spi->ssp;
  145. writel(BM_SSP_CTRL0_LOCK_CS,
  146. ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_CLR);
  147. writel(BM_SSP_CTRL0_IGNORE_CRC,
  148. ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET);
  149. }
  150. static int mxs_ssp_wait(struct mxs_spi *spi, int offset, int mask, bool set)
  151. {
  152. unsigned long timeout = jiffies + msecs_to_jiffies(SSP_TIMEOUT);
  153. struct mxs_ssp *ssp = &spi->ssp;
  154. uint32_t reg;
  155. while (1) {
  156. reg = readl_relaxed(ssp->base + offset);
  157. if (set && ((reg & mask) == mask))
  158. break;
  159. if (!set && ((~reg & mask) == mask))
  160. break;
  161. udelay(1);
  162. if (time_after(jiffies, timeout))
  163. return -ETIMEDOUT;
  164. }
  165. return 0;
  166. }
  167. static void mxs_ssp_dma_irq_callback(void *param)
  168. {
  169. struct mxs_spi *spi = param;
  170. complete(&spi->c);
  171. }
  172. static irqreturn_t mxs_ssp_irq_handler(int irq, void *dev_id)
  173. {
  174. struct mxs_ssp *ssp = dev_id;
  175. dev_err(ssp->dev, "%s[%i] CTRL1=%08x STATUS=%08x\n",
  176. __func__, __LINE__,
  177. readl(ssp->base + HW_SSP_CTRL1(ssp)),
  178. readl(ssp->base + HW_SSP_STATUS(ssp)));
  179. return IRQ_HANDLED;
  180. }
  181. static int mxs_spi_txrx_dma(struct mxs_spi *spi, int cs,
  182. unsigned char *buf, int len,
  183. int *first, int *last, int write)
  184. {
  185. struct mxs_ssp *ssp = &spi->ssp;
  186. struct dma_async_tx_descriptor *desc;
  187. struct scatterlist sg[SG_NUM];
  188. int sg_count;
  189. uint32_t pio = BM_SSP_CTRL0_DATA_XFER | mxs_spi_cs_to_reg(cs);
  190. int ret;
  191. if (len > SG_NUM * SG_MAXLEN) {
  192. dev_err(ssp->dev, "Data chunk too big for DMA\n");
  193. return -EINVAL;
  194. }
  195. INIT_COMPLETION(spi->c);
  196. if (*first)
  197. pio |= BM_SSP_CTRL0_LOCK_CS;
  198. if (*last)
  199. pio |= BM_SSP_CTRL0_IGNORE_CRC;
  200. if (!write)
  201. pio |= BM_SSP_CTRL0_READ;
  202. if (ssp->devid == IMX23_SSP)
  203. pio |= len;
  204. else
  205. writel(len, ssp->base + HW_SSP_XFER_SIZE);
  206. /* Queue the PIO register write transfer. */
  207. desc = dmaengine_prep_slave_sg(ssp->dmach,
  208. (struct scatterlist *)&pio,
  209. 1, DMA_TRANS_NONE, 0);
  210. if (!desc) {
  211. dev_err(ssp->dev,
  212. "Failed to get PIO reg. write descriptor.\n");
  213. return -EINVAL;
  214. }
  215. /* Queue the DMA data transfer. */
  216. sg_init_table(sg, (len / SG_MAXLEN) + 1);
  217. sg_count = 0;
  218. while (len) {
  219. sg_set_buf(&sg[sg_count++], buf, min(len, SG_MAXLEN));
  220. len -= min(len, SG_MAXLEN);
  221. buf += min(len, SG_MAXLEN);
  222. }
  223. dma_map_sg(ssp->dev, sg, sg_count,
  224. write ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
  225. desc = dmaengine_prep_slave_sg(ssp->dmach, sg, sg_count,
  226. write ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM,
  227. DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
  228. if (!desc) {
  229. dev_err(ssp->dev,
  230. "Failed to get DMA data write descriptor.\n");
  231. ret = -EINVAL;
  232. goto err;
  233. }
  234. /*
  235. * The last descriptor must have this callback,
  236. * to finish the DMA transaction.
  237. */
  238. desc->callback = mxs_ssp_dma_irq_callback;
  239. desc->callback_param = spi;
  240. /* Start the transfer. */
  241. dmaengine_submit(desc);
  242. dma_async_issue_pending(ssp->dmach);
  243. ret = wait_for_completion_timeout(&spi->c,
  244. msecs_to_jiffies(SSP_TIMEOUT));
  245. if (!ret) {
  246. dev_err(ssp->dev, "DMA transfer timeout\n");
  247. ret = -ETIMEDOUT;
  248. goto err;
  249. }
  250. ret = 0;
  251. err:
  252. for (--sg_count; sg_count >= 0; sg_count--) {
  253. dma_unmap_sg(ssp->dev, &sg[sg_count], 1,
  254. write ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
  255. }
  256. return ret;
  257. }
  258. static int mxs_spi_txrx_pio(struct mxs_spi *spi, int cs,
  259. unsigned char *buf, int len,
  260. int *first, int *last, int write)
  261. {
  262. struct mxs_ssp *ssp = &spi->ssp;
  263. if (*first)
  264. mxs_spi_enable(spi);
  265. mxs_spi_set_cs(spi, cs);
  266. while (len--) {
  267. if (*last && len == 0)
  268. mxs_spi_disable(spi);
  269. if (ssp->devid == IMX23_SSP) {
  270. writel(BM_SSP_CTRL0_XFER_COUNT,
  271. ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_CLR);
  272. writel(1,
  273. ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET);
  274. } else {
  275. writel(1, ssp->base + HW_SSP_XFER_SIZE);
  276. }
  277. if (write)
  278. writel(BM_SSP_CTRL0_READ,
  279. ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_CLR);
  280. else
  281. writel(BM_SSP_CTRL0_READ,
  282. ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET);
  283. writel(BM_SSP_CTRL0_RUN,
  284. ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET);
  285. if (mxs_ssp_wait(spi, HW_SSP_CTRL0, BM_SSP_CTRL0_RUN, 1))
  286. return -ETIMEDOUT;
  287. if (write)
  288. writel(*buf, ssp->base + HW_SSP_DATA(ssp));
  289. writel(BM_SSP_CTRL0_DATA_XFER,
  290. ssp->base + HW_SSP_CTRL0 + STMP_OFFSET_REG_SET);
  291. if (!write) {
  292. if (mxs_ssp_wait(spi, HW_SSP_STATUS(ssp),
  293. BM_SSP_STATUS_FIFO_EMPTY, 0))
  294. return -ETIMEDOUT;
  295. *buf = (readl(ssp->base + HW_SSP_DATA(ssp)) & 0xff);
  296. }
  297. if (mxs_ssp_wait(spi, HW_SSP_CTRL0, BM_SSP_CTRL0_RUN, 0))
  298. return -ETIMEDOUT;
  299. buf++;
  300. }
  301. if (len <= 0)
  302. return 0;
  303. return -ETIMEDOUT;
  304. }
  305. static int mxs_spi_transfer_one(struct spi_master *master,
  306. struct spi_message *m)
  307. {
  308. struct mxs_spi *spi = spi_master_get_devdata(master);
  309. struct mxs_ssp *ssp = &spi->ssp;
  310. int first, last;
  311. struct spi_transfer *t, *tmp_t;
  312. int status = 0;
  313. int cs;
  314. first = last = 0;
  315. cs = m->spi->chip_select;
  316. list_for_each_entry_safe(t, tmp_t, &m->transfers, transfer_list) {
  317. status = mxs_spi_setup_transfer(m->spi, t);
  318. if (status)
  319. break;
  320. if (&t->transfer_list == m->transfers.next)
  321. first = 1;
  322. if (&t->transfer_list == m->transfers.prev)
  323. last = 1;
  324. if ((t->rx_buf && t->tx_buf) || (t->rx_dma && t->tx_dma)) {
  325. dev_err(ssp->dev,
  326. "Cannot send and receive simultaneously\n");
  327. status = -EINVAL;
  328. break;
  329. }
  330. /*
  331. * Small blocks can be transfered via PIO.
  332. * Measured by empiric means:
  333. *
  334. * dd if=/dev/mtdblock0 of=/dev/null bs=1024k count=1
  335. *
  336. * DMA only: 2.164808 seconds, 473.0KB/s
  337. * Combined: 1.676276 seconds, 610.9KB/s
  338. */
  339. if (t->len <= 256) {
  340. writel(BM_SSP_CTRL1_DMA_ENABLE,
  341. ssp->base + HW_SSP_CTRL1(ssp) +
  342. STMP_OFFSET_REG_CLR);
  343. if (t->tx_buf)
  344. status = mxs_spi_txrx_pio(spi, cs,
  345. (void *)t->tx_buf,
  346. t->len, &first, &last, 1);
  347. if (t->rx_buf)
  348. status = mxs_spi_txrx_pio(spi, cs,
  349. t->rx_buf, t->len,
  350. &first, &last, 0);
  351. } else {
  352. writel(BM_SSP_CTRL1_DMA_ENABLE,
  353. ssp->base + HW_SSP_CTRL1(ssp) +
  354. STMP_OFFSET_REG_SET);
  355. if (t->tx_buf)
  356. status = mxs_spi_txrx_dma(spi, cs,
  357. (void *)t->tx_buf, t->len,
  358. &first, &last, 1);
  359. if (t->rx_buf)
  360. status = mxs_spi_txrx_dma(spi, cs,
  361. t->rx_buf, t->len,
  362. &first, &last, 0);
  363. }
  364. m->actual_length += t->len;
  365. if (status) {
  366. stmp_reset_block(ssp->base);
  367. break;
  368. }
  369. first = last = 0;
  370. }
  371. m->status = 0;
  372. spi_finalize_current_message(master);
  373. return status;
  374. }
  375. static bool mxs_ssp_dma_filter(struct dma_chan *chan, void *param)
  376. {
  377. struct mxs_ssp *ssp = param;
  378. if (!mxs_dma_is_apbh(chan))
  379. return false;
  380. if (chan->chan_id != ssp->dma_channel)
  381. return false;
  382. chan->private = &ssp->dma_data;
  383. return true;
  384. }
  385. static const struct of_device_id mxs_spi_dt_ids[] = {
  386. { .compatible = "fsl,imx23-spi", .data = (void *) IMX23_SSP, },
  387. { .compatible = "fsl,imx28-spi", .data = (void *) IMX28_SSP, },
  388. { /* sentinel */ }
  389. };
  390. MODULE_DEVICE_TABLE(of, mxs_spi_dt_ids);
  391. static int __devinit mxs_spi_probe(struct platform_device *pdev)
  392. {
  393. const struct of_device_id *of_id =
  394. of_match_device(mxs_spi_dt_ids, &pdev->dev);
  395. struct device_node *np = pdev->dev.of_node;
  396. struct spi_master *master;
  397. struct mxs_spi *spi;
  398. struct mxs_ssp *ssp;
  399. struct resource *iores, *dmares;
  400. struct pinctrl *pinctrl;
  401. struct clk *clk;
  402. void __iomem *base;
  403. int devid, dma_channel;
  404. int ret = 0, irq_err, irq_dma;
  405. dma_cap_mask_t mask;
  406. iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  407. irq_err = platform_get_irq(pdev, 0);
  408. irq_dma = platform_get_irq(pdev, 1);
  409. if (!iores || irq_err < 0 || irq_dma < 0)
  410. return -EINVAL;
  411. base = devm_request_and_ioremap(&pdev->dev, iores);
  412. if (!base)
  413. return -EADDRNOTAVAIL;
  414. pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
  415. if (IS_ERR(pinctrl))
  416. return PTR_ERR(pinctrl);
  417. clk = devm_clk_get(&pdev->dev, NULL);
  418. if (IS_ERR(clk))
  419. return PTR_ERR(clk);
  420. if (np) {
  421. devid = (enum mxs_ssp_id) of_id->data;
  422. /*
  423. * TODO: This is a temporary solution and should be changed
  424. * to use generic DMA binding later when the helpers get in.
  425. */
  426. ret = of_property_read_u32(np, "fsl,ssp-dma-channel",
  427. &dma_channel);
  428. if (ret) {
  429. dev_err(&pdev->dev,
  430. "Failed to get DMA channel\n");
  431. return -EINVAL;
  432. }
  433. } else {
  434. dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
  435. if (!dmares)
  436. return -EINVAL;
  437. devid = pdev->id_entry->driver_data;
  438. dma_channel = dmares->start;
  439. }
  440. master = spi_alloc_master(&pdev->dev, sizeof(*spi));
  441. if (!master)
  442. return -ENOMEM;
  443. master->transfer_one_message = mxs_spi_transfer_one;
  444. master->setup = mxs_spi_setup;
  445. master->mode_bits = SPI_CPOL | SPI_CPHA;
  446. master->num_chipselect = 3;
  447. master->dev.of_node = np;
  448. master->flags = SPI_MASTER_HALF_DUPLEX;
  449. spi = spi_master_get_devdata(master);
  450. ssp = &spi->ssp;
  451. ssp->dev = &pdev->dev;
  452. ssp->clk = clk;
  453. ssp->base = base;
  454. ssp->devid = devid;
  455. ssp->dma_channel = dma_channel;
  456. init_completion(&spi->c);
  457. ret = devm_request_irq(&pdev->dev, irq_err, mxs_ssp_irq_handler, 0,
  458. DRIVER_NAME, ssp);
  459. if (ret)
  460. goto out_master_free;
  461. dma_cap_zero(mask);
  462. dma_cap_set(DMA_SLAVE, mask);
  463. ssp->dma_data.chan_irq = irq_dma;
  464. ssp->dmach = dma_request_channel(mask, mxs_ssp_dma_filter, ssp);
  465. if (!ssp->dmach) {
  466. dev_err(ssp->dev, "Failed to request DMA\n");
  467. goto out_master_free;
  468. }
  469. /*
  470. * Crank up the clock to 120MHz, this will be further divided onto a
  471. * proper speed.
  472. */
  473. clk_prepare_enable(ssp->clk);
  474. clk_set_rate(ssp->clk, 120 * 1000 * 1000);
  475. ssp->clk_rate = clk_get_rate(ssp->clk) / 1000;
  476. stmp_reset_block(ssp->base);
  477. platform_set_drvdata(pdev, master);
  478. ret = spi_register_master(master);
  479. if (ret) {
  480. dev_err(&pdev->dev, "Cannot register SPI master, %d\n", ret);
  481. goto out_free_dma;
  482. }
  483. return 0;
  484. out_free_dma:
  485. dma_release_channel(ssp->dmach);
  486. clk_disable_unprepare(ssp->clk);
  487. out_master_free:
  488. spi_master_put(master);
  489. return ret;
  490. }
  491. static int __devexit mxs_spi_remove(struct platform_device *pdev)
  492. {
  493. struct spi_master *master;
  494. struct mxs_spi *spi;
  495. struct mxs_ssp *ssp;
  496. master = spi_master_get(platform_get_drvdata(pdev));
  497. spi = spi_master_get_devdata(master);
  498. ssp = &spi->ssp;
  499. spi_unregister_master(master);
  500. dma_release_channel(ssp->dmach);
  501. clk_disable_unprepare(ssp->clk);
  502. spi_master_put(master);
  503. return 0;
  504. }
  505. static struct platform_driver mxs_spi_driver = {
  506. .probe = mxs_spi_probe,
  507. .remove = __devexit_p(mxs_spi_remove),
  508. .driver = {
  509. .name = DRIVER_NAME,
  510. .owner = THIS_MODULE,
  511. .of_match_table = mxs_spi_dt_ids,
  512. },
  513. };
  514. module_platform_driver(mxs_spi_driver);
  515. MODULE_AUTHOR("Marek Vasut <marex@denx.de>");
  516. MODULE_DESCRIPTION("MXS SPI master driver");
  517. MODULE_LICENSE("GPL");
  518. MODULE_ALIAS("platform:mxs-spi");