Date:2010-08-04 15:26:22 (13 years 7 months ago)
Author:lars
Commit:952d7bfd0161a56c752782c92d376773463229f2
Message:[xburst] Fix mmc card detection

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22481 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: target/linux/xburst/patches-2.6.35/054-mmc.patch (6 diffs)

Change Details

target/linux/xburst/patches-2.6.35/054-mmc.patch
1From 34e75141dfd8edae48030b61741c294fd0f952b1 Mon Sep 17 00:00:00 2001
1From 11bc6d97096ab89da31f628c89b19ff37dfdd526 Mon Sep 17 00:00:00 2001
22From: Lars-Peter Clausen <lars@metafoo.de>
33Date: Thu, 15 Jul 2010 20:06:04 +0000
44Subject: [PATCH] MMC: Add support for the controller on JZ4740 SoCs.
...... 
1616 arch/mips/include/asm/mach-jz4740/jz4740_mmc.h | 15 +
1717 drivers/mmc/host/Kconfig | 9 +
1818 drivers/mmc/host/Makefile | 1 +
19 drivers/mmc/host/jz4740_mmc.c | 1033 ++++++++++++++++++++++++
20 4 files changed, 1058 insertions(+), 0 deletions(-)
19 drivers/mmc/host/jz4740_mmc.c | 1029 ++++++++++++++++++++++++
20 4 files changed, 1054 insertions(+), 0 deletions(-)
2121 create mode 100644 arch/mips/include/asm/mach-jz4740/jz4740_mmc.h
2222 create mode 100644 drivers/mmc/host/jz4740_mmc.c
2323
24diff --git a/arch/mips/include/asm/mach-jz4740/jz4740_mmc.h b/arch/mips/include/asm/mach-jz4740/jz4740_mmc.h
25new file mode 100644
26index 0000000..8543f43
2427--- /dev/null
2528+++ b/arch/mips/include/asm/mach-jz4740/jz4740_mmc.h
2629@@ -0,0 +1,15 @@
...... 
3942+};
4043+
4144+#endif
45diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
46index f06d06e..d25e22c 100644
4247--- a/drivers/mmc/host/Kconfig
4348+++ b/drivers/mmc/host/Kconfig
44@@ -457,3 +457,12 @@ config MMC_SH_MMCIF
49@@ -432,3 +432,12 @@ config MMC_SH_MMCIF
4550       This selects the MMC Host Interface controler (MMCIF).
4651
4752       This driver supports MMCIF in sh7724/sh7757/sh7372.
...... 
5459+ SoCs.
5560+ If you have a board based on such a SoC and with a SD/MMC slot,
5661+ say Y or M here.
62diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
63index e30c2ee..f4e53c9 100644
5764--- a/drivers/mmc/host/Makefile
5865+++ b/drivers/mmc/host/Makefile
59@@ -37,6 +37,7 @@ obj-$(CONFIG_MMC_VIA_SDMMC) += via-sdmmc
60 obj-$(CONFIG_GPIOMMC) += gpiommc.o
66@@ -36,6 +36,7 @@ obj-$(CONFIG_MMC_CB710) += cb710-mmc.o
67 obj-$(CONFIG_MMC_VIA_SDMMC) += via-sdmmc.o
6168 obj-$(CONFIG_SDH_BFIN) += bfin_sdh.o
6269 obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o
6370+obj-$(CONFIG_MMC_JZ4740) += jz4740_mmc.o
6471
6572 obj-$(CONFIG_MMC_SDHCI_OF) += sdhci-of.o
6673 sdhci-of-y := sdhci-of-core.o
74diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c
75new file mode 100644
76index 0000000..ad4f987
6777--- /dev/null
6878+++ b/drivers/mmc/host/jz4740_mmc.c
69@@ -0,0 +1,1033 @@
79@@ -0,0 +1,1029 @@
7080+/*
7181+ * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de>
7282+ * JZ4740 SD/MMC controller driver
...... 
830840+static int __devinit jz4740_mmc_request_cd_irq(struct platform_device *pdev,
831841+ struct jz4740_mmc_host *host)
832842+{
833+ int ret;
834843+ struct jz4740_mmc_platform_data *pdata = pdev->dev.platform_data;
835844+
836+ if (gpio_is_valid(pdata->gpio_card_detect))
845+ if (!gpio_is_valid(pdata->gpio_card_detect))
837846+ return 0;
838847+
839848+ host->card_detect_irq = gpio_to_irq(pdata->gpio_card_detect);
840+
841849+ if (host->card_detect_irq < 0) {
842850+ dev_warn(&pdev->dev, "Failed to get card detect irq\n");
843851+ return 0;
844852+ }
853+
845854+ return request_irq(host->card_detect_irq, jz4740_mmc_card_detect_irq,
846855+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
847856+ "MMC card detect", host);
848+
849+
850+ return ret;
851857+}
852858+
853859+static void jz4740_mmc_free_gpios(struct platform_device *pdev)
...... 
11001106+MODULE_DESCRIPTION("JZ4740 SD/MMC controller driver");
11011107+MODULE_LICENSE("GPL");
11021108+MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
1109--
11101.5.6.5
1111

Archive Download the corresponding diff file



interactive