aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500-sdi.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2011-02-15 09:01:35 -0500
committerLinus Walleij <linus.walleij@linaro.org>2011-03-14 09:05:16 -0400
commit4b4f757c807375564ce3d4ff1d088d3847c52f6d (patch)
treeeac756e13f38cb9fd899df6225665a0d8caaff62 /arch/arm/mach-ux500/board-mop500-sdi.c
parent4bc3a698c3db6592490cd685e395e27216ed2454 (diff)
mach-ux500: basic HREFv60 support v2
The HREFv60 variant of the MOP500 family of boards remove the external GPIO expander and route these pins back to some of the readily available internal GPIO pins instead. Based on a patch by Bibek Basu <bibek.basu@stericsson.com> for an internal kernel version. Cc: Bibek Basu <bibek.basu@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500-sdi.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500-sdi.c42
1 files changed, 33 insertions, 9 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 68c8375e45c..bf0b02414e5 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -12,6 +12,7 @@
12#include <linux/mmc/host.h> 12#include <linux/mmc/host.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14 14
15#include <asm/mach-types.h>
15#include <plat/ste_dma40.h> 16#include <plat/ste_dma40.h>
16#include <mach/devices.h> 17#include <mach/devices.h>
17#include <mach/hardware.h> 18#include <mach/hardware.h>
@@ -68,7 +69,6 @@ static struct mmci_platform_data mop500_sdi0_data = {
68 .ocr_mask = MMC_VDD_29_30, 69 .ocr_mask = MMC_VDD_29_30,
69 .f_max = 100000000, 70 .f_max = 100000000,
70 .capabilities = MMC_CAP_4_BIT_DATA, 71 .capabilities = MMC_CAP_4_BIT_DATA,
71 .gpio_cd = GPIO_SDMMC_CD,
72 .gpio_wp = -1, 72 .gpio_wp = -1,
73#ifdef CONFIG_STE_DMA40 73#ifdef CONFIG_STE_DMA40
74 .dma_filter = stedma40_filter, 74 .dma_filter = stedma40_filter,
@@ -77,23 +77,40 @@ static struct mmci_platform_data mop500_sdi0_data = {
77#endif 77#endif
78}; 78};
79 79
80void mop500_sdi_tc35892_init(void) 80/* GPIO pins used by the sdi0 level shifter */
81static int sdi0_en = -1;
82static int sdi0_vsel = -1;
83
84static void sdi0_configure(void)
81{ 85{
82 int ret; 86 int ret;
83 87
84 ret = gpio_request(GPIO_SDMMC_EN, "SDMMC_EN"); 88 ret = gpio_request(sdi0_en, "level shifter enable");
85 if (!ret) 89 if (!ret)
86 ret = gpio_request(GPIO_SDMMC_1V8_3V_SEL, 90 ret = gpio_request(sdi0_vsel,
87 "GPIO_SDMMC_1V8_3V_SEL"); 91 "level shifter 1v8-3v select");
88 if (ret) 92
93 if (ret) {
94 pr_warning("unable to config sdi0 gpios for level shifter.\n");
89 return; 95 return;
96 }
90 97
91 gpio_direction_output(GPIO_SDMMC_1V8_3V_SEL, 0); 98 /* Select the default 2.9V and enable level shifter */
92 gpio_direction_output(GPIO_SDMMC_EN, 1); 99 gpio_direction_output(sdi0_vsel, 0);
100 gpio_direction_output(sdi0_en, 1);
93 101
102 /* Add the device */
94 db8500_add_sdi0(&mop500_sdi0_data); 103 db8500_add_sdi0(&mop500_sdi0_data);
95} 104}
96 105
106void mop500_sdi_tc35892_init(void)
107{
108 mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
109 sdi0_en = GPIO_SDMMC_EN;
110 sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
111 sdi0_configure();
112}
113
97/* 114/*
98 * SDI 2 (POP eMMC, not on DB8500ed) 115 * SDI 2 (POP eMMC, not on DB8500ed)
99 */ 116 */
@@ -179,8 +196,15 @@ void __init mop500_sdi_init(void)
179 /* On-board eMMC */ 196 /* On-board eMMC */
180 db8500_add_sdi4(&mop500_sdi4_data); 197 db8500_add_sdi4(&mop500_sdi4_data);
181 198
199 if (machine_is_hrefv60()) {
200 mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
201 sdi0_en = HREFV60_SDMMC_EN_GPIO;
202 sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
203 sdi0_configure();
204 }
182 /* 205 /*
183 * sdi0 will finally be added when the TC35892 initializes and calls 206 * On boards with the TC35892 GPIO expander, sdi0 will finally
207 * be added when the TC35892 initializes and calls
184 * mop500_sdi_tc35892_init() above. 208 * mop500_sdi_tc35892_init() above.
185 */ 209 */
186} 210}