aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2012-10-31 07:22:58 -0400
committerChris Ball <cjb@laptop.org>2012-12-06 13:54:44 -0500
commitd6ed91aff64891fb4f0e9557d9b1734a9e8410a7 (patch)
tree311723710c3ed86b45abb49bfa8fac588158cfd9
parent968a64ea638bbd48839b41981ff50197f3412676 (diff)
mmc: mxs-mmc: Remove platform data
All MXS users have been converted to device tree and the board files have been removed. No need to keep platform data in the driver. Also move bus_width declaration in the beggining of mxs_mmc_probe() to avoid: 'warning: ISO C90 forbids mixed declarations and code'. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/host/mxs-mmc.c31
-rw-r--r--include/linux/mmc/mxs-mmc.h19
2 files changed, 10 insertions, 40 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;
diff --git a/include/linux/mmc/mxs-mmc.h b/include/linux/mmc/mxs-mmc.h
deleted file mode 100644
index 7c2ad3a7f2f3..000000000000
--- a/include/linux/mmc/mxs-mmc.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __LINUX_MMC_MXS_MMC_H__
10#define __LINUX_MMC_MXS_MMC_H__
11
12struct mxs_mmc_platform_data {
13 int wp_gpio; /* write protect pin */
14 unsigned int flags;
15#define SLOTF_4_BIT_CAPABLE (1 << 0)
16#define SLOTF_8_BIT_CAPABLE (1 << 1)
17};
18
19#endif /* __LINUX_MMC_MXS_MMC_H__ */