mmci.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  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. WARN_ON(host->mrq != NULL);
  315. if (mrq->data && !is_power_of_2(mrq->data->blksz)) {
  316. printk(KERN_ERR "%s: Unsupported block size (%d bytes)\n",
  317. mmc_hostname(mmc), mrq->data->blksz);
  318. mrq->cmd->error = -EINVAL;
  319. mmc_request_done(mmc, mrq);
  320. return;
  321. }
  322. spin_lock_irq(&host->lock);
  323. host->mrq = mrq;
  324. if (mrq->data && mrq->data->flags & MMC_DATA_READ)
  325. mmci_start_data(host, mrq->data);
  326. mmci_start_command(host, mrq->cmd, 0);
  327. spin_unlock_irq(&host->lock);
  328. }
  329. static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
  330. {
  331. struct mmci_host *host = mmc_priv(mmc);
  332. u32 clk = 0, pwr = 0;
  333. if (ios->clock) {
  334. if (ios->clock >= host->mclk) {
  335. clk = MCI_CLK_BYPASS;
  336. host->cclk = host->mclk;
  337. } else {
  338. clk = host->mclk / (2 * ios->clock) - 1;
  339. if (clk >= 256)
  340. clk = 255;
  341. host->cclk = host->mclk / (2 * (clk + 1));
  342. }
  343. clk |= MCI_CLK_ENABLE;
  344. }
  345. if (host->plat->translate_vdd)
  346. pwr |= host->plat->translate_vdd(mmc_dev(mmc), ios->vdd);
  347. switch (ios->power_mode) {
  348. case MMC_POWER_OFF:
  349. break;
  350. case MMC_POWER_UP:
  351. pwr |= MCI_PWR_UP;
  352. break;
  353. case MMC_POWER_ON:
  354. pwr |= MCI_PWR_ON;
  355. break;
  356. }
  357. if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN)
  358. pwr |= MCI_ROD;
  359. writel(clk, host->base + MMCICLOCK);
  360. if (host->pwr != pwr) {
  361. host->pwr = pwr;
  362. writel(pwr, host->base + MMCIPOWER);
  363. }
  364. }
  365. static const struct mmc_host_ops mmci_ops = {
  366. .request = mmci_request,
  367. .set_ios = mmci_set_ios,
  368. };
  369. static void mmci_check_status(unsigned long data)
  370. {
  371. struct mmci_host *host = (struct mmci_host *)data;
  372. unsigned int status;
  373. status = host->plat->status(mmc_dev(host->mmc));
  374. if (status ^ host->oldstat)
  375. mmc_detect_change(host->mmc, 0);
  376. host->oldstat = status;
  377. mod_timer(&host->timer, jiffies + HZ);
  378. }
  379. static int mmci_probe(struct amba_device *dev, void *id)
  380. {
  381. struct mmc_platform_data *plat = dev->dev.platform_data;
  382. struct mmci_host *host;
  383. struct mmc_host *mmc;
  384. int ret;
  385. /* must have platform data */
  386. if (!plat) {
  387. ret = -EINVAL;
  388. goto out;
  389. }
  390. ret = amba_request_regions(dev, DRIVER_NAME);
  391. if (ret)
  392. goto out;
  393. mmc = mmc_alloc_host(sizeof(struct mmci_host), &dev->dev);
  394. if (!mmc) {
  395. ret = -ENOMEM;
  396. goto rel_regions;
  397. }
  398. host = mmc_priv(mmc);
  399. host->clk = clk_get(&dev->dev, "MCLK");
  400. if (IS_ERR(host->clk)) {
  401. ret = PTR_ERR(host->clk);
  402. host->clk = NULL;
  403. goto host_free;
  404. }
  405. ret = clk_enable(host->clk);
  406. if (ret)
  407. goto clk_free;
  408. host->plat = plat;
  409. host->mclk = clk_get_rate(host->clk);
  410. /*
  411. * According to the spec, mclk is max 100 MHz,
  412. * so we try to adjust the clock down to this,
  413. * (if possible).
  414. */
  415. if (host->mclk > 100000000) {
  416. ret = clk_set_rate(host->clk, 100000000);
  417. if (ret < 0)
  418. goto clk_disable;
  419. host->mclk = clk_get_rate(host->clk);
  420. DBG(host, "eventual mclk rate: %u Hz\n", host->mclk);
  421. }
  422. host->mmc = mmc;
  423. host->base = ioremap(dev->res.start, SZ_4K);
  424. if (!host->base) {
  425. ret = -ENOMEM;
  426. goto clk_disable;
  427. }
  428. mmc->ops = &mmci_ops;
  429. mmc->f_min = (host->mclk + 511) / 512;
  430. mmc->f_max = min(host->mclk, fmax);
  431. mmc->ocr_avail = plat->ocr_mask;
  432. /*
  433. * We can do SGIO
  434. */
  435. mmc->max_hw_segs = 16;
  436. mmc->max_phys_segs = NR_SG;
  437. /*
  438. * Since we only have a 16-bit data length register, we must
  439. * ensure that we don't exceed 2^16-1 bytes in a single request.
  440. */
  441. mmc->max_req_size = 65535;
  442. /*
  443. * Set the maximum segment size. Since we aren't doing DMA
  444. * (yet) we are only limited by the data length register.
  445. */
  446. mmc->max_seg_size = mmc->max_req_size;
  447. /*
  448. * Block size can be up to 2048 bytes, but must be a power of two.
  449. */
  450. mmc->max_blk_size = 2048;
  451. /*
  452. * No limit on the number of blocks transferred.
  453. */
  454. mmc->max_blk_count = mmc->max_req_size;
  455. spin_lock_init(&host->lock);
  456. writel(0, host->base + MMCIMASK0);
  457. writel(0, host->base + MMCIMASK1);
  458. writel(0xfff, host->base + MMCICLEAR);
  459. ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED, DRIVER_NAME " (cmd)", host);
  460. if (ret)
  461. goto unmap;
  462. ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED, DRIVER_NAME " (pio)", host);
  463. if (ret)
  464. goto irq0_free;
  465. writel(MCI_IRQENABLE, host->base + MMCIMASK0);
  466. amba_set_drvdata(dev, mmc);
  467. mmc_add_host(mmc);
  468. printk(KERN_INFO "%s: MMCI rev %x cfg %02x at 0x%016llx irq %d,%d\n",
  469. mmc_hostname(mmc), amba_rev(dev), amba_config(dev),
  470. (unsigned long long)dev->res.start, dev->irq[0], dev->irq[1]);
  471. init_timer(&host->timer);
  472. host->timer.data = (unsigned long)host;
  473. host->timer.function = mmci_check_status;
  474. host->timer.expires = jiffies + HZ;
  475. add_timer(&host->timer);
  476. return 0;
  477. irq0_free:
  478. free_irq(dev->irq[0], host);
  479. unmap:
  480. iounmap(host->base);
  481. clk_disable:
  482. clk_disable(host->clk);
  483. clk_free:
  484. clk_put(host->clk);
  485. host_free:
  486. mmc_free_host(mmc);
  487. rel_regions:
  488. amba_release_regions(dev);
  489. out:
  490. return ret;
  491. }
  492. static int mmci_remove(struct amba_device *dev)
  493. {
  494. struct mmc_host *mmc = amba_get_drvdata(dev);
  495. amba_set_drvdata(dev, NULL);
  496. if (mmc) {
  497. struct mmci_host *host = mmc_priv(mmc);
  498. del_timer_sync(&host->timer);
  499. mmc_remove_host(mmc);
  500. writel(0, host->base + MMCIMASK0);
  501. writel(0, host->base + MMCIMASK1);
  502. writel(0, host->base + MMCICOMMAND);
  503. writel(0, host->base + MMCIDATACTRL);
  504. free_irq(dev->irq[0], host);
  505. free_irq(dev->irq[1], host);
  506. iounmap(host->base);
  507. clk_disable(host->clk);
  508. clk_put(host->clk);
  509. mmc_free_host(mmc);
  510. amba_release_regions(dev);
  511. }
  512. return 0;
  513. }
  514. #ifdef CONFIG_PM
  515. static int mmci_suspend(struct amba_device *dev, pm_message_t state)
  516. {
  517. struct mmc_host *mmc = amba_get_drvdata(dev);
  518. int ret = 0;
  519. if (mmc) {
  520. struct mmci_host *host = mmc_priv(mmc);
  521. ret = mmc_suspend_host(mmc, state);
  522. if (ret == 0)
  523. writel(0, host->base + MMCIMASK0);
  524. }
  525. return ret;
  526. }
  527. static int mmci_resume(struct amba_device *dev)
  528. {
  529. struct mmc_host *mmc = amba_get_drvdata(dev);
  530. int ret = 0;
  531. if (mmc) {
  532. struct mmci_host *host = mmc_priv(mmc);
  533. writel(MCI_IRQENABLE, host->base + MMCIMASK0);
  534. ret = mmc_resume_host(mmc);
  535. }
  536. return ret;
  537. }
  538. #else
  539. #define mmci_suspend NULL
  540. #define mmci_resume NULL
  541. #endif
  542. static struct amba_id mmci_ids[] = {
  543. {
  544. .id = 0x00041180,
  545. .mask = 0x000fffff,
  546. },
  547. {
  548. .id = 0x00041181,
  549. .mask = 0x000fffff,
  550. },
  551. { 0, 0 },
  552. };
  553. static struct amba_driver mmci_driver = {
  554. .drv = {
  555. .name = DRIVER_NAME,
  556. },
  557. .probe = mmci_probe,
  558. .remove = mmci_remove,
  559. .suspend = mmci_suspend,
  560. .resume = mmci_resume,
  561. .id_table = mmci_ids,
  562. };
  563. static int __init mmci_init(void)
  564. {
  565. return amba_driver_register(&mmci_driver);
  566. }
  567. static void __exit mmci_exit(void)
  568. {
  569. amba_driver_unregister(&mmci_driver);
  570. }
  571. module_init(mmci_init);
  572. module_exit(mmci_exit);
  573. module_param(fmax, uint, 0444);
  574. MODULE_DESCRIPTION("ARM PrimeCell PL180/181 Multimedia Card Interface driver");
  575. MODULE_LICENSE("GPL");