aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-03-18 14:26:44 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-03-21 06:37:00 -0400
commit54ca74ef09a98fcbd77887bb6ff38986ff593955 (patch)
treebbe66f8e3ffb288b795803b6cc1aff4acfdbb376 /arch/arm
parenta9060f89d9ad4e806c69acb1ea5ebdaeaa91e54b (diff)
ARM: shmobile: kzm9g: add fixed voltage regulators for SDHI0 and SDHI2
Both SDHI0 and SDHI2 power supplies on kzm9g can be switched on and off. In the current version this is not used and the regulators are hard-wired to "on." This patch switches SDHI0 and SDHI2 to proper fixed-voltage regulators, using GPIOs to enable and disable them. Both ports shall now be specifying the MMC_CAP_POWER_OFF_CARD MMC capability. Only SDHI0 has been tested with an SDIO card, since SDHI2 is a microSD slot. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c76
1 files changed, 62 insertions, 14 deletions
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index e924b815c0c8..77a66ac12417 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -375,13 +375,64 @@ static struct platform_device mmc_device = {
375 .resource = sh_mmcif_resources, 375 .resource = sh_mmcif_resources,
376}; 376};
377 377
378/* Fixed 3.3V regulators to be used by SDHI0 and SDHI2 */ 378/* Fixed 3.3V regulators to be used by SDHI0 */
379static struct regulator_consumer_supply fixed3v3_power_consumers[] = 379static struct regulator_consumer_supply vcc_sdhi0_consumers[] =
380{ 380{
381 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), 381 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
382 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), 382};
383
384static struct regulator_init_data vcc_sdhi0_init_data = {
385 .constraints = {
386 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
387 },
388 .num_consumer_supplies = ARRAY_SIZE(vcc_sdhi0_consumers),
389 .consumer_supplies = vcc_sdhi0_consumers,
390};
391
392static struct fixed_voltage_config vcc_sdhi0_info = {
393 .supply_name = "SDHI0 Vcc",
394 .microvolts = 3300000,
395 .gpio = 15,
396 .enable_high = 1,
397 .init_data = &vcc_sdhi0_init_data,
398};
399
400static struct platform_device vcc_sdhi0 = {
401 .name = "reg-fixed-voltage",
402 .id = 0,
403 .dev = {
404 .platform_data = &vcc_sdhi0_info,
405 },
406};
407
408/* Fixed 3.3V regulators to be used by SDHI2 */
409static struct regulator_consumer_supply vcc_sdhi2_consumers[] =
410{
383 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.2"), 411 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.2"),
384 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.2"), 412};
413
414static struct regulator_init_data vcc_sdhi2_init_data = {
415 .constraints = {
416 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
417 },
418 .num_consumer_supplies = ARRAY_SIZE(vcc_sdhi2_consumers),
419 .consumer_supplies = vcc_sdhi2_consumers,
420};
421
422static struct fixed_voltage_config vcc_sdhi2_info = {
423 .supply_name = "SDHI2 Vcc",
424 .microvolts = 3300000,
425 .gpio = 14,
426 .enable_high = 1,
427 .init_data = &vcc_sdhi2_init_data,
428};
429
430static struct platform_device vcc_sdhi2 = {
431 .name = "reg-fixed-voltage",
432 .id = 1,
433 .dev = {
434 .platform_data = &vcc_sdhi2_info,
435 },
385}; 436};
386 437
387/* SDHI */ 438/* SDHI */
@@ -389,7 +440,8 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
389 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 440 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
390 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 441 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
391 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, 442 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
392 .tmio_caps = MMC_CAP_SD_HIGHSPEED, 443 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
444 MMC_CAP_POWER_OFF_CARD,
393}; 445};
394 446
395static struct resource sdhi0_resources[] = { 447static struct resource sdhi0_resources[] = {
@@ -432,7 +484,7 @@ static struct sh_mobile_sdhi_info sdhi2_info = {
432 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | 484 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT |
433 TMIO_MMC_USE_GPIO_CD | 485 TMIO_MMC_USE_GPIO_CD |
434 TMIO_MMC_WRPROTECT_DISABLE, 486 TMIO_MMC_WRPROTECT_DISABLE,
435 .tmio_caps = MMC_CAP_SD_HIGHSPEED, 487 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_POWER_OFF_CARD,
436 .cd_gpio = 13, 488 .cd_gpio = 13,
437}; 489};
438 490
@@ -592,6 +644,8 @@ static struct platform_device *kzm_devices[] __initdata = {
592 &usbhs_device, 644 &usbhs_device,
593 &lcdc_device, 645 &lcdc_device,
594 &mmc_device, 646 &mmc_device,
647 &vcc_sdhi0,
648 &vcc_sdhi2,
595 &sdhi0_device, 649 &sdhi0_device,
596 &sdhi2_device, 650 &sdhi2_device,
597 &gpio_keys_device, 651 &gpio_keys_device,
@@ -712,11 +766,9 @@ device_initcall(as3711_enable_lcdc_backlight);
712 766
713static void __init kzm_init(void) 767static void __init kzm_init(void)
714{ 768{
715 regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers, 769 regulator_register_always_on(2, "fixed-1.8V", fixed1v8_power_consumers,
716 ARRAY_SIZE(fixed1v8_power_consumers), 1800000); 770 ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
717 regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers, 771 regulator_register_fixed(3, dummy_supplies, ARRAY_SIZE(dummy_supplies));
718 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
719 regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies));
720 772
721 pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map)); 773 pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map));
722 774
@@ -734,10 +786,6 @@ static void __init kzm_init(void)
734 786
735 /* enable SD */ 787 /* enable SD */
736 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL); 788 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL);
737 gpio_request_one(15, GPIOF_OUT_INIT_HIGH, NULL); /* power */
738
739 /* enable Micro SD */
740 gpio_request_one(14, GPIOF_OUT_INIT_HIGH, NULL); /* power */
741 789
742#ifdef CONFIG_CACHE_L2X0 790#ifdef CONFIG_CACHE_L2X0
743 /* Early BRESP enable, Shared attribute override enable, 64K*8way */ 791 /* Early BRESP enable, Shared attribute override enable, 64K*8way */