Lines Matching full:mmc
3 * linux/drivers/mmc/host/mxcmmc.c - Freescale i.MX MMCI driver
25 #include <linux/mmc/host.h>
26 #include <linux/mmc/card.h>
35 #include <linux/mmc/slot-gpio.h>
39 #include <linux/platform_data/mmc-mxcmmc.h>
43 #define DRIVER_NAME "mxc-mmc"
120 struct mmc_host *mmc; member
161 .compatible = "fsl,imx21-mmc",
164 .compatible = "fsl,imx31-mmc",
221 if (!IS_ERR(host->mmc->supply.vmmc)) { in mxcmci_set_power()
223 mmc_regulator_set_ocr(host->mmc, in mxcmci_set_power()
224 host->mmc->supply.vmmc, vdd); in mxcmci_set_power()
226 mmc_regulator_set_ocr(host->mmc, in mxcmci_set_power()
227 host->mmc->supply.vmmc, 0); in mxcmci_set_power()
231 host->pdata->setpower(mmc_dev(host->mmc), vdd); in mxcmci_set_power()
243 dev_dbg(mmc_dev(host->mmc), "mxcmci_softreset\n"); in mxcmci_softreset()
352 dev_dbg(mmc_dev(host->mmc), "%s: 0x%08x\n", __func__, stat); in mxcmci_dma_callback()
380 dev_err(mmc_dev(host->mmc), "unhandled response type 0x%x\n", in mxcmci_start_cmd()
426 mmc_request_done(host->mmc, req); in mxcmci_finish_request()
441 dev_dbg(mmc_dev(host->mmc), "request failed. status: 0x%08x\n", in mxcmci_finish_data()
444 dev_err(mmc_dev(host->mmc), "%s: -EILSEQ\n", __func__); in mxcmci_finish_data()
449 dev_err(mmc_dev(host->mmc), in mxcmci_finish_data()
453 dev_err(mmc_dev(host->mmc), in mxcmci_finish_data()
458 dev_err(mmc_dev(host->mmc), in mxcmci_finish_data()
462 dev_err(mmc_dev(host->mmc), "%s: -EIO\n", __func__); in mxcmci_finish_data()
486 dev_dbg(mmc_dev(host->mmc), "CMD TIMEOUT\n"); in mxcmci_read_response()
489 dev_dbg(mmc_dev(host->mmc), "cmd crc error\n"); in mxcmci_read_response()
709 dev_dbg(mmc_dev(host->mmc), "%s: 0x%08x\n", __func__, stat); in mxcmci_irq()
720 mmc_signal_sdio_irq(host->mmc); in mxcmci_irq()
733 mmc_detect_change(host->mmc, msecs_to_jiffies(200)); in mxcmci_irq()
738 static void mxcmci_request(struct mmc_host *mmc, struct mmc_request *req) in mxcmci_request() argument
740 struct mxcmci_host *host = mmc_priv(mmc); in mxcmci_request()
802 dev_dbg(mmc_dev(host->mmc), "scaler: %d divider: %d in: %d out: %d\n", in mxcmci_set_clk_rate()
806 static int mxcmci_setup_dma(struct mmc_host *mmc) in mxcmci_setup_dma() argument
808 struct mxcmci_host *host = mmc_priv(mmc); in mxcmci_setup_dma()
822 static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in mxcmci_set_ios() argument
824 struct mxcmci_host *host = mmc_priv(mmc); in mxcmci_set_ios()
838 ret = mxcmci_setup_dma(mmc); in mxcmci_set_ios()
840 dev_err(mmc_dev(host->mmc), in mxcmci_set_ios()
873 struct mmc_host *mmc = data; in mxcmci_detect_irq() local
875 dev_dbg(mmc_dev(mmc), "%s\n", __func__); in mxcmci_detect_irq()
877 mmc_detect_change(mmc, msecs_to_jiffies(250)); in mxcmci_detect_irq()
881 static int mxcmci_get_ro(struct mmc_host *mmc) in mxcmci_get_ro() argument
883 struct mxcmci_host *host = mmc_priv(mmc); in mxcmci_get_ro()
886 return !!host->pdata->get_ro(mmc_dev(mmc)); in mxcmci_get_ro()
889 * context or gpio is invalid), then let the mmc core decide in mxcmci_get_ro()
892 return mmc_gpio_get_ro(mmc); in mxcmci_get_ro()
895 static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable) in mxcmci_enable_sdio_irq() argument
897 struct mxcmci_host *host = mmc_priv(mmc); in mxcmci_enable_sdio_irq()
951 dev_err(mmc_dev(host->mmc), in mxcmci_watchdog()
955 dev_err(mmc_dev(host->mmc), in mxcmci_watchdog()
968 mmc_request_done(host->mmc, req); in mxcmci_watchdog()
981 struct mmc_host *mmc; in mxcmci_probe() local
995 mmc = mmc_alloc_host(sizeof(*host), &pdev->dev); in mxcmci_probe()
996 if (!mmc) in mxcmci_probe()
999 host = mmc_priv(mmc); in mxcmci_probe()
1009 ret = mmc_of_parse(mmc); in mxcmci_probe()
1012 mmc->ops = &mxcmci_ops; in mxcmci_probe()
1016 mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; in mxcmci_probe()
1018 mmc->caps |= MMC_CAP_SDIO_IRQ; in mxcmci_probe()
1020 /* MMC core transfer sizes tunable parameters */ in mxcmci_probe()
1021 mmc->max_blk_size = 2048; in mxcmci_probe()
1022 mmc->max_blk_count = 65535; in mxcmci_probe()
1023 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; in mxcmci_probe()
1024 mmc->max_seg_size = mmc->max_req_size; in mxcmci_probe()
1030 mmc->max_segs = 64; in mxcmci_probe()
1032 host->mmc = mmc; in mxcmci_probe()
1038 else if (mmc_card_is_removable(mmc) in mxcmci_probe()
1042 ret = mmc_regulator_get_supply(mmc); in mxcmci_probe()
1046 if (!mmc->ocr_avail) { in mxcmci_probe()
1048 mmc->ocr_avail = pdata->ocr_avail; in mxcmci_probe()
1050 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; in mxcmci_probe()
1084 dev_err(mmc_dev(host->mmc), "wrong rev.no. 0x%08x. aborting.\n", in mxcmci_probe()
1089 mmc->f_min = clk_get_rate(host->clk_per) >> 16; in mxcmci_probe()
1090 mmc->f_max = clk_get_rate(host->clk_per) >> 1; in mxcmci_probe()
1121 mmc->max_seg_size = dma_get_max_seg_size( in mxcmci_probe()
1124 dev_info(mmc_dev(host->mmc), "dma not available. Using PIO\n"); in mxcmci_probe()
1133 platform_set_drvdata(pdev, mmc); in mxcmci_probe()
1137 host->mmc); in mxcmci_probe()
1144 ret = mmc_add_host(mmc); in mxcmci_probe()
1160 mmc_free_host(mmc); in mxcmci_probe()
1167 struct mmc_host *mmc = platform_get_drvdata(pdev); in mxcmci_remove() local
1168 struct mxcmci_host *host = mmc_priv(mmc); in mxcmci_remove()
1170 mmc_remove_host(mmc); in mxcmci_remove()
1173 host->pdata->exit(&pdev->dev, mmc); in mxcmci_remove()
1181 mmc_free_host(mmc); in mxcmci_remove()
1186 struct mmc_host *mmc = dev_get_drvdata(dev); in mxcmci_suspend() local
1187 struct mxcmci_host *host = mmc_priv(mmc); in mxcmci_suspend()
1196 struct mmc_host *mmc = dev_get_drvdata(dev); in mxcmci_resume() local
1197 struct mxcmci_host *host = mmc_priv(mmc); in mxcmci_resume()
1229 MODULE_ALIAS("platform:mxc-mmc");