aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/mxs-mmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/mxs-mmc.c')
-rw-r--r--drivers/mmc/host/mxs-mmc.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 80d1e6d4b0ae..206fe499ded5 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -43,7 +43,6 @@
43#include <linux/module.h> 43#include <linux/module.h>
44#include <linux/pinctrl/consumer.h> 44#include <linux/pinctrl/consumer.h>
45#include <linux/stmp_device.h> 45#include <linux/stmp_device.h>
46#include <linux/mmc/mxs-mmc.h>
47#include <linux/spi/mxs-spi.h> 46#include <linux/spi/mxs-spi.h>
48 47
49#define DRIVER_NAME "mxs-mmc" 48#define DRIVER_NAME "mxs-mmc"
@@ -593,13 +592,13 @@ static int mxs_mmc_probe(struct platform_device *pdev)
593 struct mxs_mmc_host *host; 592 struct mxs_mmc_host *host;
594 struct mmc_host *mmc; 593 struct mmc_host *mmc;
595 struct resource *iores, *dmares; 594 struct resource *iores, *dmares;
596 struct mxs_mmc_platform_data *pdata;
597 struct pinctrl *pinctrl; 595 struct pinctrl *pinctrl;
598 int ret = 0, irq_err, irq_dma; 596 int ret = 0, irq_err, irq_dma;
599 dma_cap_mask_t mask; 597 dma_cap_mask_t mask;
600 struct regulator *reg_vmmc; 598 struct regulator *reg_vmmc;
601 enum of_gpio_flags flags; 599 enum of_gpio_flags flags;
602 struct mxs_ssp *ssp; 600 struct mxs_ssp *ssp;
601 u32 bus_width = 0;
603 602
604 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); 603 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
605 dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0); 604 dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
@@ -682,25 +681,15 @@ static int mxs_mmc_probe(struct platform_device *pdev)
682 mmc->caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | 681 mmc->caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED |
683 MMC_CAP_SDIO_IRQ | MMC_CAP_NEEDS_POLL; 682 MMC_CAP_SDIO_IRQ | MMC_CAP_NEEDS_POLL;
684 683
685 pdata = mmc_dev(host->mmc)->platform_data; 684 of_property_read_u32(np, "bus-width", &bus_width);
686 if (!pdata) { 685 if (bus_width == 4)
687 u32 bus_width = 0; 686 mmc->caps |= MMC_CAP_4_BIT_DATA;
688 of_property_read_u32(np, "bus-width", &bus_width); 687 else if (bus_width == 8)
689 if (bus_width == 4) 688 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
690 mmc->caps |= MMC_CAP_4_BIT_DATA; 689 host->wp_gpio = of_get_named_gpio_flags(np, "wp-gpios", 0, &flags);
691 else if (bus_width == 8) 690
692 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; 691 if (flags & OF_GPIO_ACTIVE_LOW)
693 host->wp_gpio = of_get_named_gpio_flags(np, "wp-gpios", 0, 692 host->wp_inverted = 1;
694 &flags);
695 if (flags & OF_GPIO_ACTIVE_LOW)
696 host->wp_inverted = 1;
697 } else {
698 if (pdata->flags & SLOTF_8_BIT_CAPABLE)
699 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
700 if (pdata->flags & SLOTF_4_BIT_CAPABLE)
701 mmc->caps |= MMC_CAP_4_BIT_DATA;
702 host->wp_gpio = pdata->wp_gpio;
703 }
704 693
705 mmc->f_min = 400000; 694 mmc->f_min = 400000;
706 mmc->f_max = 288000000; 695 mmc->f_max = 288000000;