linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: marek.vasut@gmail.com (Marek Vasut)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] pxa: Add core pmic support for Palm27x
Date: Tue, 13 Jul 2010 09:51:07 +0200	[thread overview]
Message-ID: <1279007468-20872-4-git-send-email-marek.vasut@gmail.com> (raw)
In-Reply-To: <1279007468-20872-1-git-send-email-marek.vasut@gmail.com>

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/mach-pxa/palm27x.c |   57 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c
index ff5ee8c..a1009ec 100644
--- a/arch/arm/mach-pxa/palm27x.c
+++ b/arch/arm/mach-pxa/palm27x.c
@@ -21,6 +21,7 @@
 #include <linux/wm97xx.h>
 #include <linux/power_supply.h>
 #include <linux/usb/gpio_vbus.h>
+#include <linux/regulator/max1586.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -35,6 +36,8 @@
 #include <mach/palmasoc.h>
 #include <mach/palm27x.h>
 
+#include <plat/i2c.h>
+
 #include "generic.h"
 #include "devices.h"
 
@@ -458,6 +461,59 @@ static void __init palm27x_power_init(int ac, int usb)
 static inline void palm27x_power_init(int ac, int usb) {}
 #endif
 
+/******************************************************************************
+ * Core power regulator
+ ******************************************************************************/
+#if defined(CONFIG_REGULATOR_MAX1586) || \
+    defined(CONFIG_REGULATOR_MAX1586_MODULE)
+static struct regulator_consumer_supply palm27x_max1587a_consumers[] = {
+	{
+		.supply	= "vcc_core",
+	}
+};
+
+static struct regulator_init_data palm27x_max1587a_v3_info = {
+	.constraints = {
+		.name		= "vcc_core range",
+		.min_uV		= 900000,
+		.max_uV		= 1705000,
+		.always_on	= 1,
+		.valid_ops_mask	= REGULATOR_CHANGE_VOLTAGE,
+	},
+	.consumer_supplies	= palm27x_max1587a_consumers,
+	.num_consumer_supplies	= ARRAY_SIZE(palm27x_max1587a_consumers),
+};
+
+static struct max1586_subdev_data palm27x_max1587a_subdevs[] = {
+	{
+		.name		= "vcc_core",
+		.id		= MAX1586_V3,
+		.platform_data	= &palm27x_max1587a_v3_info,
+	}
+};
+
+static struct max1586_platform_data palm27x_max1587a_info = {
+	.subdevs     = palm27x_max1587a_subdevs,
+	.num_subdevs = ARRAY_SIZE(palm27x_max1587a_subdevs),
+	.v3_gain     = MAX1586_GAIN_R24_3k32, /* 730..1550 mV */
+};
+
+static struct i2c_board_info __initdata palm27x_pi2c_board_info[] = {
+	{
+		I2C_BOARD_INFO("max1586", 0x14),
+		.platform_data	= &palm27x_max1587a_info,
+	},
+};
+
+static void __init palm27x_pmic_init(void)
+{
+	i2c_register_board_info(1, ARRAY_AND_SIZE(palm27x_pi2c_board_info));
+	pxa27x_set_i2c_power_info(NULL);
+}
+#else
+static inline void palm27x_pmic_init(void) {}
+#endif
+
 void __init palm27x_common_init(struct palm27x_handheld *palm)
 {
 	pxa_set_ffuart_info(NULL);
@@ -472,4 +528,5 @@ void __init palm27x_common_init(struct palm27x_handheld *palm)
 	palm27x_ac97_init(palm->batt_minv, palm->batt_maxv, palm->jack_gpio);
 	palm27x_pwm_init(palm->bl_bl, palm->bl_lcd);
 	palm27x_power_init(palm->power_ac, palm->power_usb);
+	palm27x_pmic_init();
 }
-- 
1.7.1

  parent reply	other threads:[~2010-07-13  7:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13  7:51 [PATCH 1/5] pxa: Sane naming of gpios for palm platform Marek Vasut
2010-07-13  7:51 ` [PATCH v2 2/5] pxa: Introduce Palm27x Marek Vasut
2010-07-13  7:51 ` [PATCH v2 3/5] pxa: Flip Palm LD, TX, T5, Z72 to Palm27x Marek Vasut
2010-07-13  7:51 ` Marek Vasut [this message]
2010-07-13  7:51 ` [PATCH 5/5] pxa: Modularize remnants of code in Palms Marek Vasut
  -- strict thread matches above, loose matches on Subject: below --
2010-07-13  7:38 [PATCH 1/5] pxa: Sane naming of gpios for palm platform Marek Vasut
2010-07-13  7:38 ` [PATCH 4/5] pxa: Add core pmic support for Palm27x Marek Vasut

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=1279007468-20872-4-git-send-email-marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).