aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ep93xx
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-09-10 16:33:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-10 16:33:09 -0400
commitd0048f0b91ee35ab940ec6cbdfdd238c55b12a14 (patch)
tree72914692414729a14ec1308c326d92359a3825a3 /arch/arm/mach-ep93xx
parent7426d62871dafbeeed087d609c6469a515c88389 (diff)
parent9d731e7539713acc0ec7b67a5a91357c455d2334 (diff)
Merge tag 'mmc-updates-for-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
Pull MMC updates from Chris Ball: "MMC highlights for 3.12: Core: - Support Allocation Units 8MB-64MB in SD3.0, previous max was 4MB. - The slot-gpio helper can now handle GPIO debouncing card-detect. - Read supported voltages from DT "voltage-ranges" property. Drivers: - dw_mmc: Add support for ARC architecture, and support exynos5420. - mmc_spi: Support CD/RO GPIOs. - sh_mobile_sdhi: Add compatibility for more Renesas SoCs. - sh_mmcif: Add DT support for DMA channels" * tag 'mmc-updates-for-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (50 commits) Revert "mmc: tmio-mmc: Remove .set_pwr() callback from platform data" mmc: dw_mmc: Add support for ARC mmc: sdhci-s3c: initialize host->quirks2 for using quirks2 mmc: sdhci-s3c: fix the wrong register value, when clock is disabled mmc: esdhc: add support to get voltage from device-tree mmc: sdhci: get voltage from sdhc host mmc: core: parse voltage from device-tree mmc: omap_hsmmc: use the generic config for omap2plus devices mmc: omap_hsmmc: clear status flags before starting a new command mmc: dw_mmc: exynos: Add a new compatible string for exynos5420 mmc: sh_mmcif: revision-specific CLK_CTRL2 handling mmc: sh_mmcif: revision-specific Command Completion Signal handling mmc: sh_mmcif: add support for Device Tree DMA bindings mmc: sh_mmcif: move header include from header into .c mmc: SDHI: add DT compatibility strings for further SoCs mmc: dw_mmc-pci: enable bus-mastering mode mmc: dw_mmc-pci: get resources from a proper BAR mmc: tmio-mmc: Remove .set_pwr() callback from platform data mmc: tmio-mmc: Remove .get_cd() callback from platform data mmc: sh_mobile_sdhi: Remove .set_pwr() callback from platform data ...
Diffstat (limited to 'arch/arm/mach-ep93xx')
-rw-r--r--arch/arm/mach-ep93xx/vision_ep9307.c57
1 files changed, 5 insertions, 52 deletions
diff --git a/arch/arm/mach-ep93xx/vision_ep9307.c b/arch/arm/mach-ep93xx/vision_ep9307.c
index 64f2e50e19ca..6bc1c181581d 100644
--- a/arch/arm/mach-ep93xx/vision_ep9307.c
+++ b/arch/arm/mach-ep93xx/vision_ep9307.c
@@ -224,62 +224,15 @@ static struct ep93xx_spi_chip_ops vision_spi_flash_hw = {
224#define VISION_SPI_MMC_WP EP93XX_GPIO_LINE_F(0) 224#define VISION_SPI_MMC_WP EP93XX_GPIO_LINE_F(0)
225#define VISION_SPI_MMC_CD EP93XX_GPIO_LINE_EGPIO15 225#define VISION_SPI_MMC_CD EP93XX_GPIO_LINE_EGPIO15
226 226
227static struct gpio vision_spi_mmc_gpios[] = {
228 { VISION_SPI_MMC_WP, GPIOF_DIR_IN, "mmc_spi:wp" },
229 { VISION_SPI_MMC_CD, GPIOF_DIR_IN, "mmc_spi:cd" },
230};
231
232static int vision_spi_mmc_init(struct device *pdev,
233 irqreturn_t (*func)(int, void *), void *pdata)
234{
235 int err;
236
237 err = gpio_request_array(vision_spi_mmc_gpios,
238 ARRAY_SIZE(vision_spi_mmc_gpios));
239 if (err)
240 return err;
241
242 err = gpio_set_debounce(VISION_SPI_MMC_CD, 1);
243 if (err)
244 goto exit_err;
245
246 err = request_irq(gpio_to_irq(VISION_SPI_MMC_CD), func,
247 IRQ_TYPE_EDGE_BOTH, "mmc_spi:cd", pdata);
248 if (err)
249 goto exit_err;
250
251 return 0;
252
253exit_err:
254 gpio_free_array(vision_spi_mmc_gpios, ARRAY_SIZE(vision_spi_mmc_gpios));
255 return err;
256
257}
258
259static void vision_spi_mmc_exit(struct device *pdev, void *pdata)
260{
261 free_irq(gpio_to_irq(VISION_SPI_MMC_CD), pdata);
262 gpio_free_array(vision_spi_mmc_gpios, ARRAY_SIZE(vision_spi_mmc_gpios));
263}
264
265static int vision_spi_mmc_get_ro(struct device *pdev)
266{
267 return !!gpio_get_value(VISION_SPI_MMC_WP);
268}
269
270static int vision_spi_mmc_get_cd(struct device *pdev)
271{
272 return !gpio_get_value(VISION_SPI_MMC_CD);
273}
274
275static struct mmc_spi_platform_data vision_spi_mmc_data = { 227static struct mmc_spi_platform_data vision_spi_mmc_data = {
276 .init = vision_spi_mmc_init,
277 .exit = vision_spi_mmc_exit,
278 .get_ro = vision_spi_mmc_get_ro,
279 .get_cd = vision_spi_mmc_get_cd,
280 .detect_delay = 100, 228 .detect_delay = 100,
281 .powerup_msecs = 100, 229 .powerup_msecs = 100,
282 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, 230 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
231 .flags = MMC_SPI_USE_CD_GPIO | MMC_SPI_USE_RO_GPIO,
232 .cd_gpio = VISION_SPI_MMC_CD,
233 .cd_debounce = 1,
234 .ro_gpio = VISION_SPI_MMC_WP,
235 .caps2 = MMC_CAP2_RO_ACTIVE_HIGH,
283}; 236};
284 237
285static int vision_spi_mmc_hw_setup(struct spi_device *spi) 238static int vision_spi_mmc_hw_setup(struct spi_device *spi)