pxamci.c 15 KB

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