spi-mpc512x-psc.c 16 KB

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