mmci.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. /*
  2. * linux/drivers/mmc/host/mmci.c - ARM PrimeCell MMCI PL180/1 driver
  3. *
  4. * Copyright (C) 2003 Deep Blue Solutions, Ltd, 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. #include <linux/module.h>
  11. #include <linux/moduleparam.h>
  12. #include <linux/init.h>
  13. #include <linux/ioport.h>
  14. #include <linux/device.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/delay.h>
  17. #include <linux/err.h>
  18. #include <linux/highmem.h>
  19. #include <linux/log2.h>
  20. #include <linux/mmc/host.h>
  21. #include <linux/amba/bus.h>
  22. #include <linux/clk.h>
  23. #include <linux/scatterlist.h>
  24. #include <asm/cacheflush.h>
  25. #include <asm/div64.h>
  26. #include <asm/io.h>
  27. #include <asm/sizes.h>
  28. #include <asm/mach/mmc.h>
  29. #include "mmci.h"
  30. #define DRIVER_NAME "mmci-pl18x"
  31. #define DBG(host,fmt,args...) \
  32. pr_debug("%s: %s: " fmt, mmc_hostname(host->mmc), __func__ , args)
  33. static unsigned int fmax = 515633;
  34. static void
  35. mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
  36. {
  37. writel(0, host->base + MMCICOMMAND);
  38. BUG_ON(host->data);
  39. host->mrq = NULL;
  40. host->cmd = NULL;
  41. if (mrq->data)
  42. mrq->data->bytes_xfered = host->data_xfered;
  43. /*
  44. * Need to drop the host lock here; mmc_request_done may call
  45. * back into the driver...
  46. */
  47. spin_unlock(&host->lock);
  48. mmc_request_done(host->mmc, mrq);
  49. spin_lock(&host->lock);
  50. }
  51. static void mmci_stop_data(struct mmci_host *host)
  52. {
  53. writel(0, host->base + MMCIDATACTRL);
  54. writel(0, host->base + MMCIMASK1);
  55. host->data = NULL;
  56. }
  57. static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
  58. {
  59. unsigned int datactrl, timeout, irqmask;
  60. unsigned long long clks;
  61. void __iomem *base;
  62. int blksz_bits;
  63. DBG(host, "blksz %04x blks %04x flags %08x\n",
  64. data->blksz, data->blocks, data->flags);
  65. host->data = data;
  66. host->size = data->blksz;
  67. host->data_xfered = 0;
  68. mmci_init_sg(host, data);
  69. clks = (unsigned long long)data->timeout_ns * host->cclk;
  70. do_div(clks, 1000000000UL);
  71. timeout = data->timeout_clks + (unsigned int)clks;
  72. base = host->base;
  73. writel(timeout, base + MMCIDATATIMER);
  74. writel(host->size, base + MMCIDATALENGTH);
  75. blksz_bits = ffs(data->blksz) - 1;
  76. BUG_ON(1 << blksz_bits != data->blksz);
  77. datactrl = MCI_DPSM_ENABLE | blksz_bits << 4;
  78. if (data->flags & MMC_DATA_READ) {
  79. datactrl |= MCI_DPSM_DIRECTION;
  80. irqmask = MCI_RXFIFOHALFFULLMASK;
  81. /*
  82. * If we have less than a FIFOSIZE of bytes to transfer,
  83. * trigger a PIO interrupt as soon as any data is available.
  84. */
  85. if (host->size < MCI_FIFOSIZE)
  86. irqmask |= MCI_RXDATAAVLBLMASK;
  87. } else {
  88. /*
  89. * We don't actually need to include "FIFO empty" here
  90. * since its implicit in "FIFO half empty".
  91. */
  92. irqmask = MCI_TXFIFOHALFEMPTYMASK;
  93. }
  94. writel(datactrl, base + MMCIDATACTRL);
  95. writel(readl(base + MMCIMASK0) & ~MCI_DATAENDMASK, base + MMCIMASK0);
  96. writel(irqmask, base + MMCIMASK1);
  97. }
  98. static void
  99. mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c)
  100. {
  101. void __iomem *base = host->base;
  102. DBG(host, "op %02x arg %08x flags %08x\n",
  103. cmd->opcode, cmd->arg, cmd->flags);
  104. if (readl(base + MMCICOMMAND) & MCI_CPSM_ENABLE) {
  105. writel(0, base + MMCICOMMAND);
  106. udelay(1);
  107. }
  108. c |= cmd->opcode | MCI_CPSM_ENABLE;
  109. if (cmd->flags & MMC_RSP_PRESENT) {
  110. if (cmd->flags & MMC_RSP_136)
  111. c |= MCI_CPSM_LONGRSP;
  112. c |= MCI_CPSM_RESPONSE;
  113. }
  114. if (/*interrupt*/0)
  115. c |= MCI_CPSM_INTERRUPT;
  116. host->cmd = cmd;
  117. writel(cmd->arg, base + MMCIARGUMENT);
  118. writel(c, base + MMCICOMMAND);
  119. }
  120. static void
  121. mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
  122. unsigned int status)
  123. {
  124. if (status & MCI_DATABLOCKEND) {
  125. host->data_xfered += data->blksz;
  126. }
  127. if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)) {
  128. if (status & MCI_DATACRCFAIL)
  129. data->error = -EILSEQ;
  130. else if (status & MCI_DATATIMEOUT)
  131. data->error = -ETIMEDOUT;
  132. else if (status & (MCI_TXUNDERRUN|MCI_RXOVERRUN))
  133. data->error = -EIO;
  134. status |= MCI_DATAEND;
  135. /*
  136. * We hit an error condition. Ensure that any data
  137. * partially written to a page is properly coherent.
  138. */
  139. if (host->sg_len && data->flags & MMC_DATA_READ)
  140. flush_dcache_page(sg_page(host->sg_ptr));
  141. }
  142. if (status & MCI_DATAEND) {
  143. mmci_stop_data(host);
  144. if (!data->stop) {
  145. mmci_request_end(host, data->mrq);
  146. } else {
  147. mmci_start_command(host, data->stop, 0);
  148. }
  149. }
  150. }
  151. static void
  152. mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
  153. unsigned int status)
  154. {
  155. void __iomem *base = host->base;
  156. host->cmd = NULL;
  157. cmd->resp[0] = readl(base + MMCIRESPONSE0);
  158. cmd->resp[1] = readl(base + MMCIRESPONSE1);
  159. cmd->resp[2] = readl(base + MMCIRESPONSE2);
  160. cmd->resp[3] = readl(base + MMCIRESPONSE3);
  161. if (status & MCI_CMDTIMEOUT) {
  162. cmd->error = -ETIMEDOUT;
  163. } else if (status & MCI_CMDCRCFAIL && cmd->flags & MMC_RSP_CRC) {
  164. cmd->error = -EILSEQ;
  165. }
  166. if (!cmd->data || cmd->error) {
  167. if (host->data)
  168. mmci_stop_data(host);
  169. mmci_request_end(host, cmd->mrq);
  170. } else if (!(cmd->data->flags & MMC_DATA_READ)) {
  171. mmci_start_data(host, cmd->data);
  172. }
  173. }
  174. static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int remain)
  175. {
  176. void __iomem *base = host->base;
  177. char *ptr = buffer;
  178. u32 status;
  179. int host_remain = host->size;
  180. do {
  181. int count = host_remain - (readl(base + MMCIFIFOCNT) << 2);
  182. if (count > remain)
  183. count = remain;
  184. if (count <= 0)
  185. break;
  186. readsl(base + MMCIFIFO, ptr, count >> 2);
  187. ptr += count;
  188. remain -= count;
  189. host_remain -= count;
  190. if (remain == 0)
  191. break;
  192. status = readl(base + MMCISTATUS);
  193. } while (status & MCI_RXDATAAVLBL);
  194. return ptr - buffer;
  195. }
  196. static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int remain, u32 status)
  197. {
  198. void __iomem *base = host->base;
  199. char *ptr = buffer;
  200. do {
  201. unsigned int count, maxcnt;
  202. maxcnt = status & MCI_TXFIFOEMPTY ? MCI_FIFOSIZE : MCI_FIFOHALFSIZE;
  203. count = min(remain, maxcnt);
  204. writesl(base + MMCIFIFO, ptr, count >> 2);
  205. ptr += count;
  206. remain -= count;
  207. if (remain == 0)
  208. break;
  209. status = readl(base + MMCISTATUS);
  210. } while (status & MCI_TXFIFOHALFEMPTY);
  211. return ptr - buffer;
  212. }
  213. /*
  214. * PIO data transfer IRQ handler.
  215. */
  216. static irqreturn_t mmci_pio_irq(int irq, void *dev_id)
  217. {
  218. struct mmci_host *host = dev_id;
  219. void __iomem *base = host->base;
  220. u32 status;
  221. status = readl(base + MMCISTATUS);
  222. DBG(host, "irq1 %08x\n", status);
  223. do {
  224. unsigned long flags;
  225. unsigned int remain, len;
  226. char *buffer;
  227. /*
  228. * For write, we only need to test the half-empty flag
  229. * here - if the FIFO is completely empty, then by
  230. * definition it is more than half empty.
  231. *
  232. * For read, check for data available.
  233. */
  234. if (!(status & (MCI_TXFIFOHALFEMPTY|MCI_RXDATAAVLBL)))
  235. break;
  236. /*
  237. * Map the current scatter buffer.
  238. */
  239. buffer = mmci_kmap_atomic(host, &flags) + host->sg_off;
  240. remain = host->sg_ptr->length - host->sg_off;
  241. len = 0;
  242. if (status & MCI_RXACTIVE)
  243. len = mmci_pio_read(host, buffer, remain);
  244. if (status & MCI_TXACTIVE)
  245. len = mmci_pio_write(host, buffer, remain, status);
  246. /*
  247. * Unmap the buffer.
  248. */
  249. mmci_kunmap_atomic(host, buffer, &flags);
  250. host->sg_off += len;
  251. host->size -= len;
  252. remain -= len;
  253. if (remain)
  254. break;
  255. /*
  256. * If we were reading, and we have completed this
  257. * page, ensure that the data cache is coherent.
  258. */
  259. if (status & MCI_RXACTIVE)
  260. flush_dcache_page(sg_page(host->sg_ptr));
  261. if (!mmci_next_sg(host))
  262. break;
  263. status = readl(base + MMCISTATUS);
  264. } while (1);
  265. /*
  266. * If we're nearing the end of the read, switch to
  267. * "any data available" mode.
  268. */
  269. if (status & MCI_RXACTIVE && host->size < MCI_FIFOSIZE)
  270. writel(MCI_RXDATAAVLBLMASK, base + MMCIMASK1);
  271. /*
  272. * If we run out of data, disable the data IRQs; this
  273. * prevents a race where the FIFO becomes empty before
  274. * the chip itself has disabled the data path, and
  275. * stops us racing with our data end IRQ.
  276. */
  277. if (host->size == 0) {
  278. writel(0, base + MMCIMASK1);
  279. writel(readl(base + MMCIMASK0) | MCI_DATAENDMASK, base + MMCIMASK0);
  280. }
  281. return IRQ_HANDLED;
  282. }
  283. /*
  284. * Handle completion of command and data transfers.
  285. */
  286. static irqreturn_t mmci_irq(int irq, void *dev_id)
  287. {
  288. struct mmci_host *host = dev_id;
  289. u32 status;
  290. int ret = 0;
  291. spin_lock(&host->lock);
  292. do {
  293. struct mmc_command *cmd;
  294. struct mmc_data *data;
  295. status = readl(host->base + MMCISTATUS);
  296. status &= readl(host->base + MMCIMASK0);
  297. writel(status, host->base + MMCICLEAR);
  298. DBG(host, "irq0 %08x\n", status);
  299. data = host->data;
  300. if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|
  301. MCI_RXOVERRUN|MCI_DATAEND|MCI_DATABLOCKEND) && data)
  302. mmci_data_irq(host, data, status);
  303. cmd = host->cmd;
  304. if (status & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT|MCI_CMDSENT|MCI_CMDRESPEND) && cmd)
  305. mmci_cmd_irq(host, cmd, status);
  306. ret = 1;
  307. } while (status);
  308. spin_unlock(&host->lock);
  309. return IRQ_RETVAL(ret);
  310. }
  311. static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
  312. {
  313. struct mmci_host *host = mmc_priv(mmc);
  314. unsigned long flags;
  315. WARN_ON(host->mrq != NULL);
  316. if (mrq->data && !is_power_of_2(mrq->data->blksz)) {
  317. printk(KERN_ERR "%s: Unsupported block size (%d bytes)\n",
  318. mmc_hostname(mmc), mrq->data->blksz);
  319. mrq->cmd->error = -EINVAL;
  320. mmc_request_done(mmc, mrq);
  321. return;
  322. }
  323. spin_lock_irqsave(&host->lock, flags);
  324. host->mrq = mrq;
  325. if (mrq->data && mrq->data->flags & MMC_DATA_READ)
  326. mmci_start_data(host, mrq->data);
  327. mmci_start_command(host, mrq->cmd, 0);
  328. spin_unlock_irqrestore(&host->lock, flags);
  329. }
  330. static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
  331. {
  332. struct mmci_host *host = mmc_priv(mmc);
  333. u32 clk = 0, pwr = 0;
  334. if (ios->clock) {
  335. if (ios->clock >= host->mclk) {
  336. clk = MCI_CLK_BYPASS;
  337. host->cclk = host->mclk;
  338. } else {
  339. clk = host->mclk / (2 * ios->clock) - 1;
  340. if (clk >= 256)
  341. clk = 255;
  342. host->cclk = host->mclk / (2 * (clk + 1));
  343. }
  344. clk |= MCI_CLK_ENABLE;
  345. }
  346. if (host->plat->translate_vdd)
  347. pwr |= host->plat->translate_vdd(mmc_dev(mmc), ios->vdd);
  348. switch (ios->power_mode) {
  349. case MMC_POWER_OFF:
  350. break;
  351. case MMC_POWER_UP:
  352. pwr |= MCI_PWR_UP;
  353. break;
  354. case MMC_POWER_ON:
  355. pwr |= MCI_PWR_ON;
  356. break;
  357. }
  358. if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN)
  359. pwr |= MCI_ROD;
  360. writel(clk, host->base + MMCICLOCK);
  361. if (host->pwr != pwr) {
  362. host->pwr = pwr;
  363. writel(pwr, host->base + MMCIPOWER);
  364. }
  365. }
  366. static const struct mmc_host_ops mmci_ops = {
  367. .request = mmci_request,
  368. .set_ios = mmci_set_ios,
  369. };
  370. static void mmci_check_status(unsigned long data)
  371. {
  372. struct mmci_host *host = (struct mmci_host *)data;
  373. unsigned int status;
  374. status = host->plat->status(mmc_dev(host->mmc));
  375. if (status ^ host->oldstat)
  376. mmc_detect_change(host->mmc, 0);
  377. host->oldstat = status;
  378. mod_timer(&host->timer, jiffies + HZ);
  379. }
  380. static int mmci_probe(struct amba_device *dev, void *id)
  381. {
  382. struct mmc_platform_data *plat = dev->dev.platform_data;
  383. struct mmci_host *host;
  384. struct mmc_host *mmc;
  385. int ret;
  386. /* must have platform data */
  387. if (!plat) {
  388. ret = -EINVAL;
  389. goto out;
  390. }
  391. ret = amba_request_regions(dev, DRIVER_NAME);
  392. if (ret)
  393. goto out;
  394. mmc = mmc_alloc_host(sizeof(struct mmci_host), &dev->dev);
  395. if (!mmc) {
  396. ret = -ENOMEM;
  397. goto rel_regions;
  398. }
  399. host = mmc_priv(mmc);
  400. host->clk = clk_get(&dev->dev, NULL);
  401. if (IS_ERR(host->clk)) {
  402. ret = PTR_ERR(host->clk);
  403. host->clk = NULL;
  404. goto host_free;
  405. }
  406. ret = clk_enable(host->clk);
  407. if (ret)
  408. goto clk_free;
  409. host->plat = plat;
  410. host->mclk = clk_get_rate(host->clk);
  411. /*
  412. * According to the spec, mclk is max 100 MHz,
  413. * so we try to adjust the clock down to this,
  414. * (if possible).
  415. */
  416. if (host->mclk > 100000000) {
  417. ret = clk_set_rate(host->clk, 100000000);
  418. if (ret < 0)
  419. goto clk_disable;
  420. host->mclk = clk_get_rate(host->clk);
  421. DBG(host, "eventual mclk rate: %u Hz\n", host->mclk);
  422. }
  423. host->mmc = mmc;
  424. host->base = ioremap(dev->res.start, SZ_4K);
  425. if (!host->base) {
  426. ret = -ENOMEM;
  427. goto clk_disable;
  428. }
  429. mmc->ops = &mmci_ops;
  430. mmc->f_min = (host->mclk + 511) / 512;
  431. mmc->f_max = min(host->mclk, fmax);
  432. mmc->ocr_avail = plat->ocr_mask;
  433. /*
  434. * We can do SGIO
  435. */
  436. mmc->max_hw_segs = 16;
  437. mmc->max_phys_segs = NR_SG;
  438. /*
  439. * Since we only have a 16-bit data length register, we must
  440. * ensure that we don't exceed 2^16-1 bytes in a single request.
  441. */
  442. mmc->max_req_size = 65535;
  443. /*
  444. * Set the maximum segment size. Since we aren't doing DMA
  445. * (yet) we are only limited by the data length register.
  446. */
  447. mmc->max_seg_size = mmc->max_req_size;
  448. /*
  449. * Block size can be up to 2048 bytes, but must be a power of two.
  450. */
  451. mmc->max_blk_size = 2048;
  452. /*
  453. * No limit on the number of blocks transferred.
  454. */
  455. mmc->max_blk_count = mmc->max_req_size;
  456. spin_lock_init(&host->lock);
  457. writel(0, host->base + MMCIMASK0);
  458. writel(0, host->base + MMCIMASK1);
  459. writel(0xfff, host->base + MMCICLEAR);
  460. ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED, DRIVER_NAME " (cmd)", host);
  461. if (ret)
  462. goto unmap;
  463. ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED, DRIVER_NAME " (pio)", host);
  464. if (ret)
  465. goto irq0_free;
  466. writel(MCI_IRQENABLE, host->base + MMCIMASK0);
  467. amba_set_drvdata(dev, mmc);
  468. mmc_add_host(mmc);
  469. printk(KERN_INFO "%s: MMCI rev %x cfg %02x at 0x%016llx irq %d,%d\n",
  470. mmc_hostname(mmc), amba_rev(dev), amba_config(dev),
  471. (unsigned long long)dev->res.start, dev->irq[0], dev->irq[1]);
  472. init_timer(&host->timer);
  473. host->timer.data = (unsigned long)host;
  474. host->timer.function = mmci_check_status;
  475. host->timer.expires = jiffies + HZ;
  476. add_timer(&host->timer);
  477. return 0;
  478. irq0_free:
  479. free_irq(dev->irq[0], host);
  480. unmap:
  481. iounmap(host->base);
  482. clk_disable:
  483. clk_disable(host->clk);
  484. clk_free:
  485. clk_put(host->clk);
  486. host_free:
  487. mmc_free_host(mmc);
  488. rel_regions:
  489. amba_release_regions(dev);
  490. out:
  491. return ret;
  492. }
  493. static int mmci_remove(struct amba_device *dev)
  494. {
  495. struct mmc_host *mmc = amba_get_drvdata(dev);
  496. amba_set_drvdata(dev, NULL);
  497. if (mmc) {
  498. struct mmci_host *host = mmc_priv(mmc);
  499. del_timer_sync(&host->timer);
  500. mmc_remove_host(mmc);
  501. writel(0, host->base + MMCIMASK0);
  502. writel(0, host->base + MMCIMASK1);
  503. writel(0, host->base + MMCICOMMAND);
  504. writel(0, host->base + MMCIDATACTRL);
  505. free_irq(dev->irq[0], host);
  506. free_irq(dev->irq[1], host);
  507. iounmap(host->base);
  508. clk_disable(host->clk);
  509. clk_put(host->clk);
  510. mmc_free_host(mmc);
  511. amba_release_regions(dev);
  512. }
  513. return 0;
  514. }
  515. #ifdef CONFIG_PM
  516. static int mmci_suspend(struct amba_device *dev, pm_message_t state)
  517. {
  518. struct mmc_host *mmc = amba_get_drvdata(dev);
  519. int ret = 0;
  520. if (mmc) {
  521. struct mmci_host *host = mmc_priv(mmc);
  522. ret = mmc_suspend_host(mmc, state);
  523. if (ret == 0)
  524. writel(0, host->base + MMCIMASK0);
  525. }
  526. return ret;
  527. }
  528. static int mmci_resume(struct amba_device *dev)
  529. {
  530. struct mmc_host *mmc = amba_get_drvdata(dev);
  531. int ret = 0;
  532. if (mmc) {
  533. struct mmci_host *host = mmc_priv(mmc);
  534. writel(MCI_IRQENABLE, host->base + MMCIMASK0);
  535. ret = mmc_resume_host(mmc);
  536. }
  537. return ret;
  538. }
  539. #else
  540. #define mmci_suspend NULL
  541. #define mmci_resume NULL
  542. #endif
  543. static struct amba_id mmci_ids[] = {
  544. {
  545. .id = 0x00041180,
  546. .mask = 0x000fffff,
  547. },
  548. {
  549. .id = 0x00041181,
  550. .mask = 0x000fffff,
  551. },
  552. { 0, 0 },
  553. };
  554. static struct amba_driver mmci_driver = {
  555. .drv = {
  556. .name = DRIVER_NAME,
  557. },
  558. .probe = mmci_probe,
  559. .remove = mmci_remove,
  560. .suspend = mmci_suspend,
  561. .resume = mmci_resume,
  562. .id_table = mmci_ids,
  563. };
  564. static int __init mmci_init(void)
  565. {
  566. return amba_driver_register(&mmci_driver);
  567. }
  568. static void __exit mmci_exit(void)
  569. {
  570. amba_driver_unregister(&mmci_driver);
  571. }
  572. module_init(mmci_init);
  573. module_exit(mmci_exit);
  574. module_param(fmax, uint, 0444);
  575. MODULE_DESCRIPTION("ARM PrimeCell PL180/181 Multimedia Card Interface driver");
  576. MODULE_LICENSE("GPL");