summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500-sdi.c
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2010-08-09 19:18:17 +0530
committerLinus Walleij <linus.walleij@stericsson.com>2010-12-08 13:13:51 +0100
commitb8410a150fbc4e61a28032637dc0ae7e8609131d (patch)
tree3e3a3dde5feada0c540ebe4fac6d2d595f6f42f5 /arch/arm/mach-ux500/board-mop500-sdi.c
parente8a7e48bb248a1196484d3f8afa53bded2b24e71 (diff)
downloadblackbird-op-linux-b8410a150fbc4e61a28032637dc0ae7e8609131d.tar.gz
blackbird-op-linux-b8410a150fbc4e61a28032637dc0ae7e8609131d.zip
ux500: mop500: add TC35892 and MicroSD slot support
Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500-sdi.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500-sdi.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index bac995665b58..f0095ffee438 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -20,6 +20,19 @@
#include "board-mop500.h"
static pin_cfg_t mop500_sdi_pins[] = {
+ /* SDI0 (MicroSD slot) */
+ GPIO18_MC0_CMDDIR,
+ GPIO19_MC0_DAT0DIR,
+ GPIO20_MC0_DAT2DIR,
+ GPIO21_MC0_DAT31DIR,
+ GPIO22_MC0_FBCLK,
+ GPIO23_MC0_CLK,
+ GPIO24_MC0_CMD,
+ GPIO25_MC0_DAT0,
+ GPIO26_MC0_DAT1,
+ GPIO27_MC0_DAT2,
+ GPIO28_MC0_DAT3,
+
/* SDI4 (on-board eMMC) */
GPIO197_MC4_DAT3,
GPIO198_MC4_DAT2,
@@ -50,6 +63,55 @@ static pin_cfg_t mop500_sdi2_pins[] = {
};
/*
+ * SDI 0 (MicroSD slot)
+ */
+
+/* MMCIPOWER bits */
+#define MCI_DATA2DIREN (1 << 2)
+#define MCI_CMDDIREN (1 << 3)
+#define MCI_DATA0DIREN (1 << 4)
+#define MCI_DATA31DIREN (1 << 5)
+#define MCI_FBCLKEN (1 << 7)
+
+static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd,
+ unsigned char power_mode)
+{
+ if (power_mode == MMC_POWER_UP)
+ gpio_set_value(GPIO_SDMMC_EN, 1);
+ else if (power_mode == MMC_POWER_OFF)
+ gpio_set_value(GPIO_SDMMC_EN, 0);
+
+ return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN |
+ MCI_DATA2DIREN | MCI_DATA31DIREN;
+}
+
+static struct mmci_platform_data mop500_sdi0_data = {
+ .vdd_handler = mop500_sdi0_vdd_handler,
+ .ocr_mask = MMC_VDD_29_30,
+ .f_max = 100000000,
+ .capabilities = MMC_CAP_4_BIT_DATA,
+ .gpio_cd = GPIO_SDMMC_CD,
+ .gpio_wp = -1,
+};
+
+void mop500_sdi_tc35892_init(void)
+{
+ int ret;
+
+ ret = gpio_request(GPIO_SDMMC_EN, "SDMMC_EN");
+ if (!ret)
+ ret = gpio_request(GPIO_SDMMC_1V8_3V_SEL,
+ "GPIO_SDMMC_1V8_3V_SEL");
+ if (ret)
+ return;
+
+ gpio_direction_output(GPIO_SDMMC_1V8_3V_SEL, 1);
+ gpio_direction_output(GPIO_SDMMC_EN, 0);
+
+ amba_device_register(&u8500_sdi0_device, &iomem_resource);
+}
+
+/*
* SDI 2 (POP eMMC, not on DB8500ed)
*/
@@ -78,6 +140,7 @@ void mop500_sdi_init(void)
{
nmk_config_pins(mop500_sdi_pins, ARRAY_SIZE(mop500_sdi_pins));
+ u8500_sdi0_device.dev.platform_data = &mop500_sdi0_data;
u8500_sdi2_device.dev.platform_data = &mop500_sdi2_data;
u8500_sdi4_device.dev.platform_data = &mop500_sdi4_data;
OpenPOWER on IntegriCloud