public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: eric.miao@marvell.com
Cc: broonie@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.arm.linux.org.uk,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: Patch to add mioa701 glue for voltage regulation
Date: Mon, 27 Apr 2009 23:11:28 +0200	[thread overview]
Message-ID: <87d4ax7qf3.fsf@free.fr> (raw)
In-Reply-To: <1240566136.27410.3291.camel@vega.slimlogic.co.uk> (Liam Girdwood's message of "Fri\, 24 Apr 2009 10\:42\:16 +0100")

Liam Girdwood <lrg@slimlogic.co.uk> writes:

> On Thu, 2009-04-23 at 20:30 +0200, Robert Jarzmik wrote:
>> Hi Mark and Eric,
>> 
>> I have that patch which adds voltage regulation definitions to mioa701
>> board. The trick is, this patch depends on two others :
>> 
>>  - one which will be merged through Mark's regulator tree.
>>    This one is mandatory as a compiling dependency exists through include files.
>> 
>>  - one which will be merge through Eric pxa tree.
>>    This is the cpufreq one, and has a "very weak" dependency, as only the
>>    "vcc_core" name _is_ the dependency.
>> 
>> I think the easiest way to solve the compiling dependency
>> (include/linux/regulator.max1586.h) is to make that patch go through regulator
>> tree as well for linux-next, even if it's arm machine specific, don't you ?
>> 
>
> If fine with this going through regulator providing I get an ACK from
> Eric.

Eric,

Since Liam took the max1586 regulator through his tree, would you state if you
ack that please ?

Cheers.

--
Robert

From: Robert Jarzmik <robert.jarzmik@free.fr>
Date: Mon, 20 Apr 2009 16:52:25 +0200
Subject: [PATCH] mioa701: add Maxim 1586 voltage regulator

On this board, the PXA272 CPU voltage VCC_CORE is provided
by a Maxim 1586 voltage regulator. Use the regulator
framework to provide VCC_CORE control. When cpufreq will be
updated to ask for vcc_core, this will optimize power
drained by the board.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
 arch/arm/mach-pxa/mioa701.c |   52 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index 204263d..facff90 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -37,6 +37,7 @@
 #include <linux/wm97xx_batt.h>
 #include <linux/mtd/physmap.h>
 #include <linux/usb/gpio_vbus.h>
+#include <linux/regulator/max1586.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -716,6 +717,48 @@ static struct wm97xx_batt_info mioa701_battery_data = {
 };
 
 /*
+ * Voltage regulation
+ */
+static struct regulator_consumer_supply max1586_consumers[] = {
+	{
+		.supply = "vcc_core",
+	}
+};
+
+static struct regulator_init_data max1586_v3_info = {
+	.constraints = {
+		.name = "vcc_core range",
+		.min_uV = 1000000,
+		.max_uV = 1705000,
+		.always_on = 1,
+		.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+	},
+	.num_consumer_supplies = ARRAY_SIZE(max1586_consumers),
+	.consumer_supplies = max1586_consumers,
+};
+
+static struct regulator_init_data max1586_v6_info = {
+	.constraints = {
+		.name = "vcc_usim range",
+		.min_uV = 1,
+		.max_uV = 3000000,
+		.always_on = 1,
+		.valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+	},
+	.num_consumer_supplies = 0,
+};
+
+static struct max1586_subdev_data max1586_subdevs[] = {
+	{ .name = "vcc_core", .id = MAX1586_V3,
+	  .platform_data = &max1586_v3_info },
+};
+
+static struct max1586_platform_data max1586_info = {
+	.subdevs = max1586_subdevs,
+	.num_subdevs = ARRAY_SIZE(max1586_subdevs),
+};
+
+/*
  * Camera interface
  */
 struct pxacamera_platform_data mioa701_pxacamera_platform_data = {
@@ -733,6 +776,13 @@ static struct i2c_board_info __initdata mioa701_i2c_devices[] = {
 	},
 };
 
+static struct i2c_board_info __initdata mioa701_pi2c_devices[] = {
+	{
+		I2C_BOARD_INFO("max1586", 0x14),
+		.platform_data = &max1586_info,
+	},
+};
+
 static struct soc_camera_link iclink = {
 	.bus_id		= 0, /* Match id in pxa27x_device_camera in device.c */
 	.board_info	= &mioa701_i2c_devices[0],
@@ -827,7 +877,9 @@ static void __init mioa701_machine_init(void)
 	platform_add_devices(devices, ARRAY_SIZE(devices));
 	gsm_init();
 
+	i2c_register_board_info(1, ARRAY_AND_SIZE(mioa701_pi2c_devices));
 	pxa_set_i2c_info(&i2c_pdata);
+	pxa27x_set_i2c_power_info(NULL);
 	pxa_set_camera_info(&mioa701_pxacamera_platform_data);
 }
 
-- 
1.6.2.1

  reply	other threads:[~2009-04-27 21:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23 18:30 Patch to add mioa701 glue for voltage regulation Robert Jarzmik
2009-04-23 19:13 ` Mark Brown
2009-04-24  9:42 ` Liam Girdwood
2009-04-27 21:11   ` Robert Jarzmik [this message]
2009-04-28  1:13     ` Eric Miao
2009-04-28 10:38       ` Liam Girdwood
2009-04-28  8:23     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d4ax7qf3.fsf@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=eric.miao@marvell.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox