Lines Matching full:mmc
4 * Portions copyright (C) 2004-2005 Pierre Ossman, W83L51xD SD/MMC driver
24 #include <linux/mmc/host.h>
25 #include <linux/mmc/mmc.h>
26 #include <linux/mmc/sdio.h>
27 #include <linux/mmc/slot-gpio.h>
33 #define DRIVER_NAME "mxs-mmc"
50 struct mmc_host *mmc; member
61 static int mxs_mmc_get_cd(struct mmc_host *mmc) in mxs_mmc_get_cd() argument
63 struct mxs_mmc_host *host = mmc_priv(mmc); in mxs_mmc_get_cd()
70 ret = mmc_gpio_get_cd(mmc); in mxs_mmc_get_cd()
74 present = mmc->caps & MMC_CAP_NEEDS_POLL || in mxs_mmc_get_cd()
78 if (mmc->caps2 & MMC_CAP2_CD_ACTIVE_HIGH) in mxs_mmc_get_cd()
146 dma_unmap_sg(mmc_dev(host->mmc), data->sg, in mxs_mmc_request_done()
165 mmc_request_done(host->mmc, mrq); in mxs_mmc_request_done()
192 mmc_signal_sdio_irq(host->mmc); in mxs_mmc_irq_handler()
224 dma_map_sg(mmc_dev(host->mmc), data->sg, in mxs_mmc_prep_dma()
241 dma_unmap_sg(mmc_dev(host->mmc), data->sg, in mxs_mmc_prep_dma()
278 dev_warn(mmc_dev(host->mmc), in mxs_mmc_bc()
323 dev_warn(mmc_dev(host->mmc), in mxs_mmc_ac()
452 dev_warn(mmc_dev(host->mmc), in mxs_mmc_adtc()
475 dev_warn(mmc_dev(host->mmc), in mxs_mmc_start_cmd()
476 "%s: unknown MMC command\n", __func__); in mxs_mmc_start_cmd()
481 static void mxs_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) in mxs_mmc_request() argument
483 struct mxs_mmc_host *host = mmc_priv(mmc); in mxs_mmc_request()
494 static void mxs_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in mxs_mmc_set_ios() argument
496 struct mxs_mmc_host *host = mmc_priv(mmc); in mxs_mmc_set_ios()
509 static void mxs_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) in mxs_mmc_enable_sdio_irq() argument
511 struct mxs_mmc_host *host = mmc_priv(mmc); in mxs_mmc_enable_sdio_irq()
535 mmc_signal_sdio_irq(host->mmc); in mxs_mmc_enable_sdio_irq()
548 { .compatible = "fsl,imx23-mmc", .data = (void *) IMX23_SSP, },
549 { .compatible = "fsl,imx28-mmc", .data = (void *) IMX28_SSP, },
563 struct mmc_host *mmc; in mxs_mmc_probe() local
572 mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev); in mxs_mmc_probe()
573 if (!mmc) in mxs_mmc_probe()
576 host = mmc_priv(mmc); in mxs_mmc_probe()
587 host->mmc = mmc; in mxs_mmc_probe()
616 dev_err(&pdev->dev, "Failed to reset mmc: %d\n", ret); in mxs_mmc_probe()
622 dev_err(mmc_dev(host->mmc), in mxs_mmc_probe()
628 /* set mmc core parameters */ in mxs_mmc_probe()
629 mmc->ops = &mxs_mmc_ops; in mxs_mmc_probe()
630 mmc->caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | in mxs_mmc_probe()
635 mmc->f_min = 400000; in mxs_mmc_probe()
636 mmc->f_max = 288000000; in mxs_mmc_probe()
638 ret = mmc_of_parse(mmc); in mxs_mmc_probe()
642 mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; in mxs_mmc_probe()
644 mmc->max_segs = 52; in mxs_mmc_probe()
645 mmc->max_blk_size = 1 << 0xf; in mxs_mmc_probe()
646 mmc->max_blk_count = (ssp_is_old(ssp)) ? 0xff : 0xffffff; in mxs_mmc_probe()
647 mmc->max_req_size = (ssp_is_old(ssp)) ? 0xffff : 0xffffffff; in mxs_mmc_probe()
648 mmc->max_seg_size = dma_get_max_seg_size(ssp->dmach->device->dev); in mxs_mmc_probe()
650 platform_set_drvdata(pdev, mmc); in mxs_mmc_probe()
659 ret = mmc_add_host(mmc); in mxs_mmc_probe()
663 dev_info(mmc_dev(host->mmc), "initialized\n"); in mxs_mmc_probe()
672 mmc_free_host(mmc); in mxs_mmc_probe()
678 struct mmc_host *mmc = platform_get_drvdata(pdev); in mxs_mmc_remove() local
679 struct mxs_mmc_host *host = mmc_priv(mmc); in mxs_mmc_remove()
682 mmc_remove_host(mmc); in mxs_mmc_remove()
689 mmc_free_host(mmc); in mxs_mmc_remove()
695 struct mmc_host *mmc = dev_get_drvdata(dev); in mxs_mmc_suspend() local
696 struct mxs_mmc_host *host = mmc_priv(mmc); in mxs_mmc_suspend()
705 struct mmc_host *mmc = dev_get_drvdata(dev); in mxs_mmc_resume() local
706 struct mxs_mmc_host *host = mmc_priv(mmc); in mxs_mmc_resume()
728 MODULE_DESCRIPTION("FREESCALE MXS MMC peripheral");