Lines Matching refs:mmc

2  *  linux/drivers/mmc/host/mmci.c - ARM PrimeCell MMCI PL180/1 driver
22 #include <linux/mmc/host.h>
23 #include <linux/mmc/card.h>
151 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4)
153 if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8)
174 pm_runtime_put(mmc_dev(host->mmc));
175 mmc_request_done(host->mmc, mrq);
227 dev_info(mmc_dev(host->mmc), "no DMA platform data\n");
249 dev_err(mmc_dev(host->mmc), "no RX DMA channel\n");
257 dev_warn(mmc_dev(host->mmc), "no TX DMA channel\n");
272 dev_info(mmc_dev(host->mmc), "DMA channels RX %s, TX %s\n",
283 if (max_seg_size < host->mmc->max_seg_size)
284 host->mmc->max_seg_size = max_seg_size;
290 if (max_seg_size < host->mmc->max_seg_size)
291 host->mmc->max_seg_size = max_seg_size;
351 dev_err(mmc_dev(host->mmc), "buggy DMA detected. Taking evasive action.\n");
358 dev_err(mmc_dev(host->mmc), "error during DMA transfer!\n");
446 dev_vdbg(mmc_dev(host->mmc),
488 static void mmci_pre_request(struct mmc_host *mmc, struct mmc_request *mrq,
491 struct mmci_host *host = mmc_priv(mmc);
513 static void mmci_post_request(struct mmc_host *mmc, struct mmc_request *mrq,
516 struct mmci_host *host = mmc_priv(mmc);
538 dma_unmap_sg(mmc_dev(host->mmc), data->sg,
583 dev_dbg(mmc_dev(host->mmc), "blksz %04x blks %04x flags %08x\n",
639 if (variant->sdio && host->mmc->card)
640 if (mmc_card_sdio(host->mmc->card))
653 dev_dbg(mmc_dev(host->mmc), "op %02x arg %08x flags %08x\n",
699 dev_dbg(mmc_dev(host->mmc), "MCI ERROR IRQ, status 0x%08x at 0x%08x\n",
722 dev_err(mmc_dev(host->mmc), "stray MCI_DATABLOCKEND interrupt\n");
823 mmc_card_sdio(host->mmc->card)) {
870 dev_dbg(mmc_dev(host->mmc), "irq1 (pio) %08x\n", status);
963 dev_dbg(mmc_dev(host->mmc), "irq0 (data+cmd) %08x\n", status);
983 static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
985 struct mmci_host *host = mmc_priv(mmc);
991 dev_err(mmc_dev(mmc), "unsupported block size (%d bytes)\n",
994 mmc_request_done(mmc, mrq);
998 pm_runtime_get_sync(mmc_dev(mmc));
1015 static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1017 struct mmci_host *host = mmc_priv(mmc);
1025 ret = mmc_regulator_set_ocr(mmc, host->vcc, 0);
1029 ret = mmc_regulator_set_ocr(mmc, host->vcc, ios->vdd);
1031 dev_err(mmc_dev(mmc), "unable to set OCR\n");
1042 pwr |= host->plat->vdd_handler(mmc_dev(mmc), ios->vdd,
1078 static int mmci_get_ro(struct mmc_host *mmc)
1080 struct mmci_host *host = mmc_priv(mmc);
1088 static int mmci_get_cd(struct mmc_host *mmc)
1090 struct mmci_host *host = mmc_priv(mmc);
1098 status = plat->status(mmc_dev(host->mmc));
1114 mmc_detect_change(host->mmc, msecs_to_jiffies(500));
1134 struct mmc_host *mmc;
1147 mmc = mmc_alloc_host(sizeof(struct mmci_host), &dev->dev);
1148 if (!mmc) {
1153 host = mmc_priv(mmc);
1154 host->mmc = mmc;
1162 dev_dbg(mmc_dev(mmc), "designer ID = 0x%02x\n", host->hw_designer);
1163 dev_dbg(mmc_dev(mmc), "revision = 0x%01x\n", host->hw_revision);
1193 dev_dbg(mmc_dev(mmc), "eventual mclk rate: %u Hz\n",
1203 mmc->ops = &mmci_ops;
1210 mmc->f_min = DIV_ROUND_UP(host->mclk, 257);
1212 mmc->f_min = DIV_ROUND_UP(host->mclk, 512);
1222 mmc->f_max = min(host->mclk, plat->f_max);
1224 mmc->f_max = min(host->mclk, fmax);
1225 dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max);
1239 host->mmc->ocr_avail = (u32) mask;
1249 mmc->ocr_avail = plat->ocr_mask;
1250 mmc->caps = plat->capabilities;
1251 mmc->caps2 = plat->capabilities2;
1256 mmc->max_segs = NR_SG;
1263 mmc->max_req_size = (1 << variant->datalength_bits) - 1;
1269 mmc->max_seg_size = mmc->max_req_size;
1274 mmc->max_blk_size = 2048;
1279 mmc->max_blk_count = mmc->max_req_size;
1322 mmc->caps |= MMC_CAP_NEEDS_POLL;
1339 amba_set_drvdata(dev, mmc);
1342 mmc_hostname(mmc), amba_part(dev), amba_manf(dev),
1350 mmc_add_host(mmc);
1373 mmc_free_host(mmc);
1382 struct mmc_host *mmc = amba_get_drvdata(dev);
1386 if (mmc) {
1387 struct mmci_host *host = mmc_priv(mmc);
1395 mmc_remove_host(mmc);
1421 mmc_regulator_set_ocr(mmc, host->vcc, 0);
1424 mmc_free_host(mmc);
1435 struct mmc_host *mmc = amba_get_drvdata(dev);
1438 if (mmc) {
1439 struct mmci_host *host = mmc_priv(mmc);
1441 ret = mmc_suspend_host(mmc);
1451 struct mmc_host *mmc = amba_get_drvdata(dev);
1454 if (mmc) {
1455 struct mmci_host *host = mmc_priv(mmc);
1459 ret = mmc_resume_host(mmc);