pxamci.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. /*
  2. * linux/drivers/mmc/host/pxa.c - PXA MMCI driver
  3. *
  4. * Copyright (C) 2003 Russell King, All Rights Reserved.
  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. * This hardware is really sick:
  11. * - No way to clear interrupts.
  12. * - Have to turn off the clock whenever we touch the device.
  13. * - Doesn't tell you how many data blocks were transferred.
  14. * Yuck!
  15. *
  16. * 1 and 3 byte data transfers not supported
  17. * max block length up to 1023
  18. */
  19. #include <linux/module.h>
  20. #include <linux/init.h>
  21. #include <linux/ioport.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/delay.h>
  24. #include <linux/interrupt.h>
  25. #include <linux/dma-mapping.h>
  26. #include <linux/clk.h>
  27. #include <linux/err.h>
  28. #include <linux/mmc/host.h>
  29. #include <asm/dma.h>
  30. #include <asm/io.h>
  31. #include <asm/sizes.h>
  32. #include <asm/arch/pxa-regs.h>
  33. #include <asm/arch/mmc.h>
  34. #include "pxamci.h"
  35. #define DRIVER_NAME "pxa2xx-mci"
  36. #define NR_SG 1
  37. struct pxamci_host {
  38. struct mmc_host *mmc;
  39. spinlock_t lock;
  40. struct resource *res;
  41. void __iomem *base;
  42. struct clk *clk;
  43. unsigned long clkrate;
  44. int irq;
  45. int dma;
  46. unsigned int clkrt;
  47. unsigned int cmdat;
  48. unsigned int imask;
  49. unsigned int power_mode;
  50. struct pxamci_platform_data *pdata;
  51. struct mmc_request *mrq;
  52. struct mmc_command *cmd;
  53. struct mmc_data *data;
  54. dma_addr_t sg_dma;
  55. struct pxa_dma_desc *sg_cpu;
  56. unsigned int dma_len;
  57. unsigned int dma_dir;
  58. };
  59. static void pxamci_stop_clock(struct pxamci_host *host)
  60. {
  61. if (readl(host->base + MMC_STAT) & STAT_CLK_EN) {
  62. unsigned long timeout = 10000;
  63. unsigned int v;
  64. writel(STOP_CLOCK, host->base + MMC_STRPCL);
  65. do {
  66. v = readl(host->base + MMC_STAT);
  67. if (!(v & STAT_CLK_EN))
  68. break;
  69. udelay(1);
  70. } while (timeout--);
  71. if (v & STAT_CLK_EN)
  72. dev_err(mmc_dev(host->mmc), "unable to stop clock\n");
  73. }
  74. }
  75. static void pxamci_enable_irq(struct pxamci_host *host, unsigned int mask)
  76. {
  77. unsigned long flags;
  78. spin_lock_irqsave(&host->lock, flags);
  79. host->imask &= ~mask;
  80. writel(host->imask, host->base + MMC_I_MASK);
  81. spin_unlock_irqrestore(&host->lock, flags);
  82. }
  83. static void pxamci_disable_irq(struct pxamci_host *host, unsigned int mask)
  84. {
  85. unsigned long flags;
  86. spin_lock_irqsave(&host->lock, flags);
  87. host->imask |= mask;
  88. writel(host->imask, host->base + MMC_I_MASK);
  89. spin_unlock_irqrestore(&host->lock, flags);
  90. }
  91. static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data)
  92. {
  93. unsigned int nob = data->blocks;
  94. unsigned long long clks;
  95. unsigned int timeout;
  96. u32 dcmd;
  97. int i;
  98. host->data = data;
  99. if (data->flags & MMC_DATA_STREAM)
  100. nob = 0xffff;
  101. writel(nob, host->base + MMC_NOB);
  102. writel(data->blksz, host->base + MMC_BLKLEN);
  103. clks = (unsigned long long)data->timeout_ns * host->clkrate;
  104. do_div(clks, 1000000000UL);
  105. timeout = (unsigned int)clks + (data->timeout_clks << host->clkrt);
  106. writel((timeout + 255) / 256, host->base + MMC_RDTO);
  107. if (data->flags & MMC_DATA_READ) {
  108. host->dma_dir = DMA_FROM_DEVICE;
  109. dcmd = DCMD_INCTRGADDR | DCMD_FLOWTRG;
  110. DRCMRTXMMC = 0;
  111. DRCMRRXMMC = host->dma | DRCMR_MAPVLD;
  112. } else {
  113. host->dma_dir = DMA_TO_DEVICE;
  114. dcmd = DCMD_INCSRCADDR | DCMD_FLOWSRC;
  115. DRCMRRXMMC = 0;
  116. DRCMRTXMMC = host->dma | DRCMR_MAPVLD;
  117. }
  118. dcmd |= DCMD_BURST32 | DCMD_WIDTH1;
  119. host->dma_len = dma_map_sg(mmc_dev(host->mmc), data->sg, data->sg_len,
  120. host->dma_dir);
  121. for (i = 0; i < host->dma_len; i++) {
  122. unsigned int length = sg_dma_len(&data->sg[i]);
  123. host->sg_cpu[i].dcmd = dcmd | length;
  124. if (length & 31 && !(data->flags & MMC_DATA_READ))
  125. host->sg_cpu[i].dcmd |= DCMD_ENDIRQEN;
  126. if (data->flags & MMC_DATA_READ) {
  127. host->sg_cpu[i].dsadr = host->res->start + MMC_RXFIFO;
  128. host->sg_cpu[i].dtadr = sg_dma_address(&data->sg[i]);
  129. } else {
  130. host->sg_cpu[i].dsadr = sg_dma_address(&data->sg[i]);
  131. host->sg_cpu[i].dtadr = host->res->start + MMC_TXFIFO;
  132. }
  133. host->sg_cpu[i].ddadr = host->sg_dma + (i + 1) *
  134. sizeof(struct pxa_dma_desc);
  135. }
  136. host->sg_cpu[host->dma_len - 1].ddadr = DDADR_STOP;
  137. wmb();
  138. DDADR(host->dma) = host->sg_dma;
  139. DCSR(host->dma) = DCSR_RUN;
  140. }
  141. static void pxamci_start_cmd(struct pxamci_host *host, struct mmc_command *cmd, unsigned int cmdat)
  142. {
  143. WARN_ON(host->cmd != NULL);
  144. host->cmd = cmd;
  145. if (cmd->flags & MMC_RSP_BUSY)
  146. cmdat |= CMDAT_BUSY;
  147. #define RSP_TYPE(x) ((x) & ~(MMC_RSP_BUSY|MMC_RSP_OPCODE))
  148. switch (RSP_TYPE(mmc_resp_type(cmd))) {
  149. case RSP_TYPE(MMC_RSP_R1): /* r1, r1b, r6, r7 */
  150. cmdat |= CMDAT_RESP_SHORT;
  151. break;
  152. case RSP_TYPE(MMC_RSP_R3):
  153. cmdat |= CMDAT_RESP_R3;
  154. break;
  155. case RSP_TYPE(MMC_RSP_R2):
  156. cmdat |= CMDAT_RESP_R2;
  157. break;
  158. default:
  159. break;
  160. }
  161. writel(cmd->opcode, host->base + MMC_CMD);
  162. writel(cmd->arg >> 16, host->base + MMC_ARGH);
  163. writel(cmd->arg & 0xffff, host->base + MMC_ARGL);
  164. writel(cmdat, host->base + MMC_CMDAT);
  165. writel(host->clkrt, host->base + MMC_CLKRT);
  166. writel(START_CLOCK, host->base + MMC_STRPCL);
  167. pxamci_enable_irq(host, END_CMD_RES);
  168. }
  169. static void pxamci_finish_request(struct pxamci_host *host, struct mmc_request *mrq)
  170. {
  171. host->mrq = NULL;
  172. host->cmd = NULL;
  173. host->data = NULL;
  174. mmc_request_done(host->mmc, mrq);
  175. }
  176. static int pxamci_cmd_done(struct pxamci_host *host, unsigned int stat)
  177. {
  178. struct mmc_command *cmd = host->cmd;
  179. int i;
  180. u32 v;
  181. if (!cmd)
  182. return 0;
  183. host->cmd = NULL;
  184. /*
  185. * Did I mention this is Sick. We always need to
  186. * discard the upper 8 bits of the first 16-bit word.
  187. */
  188. v = readl(host->base + MMC_RES) & 0xffff;
  189. for (i = 0; i < 4; i++) {
  190. u32 w1 = readl(host->base + MMC_RES) & 0xffff;
  191. u32 w2 = readl(host->base + MMC_RES) & 0xffff;
  192. cmd->resp[i] = v << 24 | w1 << 8 | w2 >> 8;
  193. v = w2;
  194. }
  195. if (stat & STAT_TIME_OUT_RESPONSE) {
  196. cmd->error = -ETIMEDOUT;
  197. } else if (stat & STAT_RES_CRC_ERR && cmd->flags & MMC_RSP_CRC) {
  198. #ifdef CONFIG_PXA27x
  199. /*
  200. * workaround for erratum #42:
  201. * Intel PXA27x Family Processor Specification Update Rev 001
  202. * A bogus CRC error can appear if the msb of a 136 bit
  203. * response is a one.
  204. */
  205. if (cmd->flags & MMC_RSP_136 && cmd->resp[0] & 0x80000000) {
  206. pr_debug("ignoring CRC from command %d - *risky*\n", cmd->opcode);
  207. } else
  208. #endif
  209. cmd->error = -EILSEQ;
  210. }
  211. pxamci_disable_irq(host, END_CMD_RES);
  212. if (host->data && !cmd->error) {
  213. pxamci_enable_irq(host, DATA_TRAN_DONE);
  214. } else {
  215. pxamci_finish_request(host, host->mrq);
  216. }
  217. return 1;
  218. }
  219. static int pxamci_data_done(struct pxamci_host *host, unsigned int stat)
  220. {
  221. struct mmc_data *data = host->data;
  222. if (!data)
  223. return 0;
  224. DCSR(host->dma) = 0;
  225. dma_unmap_sg(mmc_dev(host->mmc), data->sg, host->dma_len,
  226. host->dma_dir);
  227. if (stat & STAT_READ_TIME_OUT)
  228. data->error = -ETIMEDOUT;
  229. else if (stat & (STAT_CRC_READ_ERROR|STAT_CRC_WRITE_ERROR))
  230. data->error = -EILSEQ;
  231. /*
  232. * There appears to be a hardware design bug here. There seems to
  233. * be no way to find out how much data was transferred to the card.
  234. * This means that if there was an error on any block, we mark all
  235. * data blocks as being in error.
  236. */
  237. if (!data->error)
  238. data->bytes_xfered = data->blocks * data->blksz;
  239. else
  240. data->bytes_xfered = 0;
  241. pxamci_disable_irq(host, DATA_TRAN_DONE);
  242. host->data = NULL;
  243. if (host->mrq->stop) {
  244. pxamci_stop_clock(host);
  245. pxamci_start_cmd(host, host->mrq->stop, host->cmdat);
  246. } else {
  247. pxamci_finish_request(host, host->mrq);
  248. }
  249. return 1;
  250. }
  251. static irqreturn_t pxamci_irq(int irq, void *devid)
  252. {
  253. struct pxamci_host *host = devid;
  254. unsigned int ireg;
  255. int handled = 0;
  256. ireg = readl(host->base + MMC_I_REG) & ~readl(host->base + MMC_I_MASK);
  257. if (ireg) {
  258. unsigned stat = readl(host->base + MMC_STAT);
  259. pr_debug("PXAMCI: irq %08x stat %08x\n", ireg, stat);
  260. if (ireg & END_CMD_RES)
  261. handled |= pxamci_cmd_done(host, stat);
  262. if (ireg & DATA_TRAN_DONE)
  263. handled |= pxamci_data_done(host, stat);
  264. if (ireg & SDIO_INT) {
  265. mmc_signal_sdio_irq(host->mmc);
  266. handled = 1;
  267. }
  268. }
  269. return IRQ_RETVAL(handled);
  270. }
  271. static void pxamci_request(struct mmc_host *mmc, struct mmc_request *mrq)
  272. {
  273. struct pxamci_host *host = mmc_priv(mmc);
  274. unsigned int cmdat;
  275. WARN_ON(host->mrq != NULL);
  276. host->mrq = mrq;
  277. pxamci_stop_clock(host);
  278. cmdat = host->cmdat;
  279. host->cmdat &= ~CMDAT_INIT;
  280. if (mrq->data) {
  281. pxamci_setup_data(host, mrq->data);
  282. cmdat &= ~CMDAT_BUSY;
  283. cmdat |= CMDAT_DATAEN | CMDAT_DMAEN;
  284. if (mrq->data->flags & MMC_DATA_WRITE)
  285. cmdat |= CMDAT_WRITE;
  286. if (mrq->data->flags & MMC_DATA_STREAM)
  287. cmdat |= CMDAT_STREAM;
  288. }
  289. pxamci_start_cmd(host, mrq->cmd, cmdat);
  290. }
  291. static int pxamci_get_ro(struct mmc_host *mmc)
  292. {
  293. struct pxamci_host *host = mmc_priv(mmc);
  294. if (host->pdata && host->pdata->get_ro)
  295. return host->pdata->get_ro(mmc_dev(mmc));
  296. /* Host doesn't support read only detection so assume writeable */
  297. return 0;
  298. }
  299. static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
  300. {
  301. struct pxamci_host *host = mmc_priv(mmc);
  302. if (ios->clock) {
  303. unsigned long rate = host->clkrate;
  304. unsigned int clk = rate / ios->clock;
  305. /*
  306. * clk might result in a lower divisor than we
  307. * desire. check for that condition and adjust
  308. * as appropriate.
  309. */
  310. if (rate / clk > ios->clock)
  311. clk <<= 1;
  312. host->clkrt = fls(clk) - 1;
  313. clk_enable(host->clk);
  314. /*
  315. * we write clkrt on the next command
  316. */
  317. } else {
  318. pxamci_stop_clock(host);
  319. clk_disable(host->clk);
  320. }
  321. if (host->power_mode != ios->power_mode) {
  322. host->power_mode = ios->power_mode;
  323. if (host->pdata && host->pdata->setpower)
  324. host->pdata->setpower(mmc_dev(mmc), ios->vdd);
  325. if (ios->power_mode == MMC_POWER_ON)
  326. host->cmdat |= CMDAT_INIT;
  327. }
  328. if (ios->bus_width == MMC_BUS_WIDTH_4)
  329. host->cmdat |= CMDAT_SD_4DAT;
  330. else
  331. host->cmdat &= ~CMDAT_SD_4DAT;
  332. pr_debug("PXAMCI: clkrt = %x cmdat = %x\n",
  333. host->clkrt, host->cmdat);
  334. }
  335. static void pxamci_enable_sdio_irq(struct mmc_host *host, int enable)
  336. {
  337. struct pxamci_host *pxa_host = mmc_priv(host);
  338. if (enable)
  339. pxamci_enable_irq(pxa_host, SDIO_INT);
  340. else
  341. pxamci_disable_irq(pxa_host, SDIO_INT);
  342. }
  343. static const struct mmc_host_ops pxamci_ops = {
  344. .request = pxamci_request,
  345. .get_ro = pxamci_get_ro,
  346. .set_ios = pxamci_set_ios,
  347. .enable_sdio_irq = pxamci_enable_sdio_irq,
  348. };
  349. static void pxamci_dma_irq(int dma, void *devid)
  350. {
  351. struct pxamci_host *host = devid;
  352. int dcsr = DCSR(dma);
  353. DCSR(dma) = dcsr & ~DCSR_STOPIRQEN;
  354. if (dcsr & DCSR_ENDINTR) {
  355. writel(BUF_PART_FULL, host->base + MMC_PRTBUF);
  356. } else {
  357. printk(KERN_ERR "%s: DMA error on channel %d (DCSR=%#x)\n",
  358. mmc_hostname(host->mmc), dma, dcsr);
  359. host->data->error = -EIO;
  360. pxamci_data_done(host, 0);
  361. }
  362. }
  363. static irqreturn_t pxamci_detect_irq(int irq, void *devid)
  364. {
  365. struct pxamci_host *host = mmc_priv(devid);
  366. mmc_detect_change(devid, host->pdata->detect_delay);
  367. return IRQ_HANDLED;
  368. }
  369. static int pxamci_probe(struct platform_device *pdev)
  370. {
  371. struct mmc_host *mmc;
  372. struct pxamci_host *host = NULL;
  373. struct resource *r;
  374. int ret, irq;
  375. r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  376. irq = platform_get_irq(pdev, 0);
  377. if (!r || irq < 0)
  378. return -ENXIO;
  379. r = request_mem_region(r->start, SZ_4K, DRIVER_NAME);
  380. if (!r)
  381. return -EBUSY;
  382. mmc = mmc_alloc_host(sizeof(struct pxamci_host), &pdev->dev);
  383. if (!mmc) {
  384. ret = -ENOMEM;
  385. goto out;
  386. }
  387. mmc->ops = &pxamci_ops;
  388. /*
  389. * We can do SG-DMA, but we don't because we never know how much
  390. * data we successfully wrote to the card.
  391. */
  392. mmc->max_phys_segs = NR_SG;
  393. /*
  394. * Our hardware DMA can handle a maximum of one page per SG entry.
  395. */
  396. mmc->max_seg_size = PAGE_SIZE;
  397. /*
  398. * Block length register is only 10 bits before PXA27x.
  399. */
  400. mmc->max_blk_size = (cpu_is_pxa21x() || cpu_is_pxa25x()) ? 1023 : 2048;
  401. /*
  402. * Block count register is 16 bits.
  403. */
  404. mmc->max_blk_count = 65535;
  405. host = mmc_priv(mmc);
  406. host->mmc = mmc;
  407. host->dma = -1;
  408. host->pdata = pdev->dev.platform_data;
  409. host->clk = clk_get(&pdev->dev, "MMCCLK");
  410. if (IS_ERR(host->clk)) {
  411. ret = PTR_ERR(host->clk);
  412. host->clk = NULL;
  413. goto out;
  414. }
  415. host->clkrate = clk_get_rate(host->clk);
  416. /*
  417. * Calculate minimum clock rate, rounding up.
  418. */
  419. mmc->f_min = (host->clkrate + 63) / 64;
  420. mmc->f_max = host->clkrate;
  421. mmc->ocr_avail = host->pdata ?
  422. host->pdata->ocr_mask :
  423. MMC_VDD_32_33|MMC_VDD_33_34;
  424. mmc->caps = 0;
  425. host->cmdat = 0;
  426. if (!cpu_is_pxa21x() && !cpu_is_pxa25x()) {
  427. mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ;
  428. host->cmdat |= CMDAT_SDIO_INT_EN;
  429. }
  430. host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL);
  431. if (!host->sg_cpu) {
  432. ret = -ENOMEM;
  433. goto out;
  434. }
  435. spin_lock_init(&host->lock);
  436. host->res = r;
  437. host->irq = irq;
  438. host->imask = MMC_I_MASK_ALL;
  439. host->base = ioremap(r->start, SZ_4K);
  440. if (!host->base) {
  441. ret = -ENOMEM;
  442. goto out;
  443. }
  444. /*
  445. * Ensure that the host controller is shut down, and setup
  446. * with our defaults.
  447. */
  448. pxamci_stop_clock(host);
  449. writel(0, host->base + MMC_SPI);
  450. writel(64, host->base + MMC_RESTO);
  451. writel(host->imask, host->base + MMC_I_MASK);
  452. host->dma = pxa_request_dma(DRIVER_NAME, DMA_PRIO_LOW,
  453. pxamci_dma_irq, host);
  454. if (host->dma < 0) {
  455. ret = -EBUSY;
  456. goto out;
  457. }
  458. ret = request_irq(host->irq, pxamci_irq, 0, DRIVER_NAME, host);
  459. if (ret)
  460. goto out;
  461. platform_set_drvdata(pdev, mmc);
  462. if (host->pdata && host->pdata->init)
  463. host->pdata->init(&pdev->dev, pxamci_detect_irq, mmc);
  464. mmc_add_host(mmc);
  465. return 0;
  466. out:
  467. if (host) {
  468. if (host->dma >= 0)
  469. pxa_free_dma(host->dma);
  470. if (host->base)
  471. iounmap(host->base);
  472. if (host->sg_cpu)
  473. dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
  474. if (host->clk)
  475. clk_put(host->clk);
  476. }
  477. if (mmc)
  478. mmc_free_host(mmc);
  479. release_resource(r);
  480. return ret;
  481. }
  482. static int pxamci_remove(struct platform_device *pdev)
  483. {
  484. struct mmc_host *mmc = platform_get_drvdata(pdev);
  485. platform_set_drvdata(pdev, NULL);
  486. if (mmc) {
  487. struct pxamci_host *host = mmc_priv(mmc);
  488. if (host->pdata && host->pdata->exit)
  489. host->pdata->exit(&pdev->dev, mmc);
  490. mmc_remove_host(mmc);
  491. pxamci_stop_clock(host);
  492. writel(TXFIFO_WR_REQ|RXFIFO_RD_REQ|CLK_IS_OFF|STOP_CMD|
  493. END_CMD_RES|PRG_DONE|DATA_TRAN_DONE,
  494. host->base + MMC_I_MASK);
  495. DRCMRRXMMC = 0;
  496. DRCMRTXMMC = 0;
  497. free_irq(host->irq, host);
  498. pxa_free_dma(host->dma);
  499. iounmap(host->base);
  500. dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma);
  501. clk_put(host->clk);
  502. release_resource(host->res);
  503. mmc_free_host(mmc);
  504. }
  505. return 0;
  506. }
  507. #ifdef CONFIG_PM
  508. static int pxamci_suspend(struct platform_device *dev, pm_message_t state)
  509. {
  510. struct mmc_host *mmc = platform_get_drvdata(dev);
  511. int ret = 0;
  512. if (mmc)
  513. ret = mmc_suspend_host(mmc, state);
  514. return ret;
  515. }
  516. static int pxamci_resume(struct platform_device *dev)
  517. {
  518. struct mmc_host *mmc = platform_get_drvdata(dev);
  519. int ret = 0;
  520. if (mmc)
  521. ret = mmc_resume_host(mmc);
  522. return ret;
  523. }
  524. #else
  525. #define pxamci_suspend NULL
  526. #define pxamci_resume NULL
  527. #endif
  528. static struct platform_driver pxamci_driver = {
  529. .probe = pxamci_probe,
  530. .remove = pxamci_remove,
  531. .suspend = pxamci_suspend,
  532. .resume = pxamci_resume,
  533. .driver = {
  534. .name = DRIVER_NAME,
  535. },
  536. };
  537. static int __init pxamci_init(void)
  538. {
  539. return platform_driver_register(&pxamci_driver);
  540. }
  541. static void __exit pxamci_exit(void)
  542. {
  543. platform_driver_unregister(&pxamci_driver);
  544. }
  545. module_init(pxamci_init);
  546. module_exit(pxamci_exit);
  547. MODULE_DESCRIPTION("PXA Multimedia Card Interface Driver");
  548. MODULE_LICENSE("GPL");