* [PATCH] ARM: mmp: refactored 5V regulator support using fixed-regulator
@ 2010-12-14 3:56 Mark F. Brown
2010-12-15 18:14 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Mark F. Brown @ 2010-12-14 3:56 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Mark F. Brown <mark.brown314@gmail.com>
---
arch/arm/mach-mmp/brownstone.c | 48 +++++++++++++++++++++++++++------------
1 files changed, 33 insertions(+), 15 deletions(-)
diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c
index 9d37b35..9ebeb21 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>
@@ -128,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,
};
@@ -150,30 +180,18 @@ static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = {
.max_speed = 25000000,
};
-/* enable for MAX8815A regulator (5V_ENABLE) */
-static void brownstone_enable_5v_regulator(void)
-{
- int ret;
- ret = gpio_request(GPIO_5V_ENABLE, "5V_ENABLE");
- if (ret < 0)
- pr_warning("Unable to request GPIO_5V_ENABLE\n");
- else
- gpio_direction_output(GPIO_5V_ENABLE, 1);
- gpio_free(GPIO_5V_ENABLE);
-}
-
static void __init brownstone_init(void)
{
mfp_config(ARRAY_AND_SIZE(brownstone_pin_config));
- /* enable 5v regulator */
- brownstone_enable_5v_regulator();
-
/* on-chip devices */
mmp2_add_uart(1);
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")
--
1.7.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] ARM: mmp: refactored 5V regulator support using fixed-regulator
2010-12-14 3:56 [PATCH] ARM: mmp: refactored 5V regulator support using fixed-regulator Mark F. Brown
@ 2010-12-15 18:14 ` Mark Brown
2010-12-16 3:25 ` Mark F. Brown
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2010-12-15 18:14 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 13, 2010 at 10:56:59PM -0500, Mark F. Brown wrote:
> Signed-off-by: Mark F. Brown <mark.brown314@gmail.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: mmp: refactored 5V regulator support using fixed-regulator
2010-12-15 18:14 ` Mark Brown
@ 2010-12-16 3:25 ` Mark F. Brown
2010-12-16 6:12 ` Eric Miao
0 siblings, 1 reply; 4+ messages in thread
From: Mark F. Brown @ 2010-12-16 3:25 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Dec 15, 2010 at 1:14 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Mon, Dec 13, 2010 at 10:56:59PM -0500, Mark F. Brown wrote:
>> Signed-off-by: Mark F. Brown <mark.brown314@gmail.com>
>
> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>
Hi Eric,
can you update this patch with reviewed-by by Mark?
Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ARM: mmp: refactored 5V regulator support using fixed-regulator
2010-12-16 3:25 ` Mark F. Brown
@ 2010-12-16 6:12 ` Eric Miao
0 siblings, 0 replies; 4+ messages in thread
From: Eric Miao @ 2010-12-16 6:12 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Dec 16, 2010 at 11:25 AM, Mark F. Brown <mark.brown314@gmail.com> wrote:
> On Wed, Dec 15, 2010 at 1:14 PM, Mark Brown
> <broonie@opensource.wolfsonmicro.com> wrote:
>> On Mon, Dec 13, 2010 at 10:56:59PM -0500, Mark F. Brown wrote:
>>> Signed-off-by: Mark F. Brown <mark.brown314@gmail.com>
>>
>> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
>>
>
> Hi Eric,
>
> ?can you update this patch with reviewed-by by Mark?
>
OK, applied. The previous patch was superseded by this one, and
with Mark's reviewed-by.
BTW - it's interesting to see both Marks in the same patch, hopefully
people won't think that the patch was signed and reviewed by same
person with different email address. Heh, just kidding :-)
> Thanks!
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-16 6:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-14 3:56 [PATCH] ARM: mmp: refactored 5V regulator support using fixed-regulator Mark F. Brown
2010-12-15 18:14 ` Mark Brown
2010-12-16 3:25 ` Mark F. Brown
2010-12-16 6:12 ` Eric Miao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).