diff options
Diffstat (limited to 'arch/arm/mach-shmobile/board-g4evm.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-g4evm.c | 52 |
1 files changed, 24 insertions, 28 deletions
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c index f1257321999a..fa5dfc5c8ed6 100644 --- a/arch/arm/mach-shmobile/board-g4evm.c +++ b/arch/arm/mach-shmobile/board-g4evm.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <linux/mtd/mtd.h> | 26 | #include <linux/mtd/mtd.h> |
27 | #include <linux/mtd/partitions.h> | 27 | #include <linux/mtd/partitions.h> |
28 | #include <linux/mtd/physmap.h> | 28 | #include <linux/mtd/physmap.h> |
29 | #include <linux/regulator/fixed.h> | ||
30 | #include <linux/regulator/machine.h> | ||
29 | #include <linux/usb/r8a66597.h> | 31 | #include <linux/usb/r8a66597.h> |
30 | #include <linux/io.h> | 32 | #include <linux/io.h> |
31 | #include <linux/input.h> | 33 | #include <linux/input.h> |
@@ -196,6 +198,15 @@ static struct platform_device keysc_device = { | |||
196 | }, | 198 | }, |
197 | }; | 199 | }; |
198 | 200 | ||
201 | /* Fixed 3.3V regulator to be used by SDHI0 and SDHI1 */ | ||
202 | static struct regulator_consumer_supply fixed3v3_power_consumers[] = | ||
203 | { | ||
204 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), | ||
205 | REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), | ||
206 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), | ||
207 | REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"), | ||
208 | }; | ||
209 | |||
199 | /* SDHI */ | 210 | /* SDHI */ |
200 | static struct sh_mobile_sdhi_info sdhi0_info = { | 211 | static struct sh_mobile_sdhi_info sdhi0_info = { |
201 | .tmio_caps = MMC_CAP_SDIO_IRQ, | 212 | .tmio_caps = MMC_CAP_SDIO_IRQ, |
@@ -271,26 +282,11 @@ static struct platform_device *g4evm_devices[] __initdata = { | |||
271 | #define GPIO_SDHID1_D3 0xe6052106 | 282 | #define GPIO_SDHID1_D3 0xe6052106 |
272 | #define GPIO_SDHICMD1 0xe6052107 | 283 | #define GPIO_SDHICMD1 0xe6052107 |
273 | 284 | ||
274 | /* | ||
275 | * FIXME !! | ||
276 | * | ||
277 | * gpio_pull_up is quick_hack. | ||
278 | * | ||
279 | * current gpio frame work doesn't have | ||
280 | * the method to control only pull up/down/free. | ||
281 | * this function should be replaced by correct gpio function | ||
282 | */ | ||
283 | static void __init gpio_pull_up(u32 addr) | ||
284 | { | ||
285 | u8 data = __raw_readb(addr); | ||
286 | |||
287 | data &= 0x0F; | ||
288 | data |= 0xC0; | ||
289 | __raw_writeb(data, addr); | ||
290 | } | ||
291 | |||
292 | static void __init g4evm_init(void) | 285 | static void __init g4evm_init(void) |
293 | { | 286 | { |
287 | regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, | ||
288 | ARRAY_SIZE(fixed3v3_power_consumers), 3300000); | ||
289 | |||
294 | sh7377_pinmux_init(); | 290 | sh7377_pinmux_init(); |
295 | 291 | ||
296 | /* Lit DS14 LED */ | 292 | /* Lit DS14 LED */ |
@@ -351,11 +347,11 @@ static void __init g4evm_init(void) | |||
351 | gpio_request(GPIO_FN_SDHID0_3, NULL); | 347 | gpio_request(GPIO_FN_SDHID0_3, NULL); |
352 | gpio_request(GPIO_FN_SDHICMD0, NULL); | 348 | gpio_request(GPIO_FN_SDHICMD0, NULL); |
353 | gpio_request(GPIO_FN_SDHIWP0, NULL); | 349 | gpio_request(GPIO_FN_SDHIWP0, NULL); |
354 | gpio_pull_up(GPIO_SDHID0_D0); | 350 | gpio_request_pullup(GPIO_SDHID0_D0); |
355 | gpio_pull_up(GPIO_SDHID0_D1); | 351 | gpio_request_pullup(GPIO_SDHID0_D1); |
356 | gpio_pull_up(GPIO_SDHID0_D2); | 352 | gpio_request_pullup(GPIO_SDHID0_D2); |
357 | gpio_pull_up(GPIO_SDHID0_D3); | 353 | gpio_request_pullup(GPIO_SDHID0_D3); |
358 | gpio_pull_up(GPIO_SDHICMD0); | 354 | gpio_request_pullup(GPIO_SDHICMD0); |
359 | 355 | ||
360 | /* SDHI1 */ | 356 | /* SDHI1 */ |
361 | gpio_request(GPIO_FN_SDHICLK1, NULL); | 357 | gpio_request(GPIO_FN_SDHICLK1, NULL); |
@@ -364,11 +360,11 @@ static void __init g4evm_init(void) | |||
364 | gpio_request(GPIO_FN_SDHID1_2, NULL); | 360 | gpio_request(GPIO_FN_SDHID1_2, NULL); |
365 | gpio_request(GPIO_FN_SDHID1_3, NULL); | 361 | gpio_request(GPIO_FN_SDHID1_3, NULL); |
366 | gpio_request(GPIO_FN_SDHICMD1, NULL); | 362 | gpio_request(GPIO_FN_SDHICMD1, NULL); |
367 | gpio_pull_up(GPIO_SDHID1_D0); | 363 | gpio_request_pullup(GPIO_SDHID1_D0); |
368 | gpio_pull_up(GPIO_SDHID1_D1); | 364 | gpio_request_pullup(GPIO_SDHID1_D1); |
369 | gpio_pull_up(GPIO_SDHID1_D2); | 365 | gpio_request_pullup(GPIO_SDHID1_D2); |
370 | gpio_pull_up(GPIO_SDHID1_D3); | 366 | gpio_request_pullup(GPIO_SDHID1_D3); |
371 | gpio_pull_up(GPIO_SDHICMD1); | 367 | gpio_request_pullup(GPIO_SDHICMD1); |
372 | 368 | ||
373 | sh7377_add_standard_devices(); | 369 | sh7377_add_standard_devices(); |
374 | 370 | ||