diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-26 11:00:41 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-26 11:00:41 -0800 |
commit | ccc039d65f24172eebab5e0160462d3417799af5 (patch) | |
tree | c02513223bebadd57da5b6648a497f99684111e2 /drivers/mmc/host/mxs-mmc.c | |
parent | 1c2948380b699dfdbb25a7de740392dd9e6f0613 (diff) | |
parent | 945be38caa287b177b8c17ffaae7754cab6a658f (diff) | |
download | blackbird-op-linux-ccc039d65f24172eebab5e0160462d3417799af5.tar.gz blackbird-op-linux-ccc039d65f24172eebab5e0160462d3417799af5.zip |
Merge tag 'mmc-updates-for-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
Pull MMC updates from Chris Ball:
"MMC highlights for 3.14:
Core:
- Avoid get_cd() on cards marked nonremovable
Drivers:
- arasan: New driver for controllers found in e.g. Xilinx Zynq SoC
- dwmmc: Support Hisilicon K3 SoC controllers
- esdhc-imx: Support for HS200 mode, DDR modes on MX6, runtime PM
- sdhci-pci: Support O2Micro/BayHubTech controllers used in laptops
like Lenovo ThinkPad W540, Dell Latitude E5440, Dell Latitude E6540
- tegra: Support Tegra124 SoCs"
* tag 'mmc-updates-for-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (55 commits)
mmc: sdhci-pci: Fix possibility of chip->fixes being null
mmc: sdhci-pci: Fix BYT sd card getting stuck in runtime suspend
mmc: sdhci: Allow for long command timeouts
mmc: sdio: add a quirk for broken SDIO_CCCR_INTx polling
mmc: sdhci: fix lockdep error in tuning routine
mmc: dw_mmc: k3: remove clk_table
mmc: dw_mmc: fix dw_mci_get_cd
mmc: dw_mmc: fix sparse non static symbol warning
mmc: sdhci-esdhc-imx: fix warning during module remove function
mmc: sdhci-esdhc-imx: fix access hardirq-unsafe lock in atomic context
mmc: core: sd: implement proper support for sd3.0 au sizes
mmc: atmel-mci: add vmmc-supply support
mmc: sdhci-pci: add broken HS200 quirk for Intel Merrifield
mmc: sdhci: add quirk for broken HS200 support
mmc: arasan: Add driver for Arasan SDHCI
mmc: dw_mmc: add dw_mmc-k3 for k3 platform
mmc: dw_mmc: use slot-gpio to handle cd pin
mmc: sdhci-pci: add support of O2Micro/BayHubTech SD hosts
mmc: sdhci-pci: break out definitions to header file
mmc: tmio: fixup compile error
...
Conflicts:
MAINTAINERS
Diffstat (limited to 'drivers/mmc/host/mxs-mmc.c')
-rw-r--r-- | drivers/mmc/host/mxs-mmc.c | 60 |
1 files changed, 18 insertions, 42 deletions
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index 50fc9df791b2..073e871a0fc8 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -38,6 +38,7 @@ #include <linux/mmc/host.h> #include <linux/mmc/mmc.h> #include <linux/mmc/sdio.h> +#include <linux/mmc/slot-gpio.h> #include <linux/gpio.h> #include <linux/regulator/consumer.h> #include <linux/module.h> @@ -69,37 +70,25 @@ struct mxs_mmc_host { unsigned char bus_width; spinlock_t lock; int sdio_irq_en; - int wp_gpio; - bool wp_inverted; - bool cd_inverted; - bool broken_cd; - bool non_removable; }; -static int mxs_mmc_get_ro(struct mmc_host *mmc) +static int mxs_mmc_get_cd(struct mmc_host *mmc) { struct mxs_mmc_host *host = mmc_priv(mmc); - int ret; - - if (!gpio_is_valid(host->wp_gpio)) - return -EINVAL; - - ret = gpio_get_value(host->wp_gpio); + struct mxs_ssp *ssp = &host->ssp; + int present, ret; - if (host->wp_inverted) - ret = !ret; + ret = mmc_gpio_get_cd(mmc); + if (ret >= 0) + return ret; - return ret; -} + present = !(readl(ssp->base + HW_SSP_STATUS(ssp)) & + BM_SSP_STATUS_CARD_DETECT); -static int mxs_mmc_get_cd(struct mmc_host *mmc) -{ - struct mxs_mmc_host *host = mmc_priv(mmc); - struct mxs_ssp *ssp = &host->ssp; + if (mmc->caps2 & MMC_CAP2_CD_ACTIVE_HIGH) + present = !present; - return host->non_removable || host->broken_cd || - !(readl(ssp->base + HW_SSP_STATUS(ssp)) & - BM_SSP_STATUS_CARD_DETECT) ^ host->cd_inverted; + return present; } static int mxs_mmc_reset(struct mxs_mmc_host *host) @@ -549,7 +538,7 @@ static void mxs_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable) static const struct mmc_host_ops mxs_mmc_ops = { .request = mxs_mmc_request, - .get_ro = mxs_mmc_get_ro, + .get_ro = mmc_gpio_get_ro, .get_cd = mxs_mmc_get_cd, .set_ios = mxs_mmc_set_ios, .enable_sdio_irq = mxs_mmc_enable_sdio_irq, @@ -579,15 +568,12 @@ static int mxs_mmc_probe(struct platform_device *pdev) { const struct of_device_id *of_id = of_match_device(mxs_mmc_dt_ids, &pdev->dev); - struct device_node *np = pdev->dev.of_node; struct mxs_mmc_host *host; struct mmc_host *mmc; struct resource *iores; int ret = 0, irq_err; struct regulator *reg_vmmc; - enum of_gpio_flags flags; struct mxs_ssp *ssp; - u32 bus_width = 0; iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); irq_err = platform_get_irq(pdev, 0); @@ -648,23 +634,13 @@ static int mxs_mmc_probe(struct platform_device *pdev) mmc->caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SDIO_IRQ | MMC_CAP_NEEDS_POLL; - of_property_read_u32(np, "bus-width", &bus_width); - if (bus_width == 4) - mmc->caps |= MMC_CAP_4_BIT_DATA; - else if (bus_width == 8) - mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; - host->broken_cd = of_property_read_bool(np, "broken-cd"); - host->non_removable = of_property_read_bool(np, "non-removable"); - if (host->non_removable) - mmc->caps |= MMC_CAP_NONREMOVABLE; - host->wp_gpio = of_get_named_gpio_flags(np, "wp-gpios", 0, &flags); - if (flags & OF_GPIO_ACTIVE_LOW) - host->wp_inverted = 1; - - host->cd_inverted = of_property_read_bool(np, "cd-inverted"); - mmc->f_min = 400000; mmc->f_max = 288000000; + + ret = mmc_of_parse(mmc); + if (ret) + goto out_clk_disable; + mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; mmc->max_segs = 52; |