spi-mpc512x-psc.c 16 KB

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