summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Waters <justin.waters@timesys.com>2008-05-21 12:59:15 -0400
committerJustin Waters <justin.waters@timesys.com>2008-05-21 16:05:33 -0400
commitc0c405c78a0a9a372d9dc8803f2ccb48cb0fcf84 (patch)
tree05ec81252bc0a4187cda87ed3497f3426f49bf10
parenta1a5b975e6d9fb9d4a162ba339c04ffd80343a38 (diff)
MX27: Add ability to enable individual Secure Digital controllers
Enabling the SD interface on the MX27 chip will enable all of the interfaces. Since we only use one of them, we should be able to flip them on and off individually. Ultimately, we'd like to do this is the board-specific file, but that will require additional work. Signed-off-by: Justin Waters <justin.waters@timesys.com>
-rw-r--r--arch/arm/mach-mx27/Kconfig23
-rw-r--r--arch/arm/mach-mx27/devices.c35
2 files changed, 44 insertions, 14 deletions
diff --git a/arch/arm/mach-mx27/Kconfig b/arch/arm/mach-mx27/Kconfig
index 2b1e255c09ee..96c6207f6b89 100644
--- a/arch/arm/mach-mx27/Kconfig
+++ b/arch/arm/mach-mx27/Kconfig
@@ -38,6 +38,29 @@ config I2C_MXC_SELECT2
help
Enable MX31 I2C2 module.
+config MXC_SDHC1
+ bool "Enable SDHC1 module"
+ default n if MACH_MX27LITE
+ default y
+ depends on MMC_MXC
+ help
+ Enable MX27 Secure Digital Host Controller Interface 1.
+
+config MXC_SDHC2
+ bool "Enable SDHC2 module"
+ default y if MACH_MX27LITE
+ default n
+ depends on MMC_MXC
+ help
+ Enable MX27 Secure Digital Host Controller Interface 2.
+
+config MXC_SDHC3
+ bool "Enable SDHC3 module"
+ default n
+ depends on MMC_MXC
+ help
+ Enable MX27 Secure Digital Host Controller Interface 3.
+
endmenu
endmenu
diff --git a/arch/arm/mach-mx27/devices.c b/arch/arm/mach-mx27/devices.c
index b8d25b1cf919..cdde8069c9c3 100644
--- a/arch/arm/mach-mx27/devices.c
+++ b/arch/arm/mach-mx27/devices.c
@@ -157,6 +157,7 @@ static struct mxc_mmc_platform_data mmc_data = {
.status = sdhc_get_card_det_status,
};
+#ifdef CONFIG_MXC_SDHC1
/*!
* Resource definition for the SDHC1
*/
@@ -183,6 +184,20 @@ static struct resource mxcsdhc1_resources[] = {
},
};
+/*! Device Definition for MXC SDHC1 */
+static struct platform_device mxcsdhc1_device = {
+ .name = "mxcmci",
+ .id = 0,
+ .dev = {
+ .release = mxc_nop_release,
+ .platform_data = &mmc_data,
+ },
+ .num_resources = ARRAY_SIZE(mxcsdhc1_resources),
+ .resource = mxcsdhc1_resources,
+};
+#endif
+
+#ifdef CONFIG_MXC_SDHC2
/*!
* Resource definition for the SDHC2
*/
@@ -209,18 +224,6 @@ static struct resource mxcsdhc2_resources[] = {
},
};
-/*! Device Definition for MXC SDHC1 */
-static struct platform_device mxcsdhc1_device = {
- .name = "mxcmci",
- .id = 0,
- .dev = {
- .release = mxc_nop_release,
- .platform_data = &mmc_data,
- },
- .num_resources = ARRAY_SIZE(mxcsdhc1_resources),
- .resource = mxcsdhc1_resources,
-};
-
/*! Device Definition for MXC SDHC2 */
static struct platform_device mxcsdhc2_device = {
.name = "mxcmci",
@@ -232,6 +235,7 @@ static struct platform_device mxcsdhc2_device = {
.num_resources = ARRAY_SIZE(mxcsdhc2_resources),
.resource = mxcsdhc2_resources,
};
+#endif
#ifdef CONFIG_MXC_SDHC3
/*!
@@ -277,19 +281,22 @@ static inline void mxc_init_mmc(void)
{
int cd_irq;
+#ifdef CONFIG_MXC_SDHC1
cd_irq = sdhc_init_card_det(0);
if (cd_irq) {
mxcsdhc1_device.resource[2].start = cd_irq;
mxcsdhc1_device.resource[2].end = cd_irq;
}
+ (void)platform_device_register(&mxcsdhc1_device);
+#endif
+#ifdef CONFIG_MXC_SDHC2
cd_irq = sdhc_init_card_det(1);
if (cd_irq) {
mxcsdhc2_device.resource[2].start = cd_irq;
mxcsdhc2_device.resource[2].end = cd_irq;
}
-
- (void)platform_device_register(&mxcsdhc1_device);
(void)platform_device_register(&mxcsdhc2_device);
+#endif
#ifdef CONFIG_MXC_SDHC3
(void)platform_device_register(&mxcsdhc3_device);
#endif