spi-s3c24xx.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. /*
  2. * Copyright (c) 2006 Ben Dooks
  3. * Copyright 2006-2009 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. */
  11. #include <linux/spinlock.h>
  12. #include <linux/workqueue.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/delay.h>
  15. #include <linux/errno.h>
  16. #include <linux/err.h>
  17. #include <linux/clk.h>
  18. #include <linux/platform_device.h>
  19. #include <linux/gpio.h>
  20. #include <linux/io.h>
  21. #include <linux/slab.h>
  22. #include <linux/spi/spi.h>
  23. #include <linux/spi/spi_bitbang.h>
  24. #include <linux/spi/s3c24xx.h>
  25. #include <linux/module.h>
  26. #include <plat/regs-spi.h>
  27. #include <asm/fiq.h>
  28. #include "spi-s3c24xx-fiq.h"
  29. /**
  30. * s3c24xx_spi_devstate - per device data
  31. * @hz: Last frequency calculated for @sppre field.
  32. * @mode: Last mode setting for the @spcon field.
  33. * @spcon: Value to write to the SPCON register.
  34. * @sppre: Value to write to the SPPRE register.
  35. */
  36. struct s3c24xx_spi_devstate {
  37. unsigned int hz;
  38. unsigned int mode;
  39. u8 spcon;
  40. u8 sppre;
  41. };
  42. enum spi_fiq_mode {
  43. FIQ_MODE_NONE = 0,
  44. FIQ_MODE_TX = 1,
  45. FIQ_MODE_RX = 2,
  46. FIQ_MODE_TXRX = 3,
  47. };
  48. struct s3c24xx_spi {
  49. /* bitbang has to be first */
  50. struct spi_bitbang bitbang;
  51. struct completion done;
  52. void __iomem *regs;
  53. int irq;
  54. int len;
  55. int count;
  56. struct fiq_handler fiq_handler;
  57. enum spi_fiq_mode fiq_mode;
  58. unsigned char fiq_inuse;
  59. unsigned char fiq_claimed;
  60. void (*set_cs)(struct s3c2410_spi_info *spi,
  61. int cs, int pol);
  62. /* data buffers */
  63. const unsigned char *tx;
  64. unsigned char *rx;
  65. struct clk *clk;
  66. struct spi_master *master;
  67. struct spi_device *curdev;
  68. struct device *dev;
  69. struct s3c2410_spi_info *pdata;
  70. };
  71. #define SPCON_DEFAULT (S3C2410_SPCON_MSTR | S3C2410_SPCON_SMOD_INT)
  72. #define SPPIN_DEFAULT (S3C2410_SPPIN_KEEP)
  73. static inline struct s3c24xx_spi *to_hw(struct spi_device *sdev)
  74. {
  75. return spi_master_get_devdata(sdev->master);
  76. }
  77. static void s3c24xx_spi_gpiocs(struct s3c2410_spi_info *spi, int cs, int pol)
  78. {
  79. gpio_set_value(spi->pin_cs, pol);
  80. }
  81. static void s3c24xx_spi_chipsel(struct spi_device *spi, int value)
  82. {
  83. struct s3c24xx_spi_devstate *cs = spi->controller_state;
  84. struct s3c24xx_spi *hw = to_hw(spi);
  85. unsigned int cspol = spi->mode & SPI_CS_HIGH ? 1 : 0;
  86. /* change the chipselect state and the state of the spi engine clock */
  87. switch (value) {
  88. case BITBANG_CS_INACTIVE:
  89. hw->set_cs(hw->pdata, spi->chip_select, cspol^1);
  90. writeb(cs->spcon, hw->regs + S3C2410_SPCON);
  91. break;
  92. case BITBANG_CS_ACTIVE:
  93. writeb(cs->spcon | S3C2410_SPCON_ENSCK,
  94. hw->regs + S3C2410_SPCON);
  95. hw->set_cs(hw->pdata, spi->chip_select, cspol);
  96. break;
  97. }
  98. }
  99. static int s3c24xx_spi_update_state(struct spi_device *spi,
  100. struct spi_transfer *t)
  101. {
  102. struct s3c24xx_spi *hw = to_hw(spi);
  103. struct s3c24xx_spi_devstate *cs = spi->controller_state;
  104. unsigned int hz;
  105. unsigned int div;
  106. unsigned long clk;
  107. hz = t ? t->speed_hz : spi->max_speed_hz;
  108. if (!hz)
  109. hz = spi->max_speed_hz;
  110. if (spi->mode != cs->mode) {
  111. u8 spcon = SPCON_DEFAULT | S3C2410_SPCON_ENSCK;
  112. if (spi->mode & SPI_CPHA)
  113. spcon |= S3C2410_SPCON_CPHA_FMTB;
  114. if (spi->mode & SPI_CPOL)
  115. spcon |= S3C2410_SPCON_CPOL_HIGH;
  116. cs->mode = spi->mode;
  117. cs->spcon = spcon;
  118. }
  119. if (cs->hz != hz) {
  120. clk = clk_get_rate(hw->clk);
  121. div = DIV_ROUND_UP(clk, hz * 2) - 1;
  122. if (div > 255)
  123. div = 255;
  124. dev_dbg(&spi->dev, "pre-scaler=%d (wanted %d, got %ld)\n",
  125. div, hz, clk / (2 * (div + 1)));
  126. cs->hz = hz;
  127. cs->sppre = div;
  128. }
  129. return 0;
  130. }
  131. static int s3c24xx_spi_setupxfer(struct spi_device *spi,
  132. struct spi_transfer *t)
  133. {
  134. struct s3c24xx_spi_devstate *cs = spi->controller_state;
  135. struct s3c24xx_spi *hw = to_hw(spi);
  136. int ret;
  137. ret = s3c24xx_spi_update_state(spi, t);
  138. if (!ret)
  139. writeb(cs->sppre, hw->regs + S3C2410_SPPRE);
  140. return ret;
  141. }
  142. static int s3c24xx_spi_setup(struct spi_device *spi)
  143. {
  144. struct s3c24xx_spi_devstate *cs = spi->controller_state;
  145. struct s3c24xx_spi *hw = to_hw(spi);
  146. int ret;
  147. /* allocate settings on the first call */
  148. if (!cs) {
  149. cs = kzalloc(sizeof(struct s3c24xx_spi_devstate), GFP_KERNEL);
  150. if (!cs) {
  151. dev_err(&spi->dev, "no memory for controller state\n");
  152. return -ENOMEM;
  153. }
  154. cs->spcon = SPCON_DEFAULT;
  155. cs->hz = -1;
  156. spi->controller_state = cs;
  157. }
  158. /* initialise the state from the device */
  159. ret = s3c24xx_spi_update_state(spi, NULL);
  160. if (ret)
  161. return ret;
  162. spin_lock(&hw->bitbang.lock);
  163. if (!hw->bitbang.busy) {
  164. hw->bitbang.chipselect(spi, BITBANG_CS_INACTIVE);
  165. /* need to ndelay for 0.5 clocktick ? */
  166. }
  167. spin_unlock(&hw->bitbang.lock);
  168. return 0;
  169. }
  170. static void s3c24xx_spi_cleanup(struct spi_device *spi)
  171. {
  172. kfree(spi->controller_state);
  173. }
  174. static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count)
  175. {
  176. return hw->tx ? hw->tx[count] : 0;
  177. }
  178. #ifdef CONFIG_SPI_S3C24XX_FIQ
  179. /* Support for FIQ based pseudo-DMA to improve the transfer speed.
  180. *
  181. * This code uses the assembly helper in spi_s3c24xx_spi.S which is
  182. * used by the FIQ core to move data between main memory and the peripheral
  183. * block. Since this is code running on the processor, there is no problem
  184. * with cache coherency of the buffers, so we can use any buffer we like.
  185. */
  186. /**
  187. * struct spi_fiq_code - FIQ code and header
  188. * @length: The length of the code fragment, excluding this header.
  189. * @ack_offset: The offset from @data to the word to place the IRQ ACK bit at.
  190. * @data: The code itself to install as a FIQ handler.
  191. */
  192. struct spi_fiq_code {
  193. u32 length;
  194. u32 ack_offset;
  195. u8 data[0];
  196. };
  197. extern struct spi_fiq_code s3c24xx_spi_fiq_txrx;
  198. extern struct spi_fiq_code s3c24xx_spi_fiq_tx;
  199. extern struct spi_fiq_code s3c24xx_spi_fiq_rx;
  200. /**
  201. * ack_bit - turn IRQ into IRQ acknowledgement bit
  202. * @irq: The interrupt number
  203. *
  204. * Returns the bit to write to the interrupt acknowledge register.
  205. */
  206. static inline u32 ack_bit(unsigned int irq)
  207. {
  208. return 1 << (irq - IRQ_EINT0);
  209. }
  210. /**
  211. * s3c24xx_spi_tryfiq - attempt to claim and setup FIQ for transfer
  212. * @hw: The hardware state.
  213. *
  214. * Claim the FIQ handler (only one can be active at any one time) and
  215. * then setup the correct transfer code for this transfer.
  216. *
  217. * This call updates all the necessary state information if successful,
  218. * so the caller does not need to do anything more than start the transfer
  219. * as normal, since the IRQ will have been re-routed to the FIQ handler.
  220. */
  221. static void s3c24xx_spi_tryfiq(struct s3c24xx_spi *hw)
  222. {
  223. struct pt_regs regs;
  224. enum spi_fiq_mode mode;
  225. struct spi_fiq_code *code;
  226. int ret;
  227. if (!hw->fiq_claimed) {
  228. /* try and claim fiq if we haven't got it, and if not
  229. * then return and simply use another transfer method */
  230. ret = claim_fiq(&hw->fiq_handler);
  231. if (ret)
  232. return;
  233. }
  234. if (hw->tx && !hw->rx)
  235. mode = FIQ_MODE_TX;
  236. else if (hw->rx && !hw->tx)
  237. mode = FIQ_MODE_RX;
  238. else
  239. mode = FIQ_MODE_TXRX;
  240. regs.uregs[fiq_rspi] = (long)hw->regs;
  241. regs.uregs[fiq_rrx] = (long)hw->rx;
  242. regs.uregs[fiq_rtx] = (long)hw->tx + 1;
  243. regs.uregs[fiq_rcount] = hw->len - 1;
  244. regs.uregs[fiq_rirq] = (long)S3C24XX_VA_IRQ;
  245. set_fiq_regs(&regs);
  246. if (hw->fiq_mode != mode) {
  247. u32 *ack_ptr;
  248. hw->fiq_mode = mode;
  249. switch (mode) {
  250. case FIQ_MODE_TX:
  251. code = &s3c24xx_spi_fiq_tx;
  252. break;
  253. case FIQ_MODE_RX:
  254. code = &s3c24xx_spi_fiq_rx;
  255. break;
  256. case FIQ_MODE_TXRX:
  257. code = &s3c24xx_spi_fiq_txrx;
  258. break;
  259. default:
  260. code = NULL;
  261. }
  262. BUG_ON(!code);
  263. ack_ptr = (u32 *)&code->data[code->ack_offset];
  264. *ack_ptr = ack_bit(hw->irq);
  265. set_fiq_handler(&code->data, code->length);
  266. }
  267. s3c24xx_set_fiq(hw->irq, true);
  268. hw->fiq_mode = mode;
  269. hw->fiq_inuse = 1;
  270. }
  271. /**
  272. * s3c24xx_spi_fiqop - FIQ core code callback
  273. * @pw: Data registered with the handler
  274. * @release: Whether this is a release or a return.
  275. *
  276. * Called by the FIQ code when another module wants to use the FIQ, so
  277. * return whether we are currently using this or not and then update our
  278. * internal state.
  279. */
  280. static int s3c24xx_spi_fiqop(void *pw, int release)
  281. {
  282. struct s3c24xx_spi *hw = pw;
  283. int ret = 0;
  284. if (release) {
  285. if (hw->fiq_inuse)
  286. ret = -EBUSY;
  287. /* note, we do not need to unroute the FIQ, as the FIQ
  288. * vector code de-routes it to signal the end of transfer */
  289. hw->fiq_mode = FIQ_MODE_NONE;
  290. hw->fiq_claimed = 0;
  291. } else {
  292. hw->fiq_claimed = 1;
  293. }
  294. return ret;
  295. }
  296. /**
  297. * s3c24xx_spi_initfiq - setup the information for the FIQ core
  298. * @hw: The hardware state.
  299. *
  300. * Setup the fiq_handler block to pass to the FIQ core.
  301. */
  302. static inline void s3c24xx_spi_initfiq(struct s3c24xx_spi *hw)
  303. {
  304. hw->fiq_handler.dev_id = hw;
  305. hw->fiq_handler.name = dev_name(hw->dev);
  306. hw->fiq_handler.fiq_op = s3c24xx_spi_fiqop;
  307. }
  308. /**
  309. * s3c24xx_spi_usefiq - return if we should be using FIQ.
  310. * @hw: The hardware state.
  311. *
  312. * Return true if the platform data specifies whether this channel is
  313. * allowed to use the FIQ.
  314. */
  315. static inline bool s3c24xx_spi_usefiq(struct s3c24xx_spi *hw)
  316. {
  317. return hw->pdata->use_fiq;
  318. }
  319. /**
  320. * s3c24xx_spi_usingfiq - return if channel is using FIQ
  321. * @spi: The hardware state.
  322. *
  323. * Return whether the channel is currently using the FIQ (separate from
  324. * whether the FIQ is claimed).
  325. */
  326. static inline bool s3c24xx_spi_usingfiq(struct s3c24xx_spi *spi)
  327. {
  328. return spi->fiq_inuse;
  329. }
  330. #else
  331. static inline void s3c24xx_spi_initfiq(struct s3c24xx_spi *s) { }
  332. static inline void s3c24xx_spi_tryfiq(struct s3c24xx_spi *s) { }
  333. static inline bool s3c24xx_spi_usefiq(struct s3c24xx_spi *s) { return false; }
  334. static inline bool s3c24xx_spi_usingfiq(struct s3c24xx_spi *s) { return false; }
  335. #endif /* CONFIG_SPI_S3C24XX_FIQ */
  336. static int s3c24xx_spi_txrx(struct spi_device *spi, struct spi_transfer *t)
  337. {
  338. struct s3c24xx_spi *hw = to_hw(spi);
  339. hw->tx = t->tx_buf;
  340. hw->rx = t->rx_buf;
  341. hw->len = t->len;
  342. hw->count = 0;
  343. init_completion(&hw->done);
  344. hw->fiq_inuse = 0;
  345. if (s3c24xx_spi_usefiq(hw) && t->len >= 3)
  346. s3c24xx_spi_tryfiq(hw);
  347. /* send the first byte */
  348. writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT);
  349. wait_for_completion(&hw->done);
  350. return hw->count;
  351. }
  352. static irqreturn_t s3c24xx_spi_irq(int irq, void *dev)
  353. {
  354. struct s3c24xx_spi *hw = dev;
  355. unsigned int spsta = readb(hw->regs + S3C2410_SPSTA);
  356. unsigned int count = hw->count;
  357. if (spsta & S3C2410_SPSTA_DCOL) {
  358. dev_dbg(hw->dev, "data-collision\n");
  359. complete(&hw->done);
  360. goto irq_done;
  361. }
  362. if (!(spsta & S3C2410_SPSTA_READY)) {
  363. dev_dbg(hw->dev, "spi not ready for tx?\n");
  364. complete(&hw->done);
  365. goto irq_done;
  366. }
  367. if (!s3c24xx_spi_usingfiq(hw)) {
  368. hw->count++;
  369. if (hw->rx)
  370. hw->rx[count] = readb(hw->regs + S3C2410_SPRDAT);
  371. count++;
  372. if (count < hw->len)
  373. writeb(hw_txbyte(hw, count), hw->regs + S3C2410_SPTDAT);
  374. else
  375. complete(&hw->done);
  376. } else {
  377. hw->count = hw->len;
  378. hw->fiq_inuse = 0;
  379. if (hw->rx)
  380. hw->rx[hw->len-1] = readb(hw->regs + S3C2410_SPRDAT);
  381. complete(&hw->done);
  382. }
  383. irq_done:
  384. return IRQ_HANDLED;
  385. }
  386. static void s3c24xx_spi_initialsetup(struct s3c24xx_spi *hw)
  387. {
  388. /* for the moment, permanently enable the clock */
  389. clk_enable(hw->clk);
  390. /* program defaults into the registers */
  391. writeb(0xff, hw->regs + S3C2410_SPPRE);
  392. writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
  393. writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
  394. if (hw->pdata) {
  395. if (hw->set_cs == s3c24xx_spi_gpiocs)
  396. gpio_direction_output(hw->pdata->pin_cs, 1);
  397. if (hw->pdata->gpio_setup)
  398. hw->pdata->gpio_setup(hw->pdata, 1);
  399. }
  400. }
  401. static int s3c24xx_spi_probe(struct platform_device *pdev)
  402. {
  403. struct s3c2410_spi_info *pdata;
  404. struct s3c24xx_spi *hw;
  405. struct spi_master *master;
  406. struct resource *res;
  407. int err = 0;
  408. master = spi_alloc_master(&pdev->dev, sizeof(struct s3c24xx_spi));
  409. if (master == NULL) {
  410. dev_err(&pdev->dev, "No memory for spi_master\n");
  411. return -ENOMEM;
  412. }
  413. hw = spi_master_get_devdata(master);
  414. memset(hw, 0, sizeof(struct s3c24xx_spi));
  415. hw->master = master;
  416. hw->pdata = pdata = dev_get_platdata(&pdev->dev);
  417. hw->dev = &pdev->dev;
  418. if (pdata == NULL) {
  419. dev_err(&pdev->dev, "No platform data supplied\n");
  420. err = -ENOENT;
  421. goto err_no_pdata;
  422. }
  423. platform_set_drvdata(pdev, hw);
  424. init_completion(&hw->done);
  425. /* initialise fiq handler */
  426. s3c24xx_spi_initfiq(hw);
  427. /* setup the master state. */
  428. /* the spi->mode bits understood by this driver: */
  429. master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
  430. master->num_chipselect = hw->pdata->num_cs;
  431. master->bus_num = pdata->bus_num;
  432. master->bits_per_word_mask = SPI_BPW_MASK(8);
  433. /* setup the state for the bitbang driver */
  434. hw->bitbang.master = hw->master;
  435. hw->bitbang.setup_transfer = s3c24xx_spi_setupxfer;
  436. hw->bitbang.chipselect = s3c24xx_spi_chipsel;
  437. hw->bitbang.txrx_bufs = s3c24xx_spi_txrx;
  438. hw->master->setup = s3c24xx_spi_setup;
  439. hw->master->cleanup = s3c24xx_spi_cleanup;
  440. dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang);
  441. /* find and map our resources */
  442. res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  443. hw->regs = devm_ioremap_resource(&pdev->dev, res);
  444. if (IS_ERR(hw->regs)) {
  445. err = PTR_ERR(hw->regs);
  446. goto err_no_pdata;
  447. }
  448. hw->irq = platform_get_irq(pdev, 0);
  449. if (hw->irq < 0) {
  450. dev_err(&pdev->dev, "No IRQ specified\n");
  451. err = -ENOENT;
  452. goto err_no_pdata;
  453. }
  454. err = devm_request_irq(&pdev->dev, hw->irq, s3c24xx_spi_irq, 0,
  455. pdev->name, hw);
  456. if (err) {
  457. dev_err(&pdev->dev, "Cannot claim IRQ\n");
  458. goto err_no_pdata;
  459. }
  460. hw->clk = devm_clk_get(&pdev->dev, "spi");
  461. if (IS_ERR(hw->clk)) {
  462. dev_err(&pdev->dev, "No clock for device\n");
  463. err = PTR_ERR(hw->clk);
  464. goto err_no_pdata;
  465. }
  466. /* setup any gpio we can */
  467. if (!pdata->set_cs) {
  468. if (pdata->pin_cs < 0) {
  469. dev_err(&pdev->dev, "No chipselect pin\n");
  470. err = -EINVAL;
  471. goto err_register;
  472. }
  473. err = devm_gpio_request(&pdev->dev, pdata->pin_cs,
  474. dev_name(&pdev->dev));
  475. if (err) {
  476. dev_err(&pdev->dev, "Failed to get gpio for cs\n");
  477. goto err_register;
  478. }
  479. hw->set_cs = s3c24xx_spi_gpiocs;
  480. gpio_direction_output(pdata->pin_cs, 1);
  481. } else
  482. hw->set_cs = pdata->set_cs;
  483. s3c24xx_spi_initialsetup(hw);
  484. /* register our spi controller */
  485. err = spi_bitbang_start(&hw->bitbang);
  486. if (err) {
  487. dev_err(&pdev->dev, "Failed to register SPI master\n");
  488. goto err_register;
  489. }
  490. return 0;
  491. err_register:
  492. clk_disable(hw->clk);
  493. err_no_pdata:
  494. spi_master_put(hw->master);
  495. return err;
  496. }
  497. static int s3c24xx_spi_remove(struct platform_device *dev)
  498. {
  499. struct s3c24xx_spi *hw = platform_get_drvdata(dev);
  500. spi_bitbang_stop(&hw->bitbang);
  501. clk_disable(hw->clk);
  502. spi_master_put(hw->master);
  503. return 0;
  504. }
  505. #ifdef CONFIG_PM
  506. static int s3c24xx_spi_suspend(struct device *dev)
  507. {
  508. struct s3c24xx_spi *hw = dev_get_drvdata(dev);
  509. int ret;
  510. ret = spi_master_suspend(hw->master);
  511. if (ret)
  512. return ret;
  513. if (hw->pdata && hw->pdata->gpio_setup)
  514. hw->pdata->gpio_setup(hw->pdata, 0);
  515. clk_disable(hw->clk);
  516. return 0;
  517. }
  518. static int s3c24xx_spi_resume(struct device *dev)
  519. {
  520. struct s3c24xx_spi *hw = dev_get_drvdata(dev);
  521. s3c24xx_spi_initialsetup(hw);
  522. return spi_master_resume(hw->master);
  523. }
  524. static const struct dev_pm_ops s3c24xx_spi_pmops = {
  525. .suspend = s3c24xx_spi_suspend,
  526. .resume = s3c24xx_spi_resume,
  527. };
  528. #define S3C24XX_SPI_PMOPS &s3c24xx_spi_pmops
  529. #else
  530. #define S3C24XX_SPI_PMOPS NULL
  531. #endif /* CONFIG_PM */
  532. MODULE_ALIAS("platform:s3c2410-spi");
  533. static struct platform_driver s3c24xx_spi_driver = {
  534. .probe = s3c24xx_spi_probe,
  535. .remove = s3c24xx_spi_remove,
  536. .driver = {
  537. .name = "s3c2410-spi",
  538. .owner = THIS_MODULE,
  539. .pm = S3C24XX_SPI_PMOPS,
  540. },
  541. };
  542. module_platform_driver(s3c24xx_spi_driver);
  543. MODULE_DESCRIPTION("S3C24XX SPI Driver");
  544. MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
  545. MODULE_LICENSE("GPL");