Lines Matching full:mmc
3 * linux/drivers/mmc/host/pxa.c - PXA MMCI driver
26 #include <linux/mmc/host.h>
27 #include <linux/mmc/slot-gpio.h>
37 #include <linux/platform_data/mmc-pxamci.h>
50 struct mmc_host *mmc; member
78 struct mmc_host *mmc = host->mmc; in pxamci_init_ocr() local
81 ret = mmc_regulator_get_supply(mmc); in pxamci_init_ocr()
85 if (IS_ERR(mmc->supply.vmmc)) { in pxamci_init_ocr()
87 mmc->ocr_avail = host->pdata ? in pxamci_init_ocr()
99 struct mmc_host *mmc = host->mmc; in pxamci_set_power() local
100 struct regulator *supply = mmc->supply.vmmc; in pxamci_set_power()
103 return mmc_regulator_set_ocr(mmc, supply, vdd); in pxamci_set_power()
111 return host->pdata->setpower(mmc_dev(host->mmc), vdd); in pxamci_set_power()
132 dev_err(mmc_dev(host->mmc), "unable to stop clock\n"); in pxamci_stop_clock()
201 dev_err(mmc_dev(host->mmc), "dma slave config failed\n"); in pxamci_setup_data()
211 dev_err(mmc_dev(host->mmc), "prep_slave_sg() failed\n"); in pxamci_setup_data()
271 mmc_request_done(host->mmc, mrq); in pxamci_finish_request()
391 mmc_signal_sdio_irq(host->mmc); in pxamci_irq()
399 static void pxamci_request(struct mmc_host *mmc, struct mmc_request *mrq) in pxamci_request() argument
401 struct pxamci_host *host = mmc_priv(mmc); in pxamci_request()
425 static int pxamci_get_ro(struct mmc_host *mmc) in pxamci_get_ro() argument
427 struct pxamci_host *host = mmc_priv(mmc); in pxamci_get_ro()
430 return mmc_gpio_get_ro(mmc); in pxamci_get_ro()
432 return !!host->pdata->get_ro(mmc_dev(mmc)); in pxamci_get_ro()
434 * Board doesn't support read only detection; let the mmc core in pxamci_get_ro()
440 static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) in pxamci_set_ios() argument
442 struct pxamci_host *host = mmc_priv(mmc); in pxamci_set_ios()
487 dev_err(mmc_dev(mmc), "unable to set power\n"); in pxamci_set_ios()
506 dev_dbg(mmc_dev(mmc), "PXAMCI: clkrt = %x cmdat = %x\n", in pxamci_set_ios()
551 pr_err("%s: DMA error on %s channel\n", mmc_hostname(host->mmc), in pxamci_dma_irq()
571 { .compatible = "marvell,pxa-mmc" },
578 struct mmc_host *mmc) in pxamci_of_init() argument
581 struct pxamci_host *host = mmc_priv(mmc); in pxamci_of_init()
588 /* pxa-mmc specific */ in pxamci_of_init()
589 if (of_property_read_u32(np, "pxa-mmc,detect-delay-ms", &tmp) == 0) in pxamci_of_init()
592 ret = mmc_of_parse(mmc); in pxamci_of_init()
600 struct mmc_host *mmc) in pxamci_of_init() argument
608 struct mmc_host *mmc; in pxamci_probe() local
618 mmc = mmc_alloc_host(sizeof(struct pxamci_host), dev); in pxamci_probe()
619 if (!mmc) { in pxamci_probe()
624 mmc->ops = &pxamci_ops; in pxamci_probe()
630 mmc->max_segs = NR_SG; in pxamci_probe()
635 mmc->max_seg_size = PAGE_SIZE; in pxamci_probe()
640 mmc->max_blk_size = cpu_is_pxa25x() ? 1023 : 2048; in pxamci_probe()
645 mmc->max_blk_count = 65535; in pxamci_probe()
647 ret = pxamci_of_init(pdev, mmc); in pxamci_probe()
651 host = mmc_priv(mmc); in pxamci_probe()
652 host->mmc = mmc; in pxamci_probe()
668 mmc->f_min = (host->clkrate + 63) / 64; in pxamci_probe()
669 mmc->f_max = (mmc_has_26MHz()) ? 26000000 : host->clkrate; in pxamci_probe()
675 mmc->caps = 0; in pxamci_probe()
678 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; in pxamci_probe()
681 mmc->caps |= MMC_CAP_MMC_HIGHSPEED | in pxamci_probe()
709 platform_set_drvdata(pdev, mmc); in pxamci_probe()
738 ret = mmc_gpiod_request_cd(mmc, "cd", 0, false, 0); in pxamci_probe()
745 mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; in pxamci_probe()
747 ret = mmc_gpiod_request_ro(mmc, "wp", 0, 0); in pxamci_probe()
756 host->pdata->init(dev, pxamci_detect_irq, mmc); in pxamci_probe()
764 ret = mmc_add_host(mmc); in pxamci_probe()
767 host->pdata->exit(dev, mmc); in pxamci_probe()
780 if (mmc) in pxamci_probe()
781 mmc_free_host(mmc); in pxamci_probe()
787 struct mmc_host *mmc = platform_get_drvdata(pdev); in pxamci_remove() local
789 if (mmc) { in pxamci_remove()
790 struct pxamci_host *host = mmc_priv(mmc); in pxamci_remove()
792 mmc_remove_host(mmc); in pxamci_remove()
795 host->pdata->exit(&pdev->dev, mmc); in pxamci_remove()
807 mmc_free_host(mmc); in pxamci_remove()