diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2010-10-11 06:55:21 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-10-11 09:22:05 -0400 |
commit | 203a0734709779fa40552cd9bb7c4dd325b5131f (patch) | |
tree | 7307ac5fe039ccfb2573935c802e58480593e8df /arch/arm/plat-mxc | |
parent | 54dc3f4674fbaf362d6e969904bfcece3cfebef1 (diff) |
arm: imx: add generic esdhc device
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/plat-mxc')
-rw-r--r-- | arch/arm/plat-mxc/devices/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-esdhc.c | 31 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 6 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/esdhc.h | 16 |
5 files changed, 57 insertions, 0 deletions
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index d736c3d4e292..8266ecb6933e 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig | |||
@@ -1,3 +1,6 @@ | |||
1 | config IMX_HAVE_PLATFORM_ESDHC | ||
2 | bool | ||
3 | |||
1 | config IMX_HAVE_PLATFORM_FLEXCAN | 4 | config IMX_HAVE_PLATFORM_FLEXCAN |
2 | select HAVE_CAN_FLEXCAN | 5 | select HAVE_CAN_FLEXCAN |
3 | bool | 6 | bool |
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index ac7738379374..da9676e80e8d 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_ESDHC) += platform-esdhc.o | ||
1 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o | 2 | obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o |
2 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o | 3 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_I2C) += platform-imx-i2c.o |
3 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_SSI) += platform-imx-ssi.o | 4 | 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 index 000000000000..68db2a22d2cd --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-esdhc.c | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix, Wolfram Sang <w.sang@pengutronix.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it under | ||
5 | * the terms of the GNU General Public License version 2 as published by the | ||
6 | * Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <mach/devices-common.h> | ||
10 | #include <mach/esdhc.h> | ||
11 | |||
12 | struct platform_device *__init imx_add_esdhc(int id, | ||
13 | resource_size_t iobase, resource_size_t iosize, | ||
14 | resource_size_t irq, | ||
15 | const struct esdhc_platform_data *pdata) | ||
16 | { | ||
17 | struct resource res[] = { | ||
18 | { | ||
19 | .start = iobase, | ||
20 | .end = iobase + iosize - 1, | ||
21 | .flags = IORESOURCE_MEM, | ||
22 | }, { | ||
23 | .start = irq, | ||
24 | .end = irq, | ||
25 | .flags = IORESOURCE_IRQ, | ||
26 | }, | ||
27 | }; | ||
28 | |||
29 | return imx_add_platform_device("sdhci-esdhc-imx", id, res, | ||
30 | ARRAY_SIZE(res), pdata, sizeof(*pdata)); | ||
31 | } | ||
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index f87aa1ad6685..f75446fa97eb 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h | |||
@@ -97,3 +97,9 @@ struct imx_spi_imx_data { | |||
97 | struct platform_device *__init imx_add_spi_imx( | 97 | struct platform_device *__init imx_add_spi_imx( |
98 | const struct imx_spi_imx_data *data, | 98 | const struct imx_spi_imx_data *data, |
99 | const struct spi_imx_master *pdata); | 99 | const struct spi_imx_master *pdata); |
100 | |||
101 | #include <mach/esdhc.h> | ||
102 | struct platform_device *__init imx_add_esdhc(int id, | ||
103 | resource_size_t iobase, resource_size_t iosize, | ||
104 | resource_size_t irq, | ||
105 | 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 index 000000000000..a48a9aaa56b1 --- /dev/null +++ b/arch/arm/plat-mxc/include/mach/esdhc.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * Copyright 2010 Wolfram Sang <w.sang@pengutronix.de> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; version 2 | ||
7 | * of the License. | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASM_ARCH_IMX_ESDHC_H | ||
11 | #define __ASM_ARCH_IMX_ESDHC_H | ||
12 | |||
13 | struct esdhc_platform_data { | ||
14 | unsigned int wp_gpio; /* write protect pin */ | ||
15 | }; | ||
16 | #endif /* __ASM_ARCH_IMX_ESDHC_H */ | ||