spi-mpc512x-psc.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. /*
  2. * MPC512x PSC in SPI mode driver.
  3. *
  4. * Copyright (C) 2007,2008 Freescale Semiconductor Inc.
  5. * Original port from 52xx driver:
  6. * Hongjun Chen <hong-jun.chen@freescale.com>
  7. *
  8. * Fork of mpc52xx_psc_spi.c:
  9. * Copyright (C) 2006 TOPTICA Photonics AG., Dragos Carp
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License as published by the
  13. * Free Software Foundation; either version 2 of the License, or (at your
  14. * option) any later version.
  15. */
  16. #include <linux/module.h>
  17. #include <linux/kernel.h>
  18. #include <linux/init.h>
  19. #include <linux/errno.h>
  20. #include <linux/interrupt.h>
  21. #include <linux/of_address.h>
  22. #include <linux/of_irq.h>
  23. #include <linux/of_platform.h>
  24. #include <linux/completion.h>
  25. #include <linux/io.h>
  26. #include <linux/delay.h>
  27. #include <linux/clk.h>
  28. #include <linux/spi/spi.h>
  29. #include <linux/fsl_devices.h>
  30. #include <linux/gpio.h>
  31. #include <asm/mpc52xx_psc.h>
  32. struct mpc512x_psc_spi {
  33. void (*cs_control)(struct spi_device *spi, bool on);
  34. /* driver internal data */
  35. struct mpc52xx_psc __iomem *psc;
  36. struct mpc512x_psc_fifo __iomem *fifo;
  37. unsigned int irq;
  38. u8 bits_per_word;
  39. struct clk *clk_mclk;
  40. u32 mclk_rate;
  41. struct completion txisrdone;
  42. };
  43. /* controller state */
  44. struct mpc512x_psc_spi_cs {
  45. int bits_per_word;
  46. int speed_hz;
  47. };
  48. /* set clock freq, clock ramp, bits per work
  49. * if t is NULL then reset the values to the default values
  50. */
  51. static int mpc512x_psc_spi_transfer_setup(struct spi_device *spi,
  52. struct spi_transfer *t)
  53. {
  54. struct mpc512x_psc_spi_cs *cs = spi->controller_state;
  55. cs->speed_hz = (t && t->speed_hz)
  56. ? t->speed_hz : spi->max_speed_hz;
  57. cs->bits_per_word = (t && t->bits_per_word)
  58. ? t->bits_per_word : spi->bits_per_word;
  59. cs->bits_per_word = ((cs->bits_per_word + 7) / 8) * 8;
  60. return 0;
  61. }
  62. static void mpc512x_psc_spi_activate_cs(struct spi_device *spi)
  63. {
  64. struct mpc512x_psc_spi_cs *cs = spi->controller_state;
  65. struct mpc512x_psc_spi *mps = spi_master_get_devdata(spi->master);
  66. struct mpc52xx_psc __iomem *psc = mps->psc;
  67. u32 sicr;
  68. u32 ccr;
  69. int speed;
  70. u16 bclkdiv;
  71. sicr = in_be32(&psc->sicr);
  72. /* Set clock phase and polarity */
  73. if (spi->mode & SPI_CPHA)
  74. sicr |= 0x00001000;
  75. else
  76. sicr &= ~0x00001000;
  77. if (spi->mode & SPI_CPOL)
  78. sicr |= 0x00002000;
  79. else
  80. sicr &= ~0x00002000;
  81. if (spi->mode & SPI_LSB_FIRST)
  82. sicr |= 0x10000000;
  83. else
  84. sicr &= ~0x10000000;
  85. out_be32(&psc->sicr, sicr);
  86. ccr = in_be32(&psc->ccr);
  87. ccr &= 0xFF000000;
  88. speed = cs->speed_hz;
  89. if (!speed)
  90. speed = 1000000; /* default 1MHz */
  91. bclkdiv = (mps->mclk_rate / speed) - 1;
  92. ccr |= (((bclkdiv & 0xff) << 16) | (((bclkdiv >> 8) & 0xff) << 8));
  93. out_be32(&psc->ccr, ccr);
  94. mps->bits_per_word = cs->bits_per_word;
  95. if (mps->cs_control && gpio_is_valid(spi->cs_gpio))
  96. mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 1 : 0);
  97. }
  98. static void mpc512x_psc_spi_deactivate_cs(struct spi_device *spi)
  99. {
  100. struct mpc512x_psc_spi *mps = spi_master_get_devdata(spi->master);
  101. if (mps->cs_control && gpio_is_valid(spi->cs_gpio))
  102. mps->cs_control(spi, (spi->mode & SPI_CS_HIGH) ? 0 : 1);
  103. }
  104. /* extract and scale size field in txsz or rxsz */
  105. #define MPC512x_PSC_FIFO_SZ(sz) ((sz & 0x7ff) << 2);
  106. #define EOFBYTE 1
  107. static int mpc512x_psc_spi_transfer_rxtx(struct spi_device *spi,
  108. struct spi_transfer *t)
  109. {
  110. struct mpc512x_psc_spi *mps = spi_master_get_devdata(spi->master);
  111. struct mpc512x_psc_fifo __iomem *fifo = mps->fifo;
  112. size_t tx_len = t->len;
  113. size_t rx_len = t->len;
  114. u8 *tx_buf = (u8 *)t->tx_buf;
  115. u8 *rx_buf = (u8 *)t->rx_buf;
  116. if (!tx_buf && !rx_buf && t->len)
  117. return -EINVAL;
  118. while (rx_len || tx_len) {
  119. size_t txcount;
  120. u8 data;
  121. size_t fifosz;
  122. size_t rxcount;
  123. int rxtries;
  124. /*
  125. * send the TX bytes in as large a chunk as possible
  126. * but neither exceed the TX nor the RX FIFOs
  127. */
  128. fifosz = MPC512x_PSC_FIFO_SZ(in_be32(&fifo->txsz));
  129. txcount = min(fifosz, tx_len);
  130. fifosz = MPC512x_PSC_FIFO_SZ(in_be32(&fifo->rxsz));
  131. fifosz -= in_be32(&fifo->rxcnt) + 1;
  132. txcount = min(fifosz, txcount);
  133. if (txcount) {
  134. /* fill the TX FIFO */
  135. while (txcount-- > 0) {
  136. data = tx_buf ? *tx_buf++ : 0;
  137. if (tx_len == EOFBYTE && t->cs_change)
  138. setbits32(&fifo->txcmd,
  139. MPC512x_PSC_FIFO_EOF);
  140. out_8(&fifo->txdata_8, data);
  141. tx_len--;
  142. }
  143. /* have the ISR trigger when the TX FIFO is empty */
  144. reinit_completion(&mps->txisrdone);
  145. out_be32(&fifo->txisr, MPC512x_PSC_FIFO_EMPTY);
  146. out_be32(&fifo->tximr, MPC512x_PSC_FIFO_EMPTY);
  147. wait_for_completion(&mps->txisrdone);
  148. }
  149. /*
  150. * consume as much RX data as the FIFO holds, while we
  151. * iterate over the transfer's TX data length
  152. *
  153. * only insist in draining all the remaining RX bytes
  154. * when the TX bytes were exhausted (that's at the very
  155. * end of this transfer, not when still iterating over
  156. * the transfer's chunks)
  157. */
  158. rxtries = 50;
  159. do {
  160. /*
  161. * grab whatever was in the FIFO when we started
  162. * looking, don't bother fetching what was added to
  163. * the FIFO while we read from it -- we'll return
  164. * here eventually and prefer sending out remaining
  165. * TX data
  166. */
  167. fifosz = in_be32(&fifo->rxcnt);
  168. rxcount = min(fifosz, rx_len);
  169. while (rxcount-- > 0) {
  170. data = in_8(&fifo->rxdata_8);
  171. if (rx_buf)
  172. *rx_buf++ = data;
  173. rx_len--;
  174. }
  175. /*
  176. * come back later if there still is TX data to send,
  177. * bail out of the RX drain loop if all of the TX data
  178. * was sent and all of the RX data was received (i.e.
  179. * when the transmission has completed)
  180. */
  181. if (tx_len)
  182. break;
  183. if (!rx_len)
  184. break;
  185. /*
  186. * TX data transmission has completed while RX data
  187. * is still pending -- that's a transient situation
  188. * which depends on wire speed and specific
  189. * hardware implementation details (buffering) yet
  190. * should resolve very quickly
  191. *
  192. * just yield for a moment to not hog the CPU for
  193. * too long when running SPI at low speed
  194. *
  195. * the timeout range is rather arbitrary and tries
  196. * to balance throughput against system load; the
  197. * chosen values result in a minimal timeout of 50
  198. * times 10us and thus work at speeds as low as
  199. * some 20kbps, while the maximum timeout at the
  200. * transfer's end could be 5ms _if_ nothing else
  201. * ticks in the system _and_ RX data still wasn't
  202. * received, which only occurs in situations that
  203. * are exceptional; removing the unpredictability
  204. * of the timeout either decreases throughput
  205. * (longer timeouts), or puts more load on the
  206. * system (fixed short timeouts) or requires the
  207. * use of a timeout API instead of a counter and an
  208. * unknown inner delay
  209. */
  210. usleep_range(10, 100);
  211. } while (--rxtries > 0);
  212. if (!tx_len && rx_len && !rxtries) {
  213. /*
  214. * not enough RX bytes even after several retries
  215. * and the resulting rather long timeout?
  216. */
  217. rxcount = in_be32(&fifo->rxcnt);
  218. dev_warn(&spi->dev,
  219. "short xfer, missing %zd RX bytes, FIFO level %zd\n",
  220. rx_len, rxcount);
  221. }
  222. /*
  223. * drain and drop RX data which "should not be there" in
  224. * the first place, for undisturbed transmission this turns
  225. * into a NOP (except for the FIFO level fetch)
  226. */
  227. if (!tx_len && !rx_len) {
  228. while (in_be32(&fifo->rxcnt))
  229. in_8(&fifo->rxdata_8);
  230. }
  231. }
  232. return 0;
  233. }
  234. static int mpc512x_psc_spi_msg_xfer(struct spi_master *master,
  235. struct spi_message *m)
  236. {
  237. struct spi_device *spi;
  238. unsigned cs_change;
  239. int status;
  240. struct spi_transfer *t;
  241. spi = m->spi;
  242. cs_change = 1;
  243. status = 0;
  244. list_for_each_entry(t, &m->transfers, transfer_list) {
  245. if (t->bits_per_word || t->speed_hz) {
  246. status = mpc512x_psc_spi_transfer_setup(spi, t);
  247. if (status < 0)
  248. break;
  249. }
  250. if (cs_change)
  251. mpc512x_psc_spi_activate_cs(spi);
  252. cs_change = t->cs_change;
  253. status = mpc512x_psc_spi_transfer_rxtx(spi, t);
  254. if (status)
  255. break;
  256. m->actual_length += t->len;
  257. if (t->delay_usecs)
  258. udelay(t->delay_usecs);
  259. if (cs_change)
  260. mpc512x_psc_spi_deactivate_cs(spi);
  261. }
  262. m->status = status;
  263. m->complete(m->context);
  264. if (status || !cs_change)
  265. mpc512x_psc_spi_deactivate_cs(spi);
  266. mpc512x_psc_spi_transfer_setup(spi, NULL);
  267. spi_finalize_current_message(master);
  268. return status;
  269. }
  270. static int mpc512x_psc_spi_prep_xfer_hw(struct spi_master *master)
  271. {
  272. struct mpc512x_psc_spi *mps = spi_master_get_devdata(master);
  273. struct mpc52xx_psc __iomem *psc = mps->psc;
  274. dev_dbg(&master->dev, "%s()\n", __func__);
  275. /* Zero MR2 */
  276. in_8(&psc->mode);
  277. out_8(&psc->mode, 0x0);
  278. /* enable transmitter/receiver */
  279. out_8(&psc->command, MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE);
  280. return 0;
  281. }
  282. static int mpc512x_psc_spi_unprep_xfer_hw(struct spi_master *master)
  283. {
  284. struct mpc512x_psc_spi *mps = spi_master_get_devdata(master);
  285. struct mpc52xx_psc __iomem *psc = mps->psc;
  286. struct mpc512x_psc_fifo __iomem *fifo = mps->fifo;
  287. dev_dbg(&master->dev, "%s()\n", __func__);
  288. /* disable transmitter/receiver and fifo interrupt */
  289. out_8(&psc->command, MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE);
  290. out_be32(&fifo->tximr, 0);
  291. return 0;
  292. }
  293. static int mpc512x_psc_spi_setup(struct spi_device *spi)
  294. {
  295. struct mpc512x_psc_spi_cs *cs = spi->controller_state;
  296. int ret;
  297. if (spi->bits_per_word % 8)
  298. return -EINVAL;
  299. if (!cs) {
  300. cs = kzalloc(sizeof *cs, GFP_KERNEL);
  301. if (!cs)
  302. return -ENOMEM;
  303. if (gpio_is_valid(spi->cs_gpio)) {
  304. ret = gpio_request(spi->cs_gpio, dev_name(&spi->dev));
  305. if (ret) {
  306. dev_err(&spi->dev, "can't get CS gpio: %d\n",
  307. ret);
  308. kfree(cs);
  309. return ret;
  310. }
  311. gpio_direction_output(spi->cs_gpio,
  312. spi->mode & SPI_CS_HIGH ? 0 : 1);
  313. }
  314. spi->controller_state = cs;
  315. }
  316. cs->bits_per_word = spi->bits_per_word;
  317. cs->speed_hz = spi->max_speed_hz;
  318. return 0;
  319. }
  320. static void mpc512x_psc_spi_cleanup(struct spi_device *spi)
  321. {
  322. if (gpio_is_valid(spi->cs_gpio))
  323. gpio_free(spi->cs_gpio);
  324. kfree(spi->controller_state);
  325. }
  326. static int mpc512x_psc_spi_port_config(struct spi_master *master,
  327. struct mpc512x_psc_spi *mps)
  328. {
  329. struct mpc52xx_psc __iomem *psc = mps->psc;
  330. struct mpc512x_psc_fifo __iomem *fifo = mps->fifo;
  331. u32 sicr;
  332. u32 ccr;
  333. int speed;
  334. u16 bclkdiv;
  335. /* Reset the PSC into a known state */
  336. out_8(&psc->command, MPC52xx_PSC_RST_RX);
  337. out_8(&psc->command, MPC52xx_PSC_RST_TX);
  338. out_8(&psc->command, MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE);
  339. /* Disable psc interrupts all useful interrupts are in fifo */
  340. out_be16(&psc->isr_imr.imr, 0);
  341. /* Disable fifo interrupts, will be enabled later */
  342. out_be32(&fifo->tximr, 0);
  343. out_be32(&fifo->rximr, 0);
  344. /* Setup fifo slice address and size */
  345. /*out_be32(&fifo->txsz, 0x0fe00004);*/
  346. /*out_be32(&fifo->rxsz, 0x0ff00004);*/
  347. sicr = 0x01000000 | /* SIM = 0001 -- 8 bit */
  348. 0x00800000 | /* GenClk = 1 -- internal clk */
  349. 0x00008000 | /* SPI = 1 */
  350. 0x00004000 | /* MSTR = 1 -- SPI master */
  351. 0x00000800; /* UseEOF = 1 -- SS low until EOF */
  352. out_be32(&psc->sicr, sicr);
  353. ccr = in_be32(&psc->ccr);
  354. ccr &= 0xFF000000;
  355. speed = 1000000; /* default 1MHz */
  356. bclkdiv = (mps->mclk_rate / speed) - 1;
  357. ccr |= (((bclkdiv & 0xff) << 16) | (((bclkdiv >> 8) & 0xff) << 8));
  358. out_be32(&psc->ccr, ccr);
  359. /* Set 2ms DTL delay */
  360. out_8(&psc->ctur, 0x00);
  361. out_8(&psc->ctlr, 0x82);
  362. /* we don't use the alarms */
  363. out_be32(&fifo->rxalarm, 0xfff);
  364. out_be32(&fifo->txalarm, 0);
  365. /* Enable FIFO slices for Rx/Tx */
  366. out_be32(&fifo->rxcmd,
  367. MPC512x_PSC_FIFO_ENABLE_SLICE | MPC512x_PSC_FIFO_ENABLE_DMA);
  368. out_be32(&fifo->txcmd,
  369. MPC512x_PSC_FIFO_ENABLE_SLICE | MPC512x_PSC_FIFO_ENABLE_DMA);
  370. mps->bits_per_word = 8;
  371. return 0;
  372. }
  373. static irqreturn_t mpc512x_psc_spi_isr(int irq, void *dev_id)
  374. {
  375. struct mpc512x_psc_spi *mps = (struct mpc512x_psc_spi *)dev_id;
  376. struct mpc512x_psc_fifo __iomem *fifo = mps->fifo;
  377. /* clear interrupt and wake up the rx/tx routine */
  378. if (in_be32(&fifo->txisr) &
  379. in_be32(&fifo->tximr) & MPC512x_PSC_FIFO_EMPTY) {
  380. out_be32(&fifo->txisr, MPC512x_PSC_FIFO_EMPTY);
  381. out_be32(&fifo->tximr, 0);
  382. complete(&mps->txisrdone);
  383. return IRQ_HANDLED;
  384. }
  385. return IRQ_NONE;
  386. }
  387. static void mpc512x_spi_cs_control(struct spi_device *spi, bool onoff)
  388. {
  389. gpio_set_value(spi->cs_gpio, onoff);
  390. }
  391. /* bus_num is used only for the case dev->platform_data == NULL */
  392. static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr,
  393. u32 size, unsigned int irq,
  394. s16 bus_num)
  395. {
  396. struct fsl_spi_platform_data *pdata = dev_get_platdata(dev);
  397. struct mpc512x_psc_spi *mps;
  398. struct spi_master *master;
  399. int ret;
  400. void *tempp;
  401. int psc_num;
  402. char clk_name[16];
  403. struct clk *clk;
  404. master = spi_alloc_master(dev, sizeof *mps);
  405. if (master == NULL)
  406. return -ENOMEM;
  407. dev_set_drvdata(dev, master);
  408. mps = spi_master_get_devdata(master);
  409. mps->irq = irq;
  410. if (pdata == NULL) {
  411. mps->cs_control = mpc512x_spi_cs_control;
  412. master->bus_num = bus_num;
  413. } else {
  414. mps->cs_control = pdata->cs_control;
  415. master->bus_num = pdata->bus_num;
  416. master->num_chipselect = pdata->max_chipselect;
  417. }
  418. master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST;
  419. master->setup = mpc512x_psc_spi_setup;
  420. master->prepare_transfer_hardware = mpc512x_psc_spi_prep_xfer_hw;
  421. master->transfer_one_message = mpc512x_psc_spi_msg_xfer;
  422. master->unprepare_transfer_hardware = mpc512x_psc_spi_unprep_xfer_hw;
  423. master->cleanup = mpc512x_psc_spi_cleanup;
  424. master->dev.of_node = dev->of_node;
  425. tempp = ioremap(regaddr, size);
  426. if (!tempp) {
  427. dev_err(dev, "could not ioremap I/O port range\n");
  428. ret = -EFAULT;
  429. goto free_master;
  430. }
  431. mps->psc = tempp;
  432. mps->fifo =
  433. (struct mpc512x_psc_fifo *)(tempp + sizeof(struct mpc52xx_psc));
  434. ret = request_irq(mps->irq, mpc512x_psc_spi_isr, IRQF_SHARED,
  435. "mpc512x-psc-spi", mps);
  436. if (ret)
  437. goto free_master;
  438. init_completion(&mps->txisrdone);
  439. psc_num = master->bus_num;
  440. snprintf(clk_name, sizeof(clk_name), "psc%d_mclk", psc_num);
  441. clk = devm_clk_get(dev, clk_name);
  442. if (IS_ERR(clk)) {
  443. ret = PTR_ERR(clk);
  444. goto free_irq;
  445. }
  446. ret = clk_prepare_enable(clk);
  447. if (ret)
  448. goto free_irq;
  449. mps->clk_mclk = clk;
  450. mps->mclk_rate = clk_get_rate(clk);
  451. ret = mpc512x_psc_spi_port_config(master, mps);
  452. if (ret < 0)
  453. goto free_clock;
  454. ret = devm_spi_register_master(dev, master);
  455. if (ret < 0)
  456. goto free_clock;
  457. return ret;
  458. free_clock:
  459. clk_disable_unprepare(mps->clk_mclk);
  460. free_irq:
  461. free_irq(mps->irq, mps);
  462. free_master:
  463. if (mps->psc)
  464. iounmap(mps->psc);
  465. spi_master_put(master);
  466. return ret;
  467. }
  468. static int mpc512x_psc_spi_do_remove(struct device *dev)
  469. {
  470. struct spi_master *master = dev_get_drvdata(dev);
  471. struct mpc512x_psc_spi *mps = spi_master_get_devdata(master);
  472. clk_disable_unprepare(mps->clk_mclk);
  473. free_irq(mps->irq, mps);
  474. if (mps->psc)
  475. iounmap(mps->psc);
  476. return 0;
  477. }
  478. static int mpc512x_psc_spi_of_probe(struct platform_device *op)
  479. {
  480. const u32 *regaddr_p;
  481. u64 regaddr64, size64;
  482. s16 id = -1;
  483. regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL);
  484. if (!regaddr_p) {
  485. dev_err(&op->dev, "Invalid PSC address\n");
  486. return -EINVAL;
  487. }
  488. regaddr64 = of_translate_address(op->dev.of_node, regaddr_p);
  489. /* get PSC id (0..11, used by port_config) */
  490. id = of_alias_get_id(op->dev.of_node, "spi");
  491. if (id < 0) {
  492. dev_err(&op->dev, "no alias id for %s\n",
  493. op->dev.of_node->full_name);
  494. return id;
  495. }
  496. return mpc512x_psc_spi_do_probe(&op->dev, (u32) regaddr64, (u32) size64,
  497. irq_of_parse_and_map(op->dev.of_node, 0), id);
  498. }
  499. static int mpc512x_psc_spi_of_remove(struct platform_device *op)
  500. {
  501. return mpc512x_psc_spi_do_remove(&op->dev);
  502. }
  503. static struct of_device_id mpc512x_psc_spi_of_match[] = {
  504. { .compatible = "fsl,mpc5121-psc-spi", },
  505. {},
  506. };
  507. MODULE_DEVICE_TABLE(of, mpc512x_psc_spi_of_match);
  508. static struct platform_driver mpc512x_psc_spi_of_driver = {
  509. .probe = mpc512x_psc_spi_of_probe,
  510. .remove = mpc512x_psc_spi_of_remove,
  511. .driver = {
  512. .name = "mpc512x-psc-spi",
  513. .owner = THIS_MODULE,
  514. .of_match_table = mpc512x_psc_spi_of_match,
  515. },
  516. };
  517. module_platform_driver(mpc512x_psc_spi_of_driver);
  518. MODULE_AUTHOR("John Rigby");
  519. MODULE_DESCRIPTION("MPC512x PSC SPI Driver");
  520. MODULE_LICENSE("GPL");