arm: imx: add generic esdhc device
authorWolfram Sang <w.sang@pengutronix.de>
Mon, 11 Oct 2010 10:55:21 +0000 (12:55 +0200)
committerSascha Hauer <s.hauer@pengutronix.de>
Mon, 11 Oct 2010 13:22:05 +0000 (15:22 +0200)
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/plat-mxc/devices/Kconfig
arch/arm/plat-mxc/devices/Makefile
arch/arm/plat-mxc/devices/platform-esdhc.c [new file with mode: 0644]
arch/arm/plat-mxc/include/mach/devices-common.h
arch/arm/plat-mxc/include/mach/esdhc.h [new file with mode: 0644]

index d736c3d4e29252d695151937b3e3b7589fcd5ca0..8266ecb6933e6603966c50c9163191cb02673dda 100644 (file)
@@ -1,3 +1,6 @@
+config IMX_HAVE_PLATFORM_ESDHC
+       bool
+
 config IMX_HAVE_PLATFORM_FLEXCAN
        select HAVE_CAN_FLEXCAN
        bool
index ac773837937406b2b243e788c5a72486d6ffc902..da9676e80e8df6cf06ad811555ec164470b93fd2 100644 (file)
@@ -1,3 +1,4 @@
+obj-$(CONFIG_IMX_HAVE_PLATFORM_ESDHC) += platform-esdhc.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o
diff --git a/arch/arm/plat-mxc/devices/platform-esdhc.c b/arch/arm/plat-mxc/devices/platform-esdhc.c
new file mode 100644 (file)
index 0000000..68db2a2
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2010 Pengutronix, Wolfram Sang <w.sang@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+
+#include <mach/devices-common.h>
+#include <mach/esdhc.h>
+
+struct platform_device *__init imx_add_esdhc(int id,
+               resource_size_t iobase, resource_size_t iosize,
+               resource_size_t irq,
+               const struct esdhc_platform_data *pdata)
+{
+       struct resource res[] = {
+               {
+                       .start = iobase,
+                       .end = iobase + iosize - 1,
+                       .flags = IORESOURCE_MEM,
+               }, {
+                       .start = irq,
+                       .end = irq,
+                       .flags = IORESOURCE_IRQ,
+               },
+       };
+
+       return imx_add_platform_device("sdhci-esdhc-imx", id, res,
+                       ARRAY_SIZE(res), pdata, sizeof(*pdata));
+}
index f87aa1ad66855a1ea290af878b1077f02e7e9605..f75446fa97eb540d9a8968e9730d22d5f0539b77 100644 (file)
@@ -97,3 +97,9 @@ struct imx_spi_imx_data {
 struct platform_device *__init imx_add_spi_imx(
                const struct imx_spi_imx_data *data,
                const struct spi_imx_master *pdata);
+
+#include <mach/esdhc.h>
+struct platform_device *__init imx_add_esdhc(int id,
+               resource_size_t iobase, resource_size_t iosize,
+               resource_size_t irq,
+               const struct esdhc_platform_data *pdata);
diff --git a/arch/arm/plat-mxc/include/mach/esdhc.h b/arch/arm/plat-mxc/include/mach/esdhc.h
new file mode 100644 (file)
index 0000000..a48a9aa
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2010 Wolfram Sang <w.sang@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; version 2
+ * of the License.
+ */
+
+#ifndef __ASM_ARCH_IMX_ESDHC_H
+#define __ASM_ARCH_IMX_ESDHC_H
+
+struct esdhc_platform_data {
+       unsigned int wp_gpio;   /* write protect pin */
+};
+#endif /* __ASM_ARCH_IMX_ESDHC_H */