diff options
| author | Grazvydas Ignotas <notasas@gmail.com> | 2009-05-28 17:04:04 -0400 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2009-05-28 17:04:04 -0400 |
| commit | 64f535a87ce103fae592f2cce0866b4a45903ed6 (patch) | |
| tree | 557aee7b11ec52856d6f9b4730352f7f592670d8 | |
| parent | bb3b9d8eb97624956e7e3a9eba2c64576808b1dc (diff) | |
ARM: OMAP3: pandora: setup regulator framework for MMC
Setup regulators for MMC1 and MMC2 to get those SD slots
working again.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
CC: David Brownell <david-b@pacbell.net>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
| -rw-r--r-- | arch/arm/mach-omap2/board-omap3pandora.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 3571bb47ab86..2ab24975b685 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | #include <linux/spi/spi.h> | 24 | #include <linux/spi/spi.h> |
| 25 | #include <linux/spi/ads7846.h> | 25 | #include <linux/spi/ads7846.h> |
| 26 | #include <linux/regulator/machine.h> | ||
| 26 | #include <linux/i2c/twl4030.h> | 27 | #include <linux/i2c/twl4030.h> |
| 27 | 28 | ||
| 28 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
| @@ -70,6 +71,14 @@ static struct omap_uart_config omap3pandora_uart_config __initdata = { | |||
| 70 | .enabled_uarts = (1 << 2), /* UART3 */ | 71 | .enabled_uarts = (1 << 2), /* UART3 */ |
| 71 | }; | 72 | }; |
| 72 | 73 | ||
| 74 | static struct regulator_consumer_supply pandora_vmmc1_supply = { | ||
| 75 | .supply = "vmmc", | ||
| 76 | }; | ||
| 77 | |||
| 78 | static struct regulator_consumer_supply pandora_vmmc2_supply = { | ||
| 79 | .supply = "vmmc", | ||
| 80 | }; | ||
| 81 | |||
| 73 | static int omap3pandora_twl_gpio_setup(struct device *dev, | 82 | static int omap3pandora_twl_gpio_setup(struct device *dev, |
| 74 | unsigned gpio, unsigned ngpio) | 83 | unsigned gpio, unsigned ngpio) |
| 75 | { | 84 | { |
| @@ -78,6 +87,10 @@ static int omap3pandora_twl_gpio_setup(struct device *dev, | |||
| 78 | omap3pandora_mmc[1].gpio_cd = gpio + 1; | 87 | omap3pandora_mmc[1].gpio_cd = gpio + 1; |
| 79 | twl4030_mmc_init(omap3pandora_mmc); | 88 | twl4030_mmc_init(omap3pandora_mmc); |
| 80 | 89 | ||
| 90 | /* link regulators to MMC adapters */ | ||
| 91 | pandora_vmmc1_supply.dev = omap3pandora_mmc[0].dev; | ||
| 92 | pandora_vmmc2_supply.dev = omap3pandora_mmc[1].dev; | ||
| 93 | |||
| 81 | return 0; | 94 | return 0; |
| 82 | } | 95 | } |
| 83 | 96 | ||
| @@ -88,6 +101,36 @@ static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { | |||
| 88 | .setup = omap3pandora_twl_gpio_setup, | 101 | .setup = omap3pandora_twl_gpio_setup, |
| 89 | }; | 102 | }; |
| 90 | 103 | ||
| 104 | /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ | ||
| 105 | static struct regulator_init_data pandora_vmmc1 = { | ||
| 106 | .constraints = { | ||
| 107 | .min_uV = 1850000, | ||
| 108 | .max_uV = 3150000, | ||
| 109 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
| 110 | | REGULATOR_MODE_STANDBY, | ||
| 111 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
| 112 | | REGULATOR_CHANGE_MODE | ||
| 113 | | REGULATOR_CHANGE_STATUS, | ||
| 114 | }, | ||
| 115 | .num_consumer_supplies = 1, | ||
| 116 | .consumer_supplies = &pandora_vmmc1_supply, | ||
| 117 | }; | ||
| 118 | |||
| 119 | /* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */ | ||
| 120 | static struct regulator_init_data pandora_vmmc2 = { | ||
| 121 | .constraints = { | ||
| 122 | .min_uV = 1850000, | ||
| 123 | .max_uV = 3150000, | ||
| 124 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
| 125 | | REGULATOR_MODE_STANDBY, | ||
| 126 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | ||
| 127 | | REGULATOR_CHANGE_MODE | ||
| 128 | | REGULATOR_CHANGE_STATUS, | ||
| 129 | }, | ||
| 130 | .num_consumer_supplies = 1, | ||
| 131 | .consumer_supplies = &pandora_vmmc2_supply, | ||
| 132 | }; | ||
| 133 | |||
| 91 | static struct twl4030_usb_data omap3pandora_usb_data = { | 134 | static struct twl4030_usb_data omap3pandora_usb_data = { |
| 92 | .usb_mode = T2_USB_MODE_ULPI, | 135 | .usb_mode = T2_USB_MODE_ULPI, |
| 93 | }; | 136 | }; |
| @@ -97,6 +140,8 @@ static struct twl4030_platform_data omap3pandora_twldata = { | |||
| 97 | .irq_end = TWL4030_IRQ_END, | 140 | .irq_end = TWL4030_IRQ_END, |
| 98 | .gpio = &omap3pandora_gpio_data, | 141 | .gpio = &omap3pandora_gpio_data, |
| 99 | .usb = &omap3pandora_usb_data, | 142 | .usb = &omap3pandora_usb_data, |
| 143 | .vmmc1 = &pandora_vmmc1, | ||
| 144 | .vmmc2 = &pandora_vmmc2, | ||
| 100 | }; | 145 | }; |
| 101 | 146 | ||
| 102 | static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = { | 147 | static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = { |
