aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrazvydas Ignotas <notasas@gmail.com>2010-10-01 19:35:25 -0400
committerTony Lindgren <tony@atomide.com>2010-10-01 19:35:25 -0400
commit690a4a39b2429a4e397cd79e1dd16b6a5ca4111e (patch)
treeb6d76df513b3cd2bad8929674519253a4f792766
parent76abab213587bfc3b850f36c0a674116d161148d (diff)
omap: pandora: add fixed regulator for wlan
Instead of enabling the wifi module explicitly using GPIO, add a fixed regulator and hook it to MMC host card power control. This way it will only be enabled when SDIO subsystem wants to talk to it, saving power (as done by Zoom boards). Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c43
1 files changed, 32 insertions, 11 deletions
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 2d2e6fc127ac..7c222ba17dea 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -34,6 +34,7 @@
34#include <linux/gpio_keys.h> 34#include <linux/gpio_keys.h>
35#include <linux/mmc/host.h> 35#include <linux/mmc/host.h>
36#include <linux/mmc/card.h> 36#include <linux/mmc/card.h>
37#include <linux/regulator/fixed.h>
37 38
38#include <asm/mach-types.h> 39#include <asm/mach-types.h>
39#include <asm/mach/arch.h> 40#include <asm/mach/arch.h>
@@ -345,6 +346,9 @@ static struct regulator_consumer_supply pandora_vmmc1_supply =
345static struct regulator_consumer_supply pandora_vmmc2_supply = 346static struct regulator_consumer_supply pandora_vmmc2_supply =
346 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); 347 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1");
347 348
349static struct regulator_consumer_supply pandora_vmmc3_supply =
350 REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.2");
351
348static struct regulator_consumer_supply pandora_vdda_dac_supply = 352static struct regulator_consumer_supply pandora_vdda_dac_supply =
349 REGULATOR_SUPPLY("vdda_dac", "omapdss"); 353 REGULATOR_SUPPLY("vdda_dac", "omapdss");
350 354
@@ -489,6 +493,33 @@ static struct regulator_init_data pandora_vsim = {
489 .consumer_supplies = &pandora_adac_supply, 493 .consumer_supplies = &pandora_adac_supply,
490}; 494};
491 495
496/* Fixed regulator internal to Wifi module */
497static struct regulator_init_data pandora_vmmc3 = {
498 .constraints = {
499 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
500 },
501 .num_consumer_supplies = 1,
502 .consumer_supplies = &pandora_vmmc3_supply,
503};
504
505static struct fixed_voltage_config pandora_vwlan = {
506 .supply_name = "vwlan",
507 .microvolts = 1800000, /* 1.8V */
508 .gpio = PANDORA_WIFI_NRESET_GPIO,
509 .startup_delay = 50000, /* 50ms */
510 .enable_high = 1,
511 .enabled_at_boot = 0,
512 .init_data = &pandora_vmmc3,
513};
514
515static struct platform_device pandora_vwlan_device = {
516 .name = "reg-fixed-voltage",
517 .id = 1,
518 .dev = {
519 .platform_data = &pandora_vwlan,
520 },
521};
522
492static struct twl4030_usb_data omap3pandora_usb_data = { 523static struct twl4030_usb_data omap3pandora_usb_data = {
493 .usb_mode = T2_USB_MODE_ULPI, 524 .usb_mode = T2_USB_MODE_ULPI,
494}; 525};
@@ -645,19 +676,8 @@ static void pandora_wl1251_init(void)
645 if (pandora_wl1251_pdata.irq < 0) 676 if (pandora_wl1251_pdata.irq < 0)
646 goto fail_irq; 677 goto fail_irq;
647 678
648 ret = gpio_request(PANDORA_WIFI_NRESET_GPIO, "wl1251 nreset");
649 if (ret < 0)
650 goto fail_irq;
651
652 /* start powered so that it probes with MMC subsystem */
653 ret = gpio_direction_output(PANDORA_WIFI_NRESET_GPIO, 1);
654 if (ret < 0)
655 goto fail_nreset;
656
657 return; 679 return;
658 680
659fail_nreset:
660 gpio_free(PANDORA_WIFI_NRESET_GPIO);
661fail_irq: 681fail_irq:
662 gpio_free(PANDORA_WIFI_IRQ_GPIO); 682 gpio_free(PANDORA_WIFI_IRQ_GPIO);
663fail: 683fail:
@@ -669,6 +689,7 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
669 &pandora_keys_gpio, 689 &pandora_keys_gpio,
670 &pandora_dss_device, 690 &pandora_dss_device,
671 &pandora_wl1251_data, 691 &pandora_wl1251_data,
692 &pandora_vwlan_device,
672}; 693};
673 694
674static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 695static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {