aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-mmp
diff options
context:
space:
mode:
authorMark F. Brown <mark.brown314@gmail.com>2010-12-13 22:56:59 -0500
committerEric Miao <eric.y.miao@gmail.com>2010-12-20 23:07:49 +0800
commite97d0fac8492dd6566f71f9c81ed453c2105f459 (patch)
treeaf9f03dab437a0abff88f6a888388b7a3b76705f /arch/arm/mach-mmp
parenta8fb0b55314144a37755729d3b40b027b0020e3c (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>
Diffstat (limited to 'arch/arm/mach-mmp')
-rw-r--r--arch/arm/mach-mmp/brownstone.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c
index 635c4004ebe..7bb78fd5a2a 100644
--- a/arch/arm/mach-mmp/brownstone.c
+++ b/arch/arm/mach-mmp/brownstone.c
@@ -17,6 +17,7 @@
#include <linux/gpio.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/max8649.h>
+#include <linux/regulator/fixed.h>
#include <linux/mfd/max8925.h>
#include <asm/mach-types.h>
@@ -30,6 +31,8 @@
#define BROWNSTONE_NR_IRQS (IRQ_BOARD_START + 40)
+#define GPIO_5V_ENABLE (89)
+
static unsigned long brownstone_pin_config[] __initdata = {
/* UART1 */
GPIO29_UART1_RXD,
@@ -97,6 +100,9 @@ static unsigned long brownstone_pin_config[] __initdata = {
GPIO111_MMC3_DAT0 | MFP_PULL_HIGH,
GPIO112_MMC3_CMD | MFP_PULL_HIGH,
GPIO151_MMC3_CLK,
+
+ /* 5V regulator */
+ GPIO89_GPIO,
};
static struct regulator_consumer_supply max8649_supply[] = {
@@ -123,6 +129,35 @@ static struct max8649_platform_data brownstone_max8649_info = {
.regulator = &max8649_init_data,
};
+static struct regulator_consumer_supply brownstone_v_5vp_supplies[] = {
+ REGULATOR_SUPPLY("v_5vp", NULL),
+};
+
+static struct regulator_init_data brownstone_v_5vp_data = {
+ .constraints = {
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(brownstone_v_5vp_supplies),
+ .consumer_supplies = brownstone_v_5vp_supplies,
+};
+
+static struct fixed_voltage_config brownstone_v_5vp = {
+ .supply_name = "v_5vp",
+ .microvolts = 5000000,
+ .gpio = GPIO_5V_ENABLE,
+ .enable_high = 1,
+ .enabled_at_boot = 1,
+ .init_data = &brownstone_v_5vp_data,
+};
+
+static struct platform_device brownstone_v_5vp_device = {
+ .name = "reg-fixed-voltage",
+ .id = 1,
+ .dev = {
+ .platform_data = &brownstone_v_5vp,
+ },
+};
+
static struct max8925_platform_data brownstone_max8925_info = {
.irq_base = IRQ_BOARD_START,
};
@@ -154,6 +189,9 @@ static void __init brownstone_init(void)
mmp2_add_uart(3);
mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info));
mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
+
+ /* enable 5v regulator */
+ platform_device_register(&brownstone_v_5vp_device);
}
MACHINE_START(BROWNSTONE, "Brownstone Development Platform")