diff options
author | Mark F. Brown <mark.brown314@gmail.com> | 2010-12-13 22:56:59 -0500 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-12-20 10:07:49 -0500 |
commit | e97d0fac8492dd6566f71f9c81ed453c2105f459 (patch) | |
tree | af9f03dab437a0abff88f6a888388b7a3b76705f | |
parent | a8fb0b55314144a37755729d3b40b027b0020e3c (diff) |
ARM: mmp: refactored 5V regulator support using fixed-regulator
Signed-off-by: Mark F. Brown <mark.brown314@gmail.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
-rw-r--r-- | arch/arm/mach-mmp/brownstone.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c index 635c4004ebe1..7bb78fd5a2a6 100644 --- a/arch/arm/mach-mmp/brownstone.c +++ b/arch/arm/mach-mmp/brownstone.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/gpio.h> | 17 | #include <linux/gpio.h> |
18 | #include <linux/regulator/machine.h> | 18 | #include <linux/regulator/machine.h> |
19 | #include <linux/regulator/max8649.h> | 19 | #include <linux/regulator/max8649.h> |
20 | #include <linux/regulator/fixed.h> | ||
20 | #include <linux/mfd/max8925.h> | 21 | #include <linux/mfd/max8925.h> |
21 | 22 | ||
22 | #include <asm/mach-types.h> | 23 | #include <asm/mach-types.h> |
@@ -30,6 +31,8 @@ | |||
30 | 31 | ||
31 | #define BROWNSTONE_NR_IRQS (IRQ_BOARD_START + 40) | 32 | #define BROWNSTONE_NR_IRQS (IRQ_BOARD_START + 40) |
32 | 33 | ||
34 | #define GPIO_5V_ENABLE (89) | ||
35 | |||
33 | static unsigned long brownstone_pin_config[] __initdata = { | 36 | static unsigned long brownstone_pin_config[] __initdata = { |
34 | /* UART1 */ | 37 | /* UART1 */ |
35 | GPIO29_UART1_RXD, | 38 | GPIO29_UART1_RXD, |
@@ -97,6 +100,9 @@ static unsigned long brownstone_pin_config[] __initdata = { | |||
97 | GPIO111_MMC3_DAT0 | MFP_PULL_HIGH, | 100 | GPIO111_MMC3_DAT0 | MFP_PULL_HIGH, |
98 | GPIO112_MMC3_CMD | MFP_PULL_HIGH, | 101 | GPIO112_MMC3_CMD | MFP_PULL_HIGH, |
99 | GPIO151_MMC3_CLK, | 102 | GPIO151_MMC3_CLK, |
103 | |||
104 | /* 5V regulator */ | ||
105 | GPIO89_GPIO, | ||
100 | }; | 106 | }; |
101 | 107 | ||
102 | static struct regulator_consumer_supply max8649_supply[] = { | 108 | static struct regulator_consumer_supply max8649_supply[] = { |
@@ -123,6 +129,35 @@ static struct max8649_platform_data brownstone_max8649_info = { | |||
123 | .regulator = &max8649_init_data, | 129 | .regulator = &max8649_init_data, |
124 | }; | 130 | }; |
125 | 131 | ||
132 | static struct regulator_consumer_supply brownstone_v_5vp_supplies[] = { | ||
133 | REGULATOR_SUPPLY("v_5vp", NULL), | ||
134 | }; | ||
135 | |||
136 | static struct regulator_init_data brownstone_v_5vp_data = { | ||
137 | .constraints = { | ||
138 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
139 | }, | ||
140 | .num_consumer_supplies = ARRAY_SIZE(brownstone_v_5vp_supplies), | ||
141 | .consumer_supplies = brownstone_v_5vp_supplies, | ||
142 | }; | ||
143 | |||
144 | static struct fixed_voltage_config brownstone_v_5vp = { | ||
145 | .supply_name = "v_5vp", | ||
146 | .microvolts = 5000000, | ||
147 | .gpio = GPIO_5V_ENABLE, | ||
148 | .enable_high = 1, | ||
149 | .enabled_at_boot = 1, | ||
150 | .init_data = &brownstone_v_5vp_data, | ||
151 | }; | ||
152 | |||
153 | static struct platform_device brownstone_v_5vp_device = { | ||
154 | .name = "reg-fixed-voltage", | ||
155 | .id = 1, | ||
156 | .dev = { | ||
157 | .platform_data = &brownstone_v_5vp, | ||
158 | }, | ||
159 | }; | ||
160 | |||
126 | static struct max8925_platform_data brownstone_max8925_info = { | 161 | static struct max8925_platform_data brownstone_max8925_info = { |
127 | .irq_base = IRQ_BOARD_START, | 162 | .irq_base = IRQ_BOARD_START, |
128 | }; | 163 | }; |
@@ -154,6 +189,9 @@ static void __init brownstone_init(void) | |||
154 | mmp2_add_uart(3); | 189 | mmp2_add_uart(3); |
155 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); | 190 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); |
156 | mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ | 191 | mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ |
192 | |||
193 | /* enable 5v regulator */ | ||
194 | platform_device_register(&brownstone_v_5vp_device); | ||
157 | } | 195 | } |
158 | 196 | ||
159 | MACHINE_START(BROWNSTONE, "Brownstone Development Platform") | 197 | MACHINE_START(BROWNSTONE, "Brownstone Development Platform") |