aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mxs-mmc.c48
1 files changed, 5 insertions, 43 deletions
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 146a53bfab71..4278a1787d08 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -552,22 +552,6 @@ static const struct mmc_host_ops mxs_mmc_ops = {
552 .enable_sdio_irq = mxs_mmc_enable_sdio_irq, 552 .enable_sdio_irq = mxs_mmc_enable_sdio_irq,
553}; 553};
554 554
555static bool mxs_mmc_dma_filter(struct dma_chan *chan, void *param)
556{
557 struct mxs_mmc_host *host = param;
558 struct mxs_ssp *ssp = &host->ssp;
559
560 if (!mxs_dma_is_apbh(chan))
561 return false;
562
563 if (chan->chan_id != ssp->dma_channel)
564 return false;
565
566 chan->private = &ssp->dma_data;
567
568 return true;
569}
570
571static struct platform_device_id mxs_ssp_ids[] = { 555static struct platform_device_id mxs_ssp_ids[] = {
572 { 556 {
573 .name = "imx23-mmc", 557 .name = "imx23-mmc",
@@ -595,20 +579,17 @@ static int mxs_mmc_probe(struct platform_device *pdev)
595 struct device_node *np = pdev->dev.of_node; 579 struct device_node *np = pdev->dev.of_node;
596 struct mxs_mmc_host *host; 580 struct mxs_mmc_host *host;
597 struct mmc_host *mmc; 581 struct mmc_host *mmc;
598 struct resource *iores, *dmares; 582 struct resource *iores;
599 struct pinctrl *pinctrl; 583 struct pinctrl *pinctrl;
600 int ret = 0, irq_err, irq_dma; 584 int ret = 0, irq_err;
601 dma_cap_mask_t mask;
602 struct regulator *reg_vmmc; 585 struct regulator *reg_vmmc;
603 enum of_gpio_flags flags; 586 enum of_gpio_flags flags;
604 struct mxs_ssp *ssp; 587 struct mxs_ssp *ssp;
605 u32 bus_width = 0; 588 u32 bus_width = 0;
606 589
607 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); 590 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
608 dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
609 irq_err = platform_get_irq(pdev, 0); 591 irq_err = platform_get_irq(pdev, 0);
610 irq_dma = platform_get_irq(pdev, 1); 592 if (!iores || irq_err < 0)
611 if (!iores || irq_err < 0 || irq_dma < 0)
612 return -EINVAL; 593 return -EINVAL;
613 594
614 mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev); 595 mmc = mmc_alloc_host(sizeof(struct mxs_mmc_host), &pdev->dev);
@@ -624,23 +605,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
624 goto out_mmc_free; 605 goto out_mmc_free;
625 } 606 }
626 607
627 if (np) { 608 ssp->devid = (enum mxs_ssp_id) of_id->data;
628 ssp->devid = (enum mxs_ssp_id) of_id->data;
629 /*
630 * TODO: This is a temporary solution and should be changed
631 * to use generic DMA binding later when the helpers get in.
632 */
633 ret = of_property_read_u32(np, "fsl,ssp-dma-channel",
634 &ssp->dma_channel);
635 if (ret) {
636 dev_err(mmc_dev(host->mmc),
637 "failed to get dma channel\n");
638 goto out_mmc_free;
639 }
640 } else {
641 ssp->devid = pdev->id_entry->driver_data;
642 ssp->dma_channel = dmares->start;
643 }
644 609
645 host->mmc = mmc; 610 host->mmc = mmc;
646 host->sdio_irq_en = 0; 611 host->sdio_irq_en = 0;
@@ -670,10 +635,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
670 635
671 mxs_mmc_reset(host); 636 mxs_mmc_reset(host);
672 637
673 dma_cap_zero(mask); 638 ssp->dmach = dma_request_slave_channel(&pdev->dev, "rx-tx");
674 dma_cap_set(DMA_SLAVE, mask);
675 ssp->dma_data.chan_irq = irq_dma;
676 ssp->dmach = dma_request_channel(mask, mxs_mmc_dma_filter, host);
677 if (!ssp->dmach) { 639 if (!ssp->dmach) {
678 dev_err(mmc_dev(host->mmc), 640 dev_err(mmc_dev(host->mmc),
679 "%s: failed to request dma\n", __func__); 641 "%s: failed to request dma\n", __func__);