Initial Contribution

msm-2.6.38: tag AU_LINUX_ANDROID_GINGERBREAD.02.03.04.00.142

Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 9e87c1c..d210407 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -237,6 +237,11 @@
 {
 }
 
+static inline int regulator_count_voltages(struct regulator *regulator)
+{
+	return 0;
+}
+
 static inline int regulator_set_voltage(struct regulator *regulator,
 					int min_uV, int max_uV)
 {
diff --git a/include/linux/regulator/gpio-regulator.h b/include/linux/regulator/gpio-regulator.h
new file mode 100644
index 0000000..68abf45
--- /dev/null
+++ b/include/linux/regulator/gpio-regulator.h
@@ -0,0 +1,37 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __GPIO_REGULATOR_H__
+#define __GPIO_REGULATOR_H__
+
+#include <linux/regulator/machine.h>
+
+#define GPIO_REGULATOR_DEV_NAME "gpio-regulator"
+
+/**
+ * struct gpio_regulator_platform_data - GPIO regulator platform data
+ * @init_data:		regulator constraints
+ * @gpio_label:		label to use when requesting the GPIO
+ * @regulator_name:	name for regulator used during registration
+ * @gpio:		gpio number
+ * @active_low:		0 = regulator is enabled when GPIO outputs high
+ *			1 = regulator is enabled when GPIO outputs low
+ */
+struct gpio_regulator_platform_data {
+	struct regulator_init_data	init_data;
+	char				*gpio_label;
+	char				*regulator_name;
+	unsigned			gpio;
+	int				active_low;
+};
+
+#endif
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index ce3127a..6804ef3 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -192,6 +192,7 @@
 #ifdef CONFIG_REGULATOR
 void regulator_has_full_constraints(void);
 void regulator_use_dummy_regulator(void);
+void regulator_suppress_info_printing(void);
 #else
 static inline void regulator_has_full_constraints(void)
 {
@@ -200,6 +201,10 @@
 static inline void regulator_use_dummy_regulator(void)
 {
 }
+
+static inline void regulator_suppress_info_printing(void)
+{
+}
 #endif
 
 #endif
diff --git a/include/linux/regulator/pm8058-xo.h b/include/linux/regulator/pm8058-xo.h
new file mode 100644
index 0000000..9b363c4
--- /dev/null
+++ b/include/linux/regulator/pm8058-xo.h
@@ -0,0 +1,30 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __PM8058_XO_H__
+#define __PM8058_XO_H__
+
+#include <linux/regulator/machine.h>
+
+#define PM8058_XO_BUFFER_DEV_NAME	"pm8058-xo-buffer"
+
+/* XO buffer control ids */
+#define PM8058_XO_ID_A0		0
+#define PM8058_XO_ID_A1		1
+
+#define PM8058_XO_ID_MAX	(PM8058_XO_ID_A1 + 1)
+
+struct pm8058_xo_pdata {
+	struct regulator_init_data	init_data;
+};
+
+#endif
diff --git a/include/linux/regulator/pm8921-regulator.h b/include/linux/regulator/pm8921-regulator.h
new file mode 100644
index 0000000..5ed5b0d
--- /dev/null
+++ b/include/linux/regulator/pm8921-regulator.h
@@ -0,0 +1,155 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __PM8921_REGULATOR_H__
+#define __PM8921_REGULATOR_H__
+
+#include <linux/regulator/machine.h>
+
+#define PM8921_REGULATOR_DEV_NAME	"pm8921-regulator"
+
+/**
+ * enum pm8921_vreg_id - PMIC 8921 regulator ID numbers
+ */
+enum pm8921_vreg_id {
+	PM8921_VREG_ID_L1 = 0,
+	PM8921_VREG_ID_L2,
+	PM8921_VREG_ID_L3,
+	PM8921_VREG_ID_L4,
+	PM8921_VREG_ID_L5,
+	PM8921_VREG_ID_L6,
+	PM8921_VREG_ID_L7,
+	PM8921_VREG_ID_L8,
+	PM8921_VREG_ID_L9,
+	PM8921_VREG_ID_L10,
+	PM8921_VREG_ID_L11,
+	PM8921_VREG_ID_L12,
+	PM8921_VREG_ID_L14,
+	PM8921_VREG_ID_L15,
+	PM8921_VREG_ID_L16,
+	PM8921_VREG_ID_L17,
+	PM8921_VREG_ID_L18,
+	PM8921_VREG_ID_L21,
+	PM8921_VREG_ID_L22,
+	PM8921_VREG_ID_L23,
+	PM8921_VREG_ID_L24,
+	PM8921_VREG_ID_L25,
+	PM8921_VREG_ID_L26,
+	PM8921_VREG_ID_L27,
+	PM8921_VREG_ID_L28,
+	PM8921_VREG_ID_L29,
+	PM8921_VREG_ID_S1,
+	PM8921_VREG_ID_S2,
+	PM8921_VREG_ID_S3,
+	PM8921_VREG_ID_S4,
+	PM8921_VREG_ID_S5,
+	PM8921_VREG_ID_S6,
+	PM8921_VREG_ID_S7,
+	PM8921_VREG_ID_S8,
+	PM8921_VREG_ID_LVS1,
+	PM8921_VREG_ID_LVS2,
+	PM8921_VREG_ID_LVS3,
+	PM8921_VREG_ID_LVS4,
+	PM8921_VREG_ID_LVS5,
+	PM8921_VREG_ID_LVS6,
+	PM8921_VREG_ID_LVS7,
+	PM8921_VREG_ID_USB_OTG,
+	PM8921_VREG_ID_HDMI_MVS,
+	PM8921_VREG_ID_NCP,
+	/* The following are IDs for regulator devices to enable pin control. */
+	PM8921_VREG_ID_L1_PC,
+	PM8921_VREG_ID_L2_PC,
+	PM8921_VREG_ID_L3_PC,
+	PM8921_VREG_ID_L4_PC,
+	PM8921_VREG_ID_L5_PC,
+	PM8921_VREG_ID_L6_PC,
+	PM8921_VREG_ID_L7_PC,
+	PM8921_VREG_ID_L8_PC,
+	PM8921_VREG_ID_L9_PC,
+	PM8921_VREG_ID_L10_PC,
+	PM8921_VREG_ID_L11_PC,
+	PM8921_VREG_ID_L12_PC,
+	PM8921_VREG_ID_L14_PC,
+	PM8921_VREG_ID_L15_PC,
+	PM8921_VREG_ID_L16_PC,
+	PM8921_VREG_ID_L17_PC,
+	PM8921_VREG_ID_L18_PC,
+	PM8921_VREG_ID_L21_PC,
+	PM8921_VREG_ID_L22_PC,
+	PM8921_VREG_ID_L23_PC,
+
+	PM8921_VREG_ID_L29_PC,
+	PM8921_VREG_ID_S1_PC,
+	PM8921_VREG_ID_S2_PC,
+	PM8921_VREG_ID_S3_PC,
+	PM8921_VREG_ID_S4_PC,
+
+	PM8921_VREG_ID_S7_PC,
+	PM8921_VREG_ID_S8_PC,
+	PM8921_VREG_ID_LVS1_PC,
+
+	PM8921_VREG_ID_LVS3_PC,
+	PM8921_VREG_ID_LVS4_PC,
+	PM8921_VREG_ID_LVS5_PC,
+	PM8921_VREG_ID_LVS6_PC,
+	PM8921_VREG_ID_LVS7_PC,
+
+	PM8921_VREG_ID_MAX,
+};
+
+/* Pin control input pins. */
+#define PM8921_VREG_PIN_CTRL_NONE	0x00
+#define PM8921_VREG_PIN_CTRL_D1		0x01
+#define PM8921_VREG_PIN_CTRL_A0		0x02
+#define PM8921_VREG_PIN_CTRL_A1		0x04
+#define PM8921_VREG_PIN_CTRL_A2		0x08
+
+/* Minimum high power mode loads in uA. */
+#define PM8921_VREG_LDO_50_HPM_MIN_LOAD		5000
+#define PM8921_VREG_LDO_150_HPM_MIN_LOAD	10000
+#define PM8921_VREG_LDO_300_HPM_MIN_LOAD	10000
+#define PM8921_VREG_LDO_600_HPM_MIN_LOAD	10000
+#define PM8921_VREG_LDO_1200_HPM_MIN_LOAD	10000
+#define PM8921_VREG_SMPS_1500_HPM_MIN_LOAD	100000
+#define PM8921_VREG_SMPS_2000_HPM_MIN_LOAD	100000
+
+/**
+ * enum pm8921_vreg_pin_function - action to perform when pin control is active
+ * %PM8921_VREG_PIN_FN_ENABLE:	pin control enables the regulator
+ * %PM8921_VREG_PIN_FN_MODE:	pin control changes mode from LPM to HPM
+ */
+enum pm8921_vreg_pin_function {
+	PM8921_VREG_PIN_FN_ENABLE = 0,
+	PM8921_VREG_PIN_FN_MODE,
+};
+
+/**
+ * struct pm8921_regulator_platform_data - PMIC 8921 regulator platform data
+ * @init_data:		regulator constraints
+ * @id:			regulator id; from enum pm8921_vreg_id
+ * @pull_down_enable:	0 = no pulldown, 1 = pulldown when regulator disabled
+ * @pin_ctrl:		pin control inputs to use for the regulator; should be
+ *			a combination of PM8921_VREG_PIN_CTRL_* values
+ * @pin_fn:		action to perform when pin control pin is active
+ * @system_uA:		current drawn from regulator not accounted for by any
+ *			regulator framework consumer
+ */
+struct pm8921_regulator_platform_data {
+	struct regulator_init_data	init_data;
+	enum pm8921_vreg_id		id;
+	unsigned			pull_down_enable;
+	unsigned			pin_ctrl;
+	enum pm8921_vreg_pin_function	pin_fn;
+	int				system_uA;
+};
+
+#endif
diff --git a/include/linux/regulator/pmic8058-regulator.h b/include/linux/regulator/pmic8058-regulator.h
new file mode 100644
index 0000000..83d4412
--- /dev/null
+++ b/include/linux/regulator/pmic8058-regulator.h
@@ -0,0 +1,88 @@
+/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __PMIC8058_REGULATOR_H__
+#define __PMIC8058_REGULATOR_H__
+
+#include <linux/regulator/machine.h>
+
+/* Low dropout regulator ids */
+#define PM8058_VREG_ID_L0	0
+#define PM8058_VREG_ID_L1	1
+#define PM8058_VREG_ID_L2	2
+#define PM8058_VREG_ID_L3	3
+#define PM8058_VREG_ID_L4	4
+#define PM8058_VREG_ID_L5	5
+#define PM8058_VREG_ID_L6	6
+#define PM8058_VREG_ID_L7	7
+#define PM8058_VREG_ID_L8	8
+#define PM8058_VREG_ID_L9	9
+#define PM8058_VREG_ID_L10	10
+#define PM8058_VREG_ID_L11	11
+#define PM8058_VREG_ID_L12	12
+#define PM8058_VREG_ID_L13	13
+#define PM8058_VREG_ID_L14	14
+#define PM8058_VREG_ID_L15	15
+#define PM8058_VREG_ID_L16	16
+#define PM8058_VREG_ID_L17	17
+#define PM8058_VREG_ID_L18	18
+#define PM8058_VREG_ID_L19	19
+#define PM8058_VREG_ID_L20	20
+#define PM8058_VREG_ID_L21	21
+#define PM8058_VREG_ID_L22	22
+#define PM8058_VREG_ID_L23	23
+#define PM8058_VREG_ID_L24	24
+#define PM8058_VREG_ID_L25	25
+
+/* Switched-mode power supply regulator ids */
+#define PM8058_VREG_ID_S0	26
+#define PM8058_VREG_ID_S1	27
+#define PM8058_VREG_ID_S2	28
+#define PM8058_VREG_ID_S3	29
+#define PM8058_VREG_ID_S4	30
+
+/* Low voltage switch regulator ids */
+#define PM8058_VREG_ID_LVS0	31
+#define PM8058_VREG_ID_LVS1	32
+
+/* Negative charge pump regulator id */
+#define PM8058_VREG_ID_NCP	33
+
+#define PM8058_VREG_MAX		(PM8058_VREG_ID_NCP + 1)
+
+#define PM8058_VREG_PIN_CTRL_NONE	0x00
+#define PM8058_VREG_PIN_CTRL_A0		0x01
+#define PM8058_VREG_PIN_CTRL_A1		0x02
+#define PM8058_VREG_PIN_CTRL_D0		0x04
+#define PM8058_VREG_PIN_CTRL_D1		0x08
+
+/* Minimum high power mode loads in uA. */
+#define PM8058_VREG_LDO_50_HPM_MIN_LOAD		5000
+#define PM8058_VREG_LDO_150_HPM_MIN_LOAD	10000
+#define PM8058_VREG_LDO_300_HPM_MIN_LOAD	10000
+#define PM8058_VREG_SMPS_HPM_MIN_LOAD		50000
+
+/* Pin ctrl enables/disables or toggles high/low power modes */
+enum pm8058_vreg_pin_fn {
+	PM8058_VREG_PIN_FN_ENABLE = 0,
+	PM8058_VREG_PIN_FN_MODE,
+};
+
+struct pm8058_vreg_pdata {
+	struct regulator_init_data	init_data;
+	unsigned			pull_down_enable;
+	unsigned			pin_ctrl;
+	enum pm8058_vreg_pin_fn		pin_fn;
+};
+
+#endif
diff --git a/include/linux/regulator/pmic8901-regulator.h b/include/linux/regulator/pmic8901-regulator.h
new file mode 100644
index 0000000..953c4ad
--- /dev/null
+++ b/include/linux/regulator/pmic8901-regulator.h
@@ -0,0 +1,79 @@
+/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __PMIC8901_REGULATOR_H__
+#define __PMIC8901_REGULATOR_H__
+
+#include <linux/regulator/machine.h>
+
+/* Low dropout regulator ids */
+#define PM8901_VREG_ID_L0	0
+#define PM8901_VREG_ID_L1	1
+#define PM8901_VREG_ID_L2	2
+#define PM8901_VREG_ID_L3	3
+#define PM8901_VREG_ID_L4	4
+#define PM8901_VREG_ID_L5	5
+#define PM8901_VREG_ID_L6	6
+
+/* Switched-mode power supply regulator ids */
+#define PM8901_VREG_ID_S0	7
+#define PM8901_VREG_ID_S1	8
+#define PM8901_VREG_ID_S2	9
+#define PM8901_VREG_ID_S3	10
+#define PM8901_VREG_ID_S4	11
+
+/* External regulator controlled by MPP pin ids */
+#define PM8901_VREG_ID_MPP0	12
+
+/* Low voltage switch regulator ids */
+#define PM8901_VREG_ID_LVS0	13
+#define PM8901_VREG_ID_LVS1	14
+#define PM8901_VREG_ID_LVS2	15
+#define PM8901_VREG_ID_LVS3	16
+
+/* Medium voltage switch regulator ids */
+#define PM8901_VREG_ID_MVS0	17
+
+/* USB OTG voltage switch regulator ids */
+#define PM8901_VREG_ID_USB_OTG	18
+
+/* HDMI medium voltage switch regulator ids */
+#define PM8901_VREG_ID_HDMI_MVS	19
+
+#define PM8901_VREG_MAX		(PM8901_VREG_ID_HDMI_MVS + 1)
+
+#define PM8901_VREG_PIN_CTRL_NONE	0x00
+#define PM8901_VREG_PIN_CTRL_A0		0x01
+#define PM8901_VREG_PIN_CTRL_A1		0x02
+#define PM8901_VREG_PIN_CTRL_D0		0x04
+#define PM8901_VREG_PIN_CTRL_D1		0x08
+
+/* Minimum high power mode loads in uA. */
+#define PM8901_VREG_LDO_300_HPM_MIN_LOAD	10000
+#define PM8901_VREG_FTSMPS_HPM_MIN_LOAD		100000
+
+/* Pin ctrl enables/disables or toggles high/low power modes */
+enum pm8901_vreg_pin_fn {
+	PM8901_VREG_PIN_FN_ENABLE = 0,
+	PM8901_VREG_PIN_FN_MODE,
+};
+
+struct pm8901_vreg_pdata {
+	struct regulator_init_data	init_data;
+	unsigned			pull_down_enable;
+	unsigned			pin_ctrl;
+	enum pm8901_vreg_pin_fn		pin_fn;
+	unsigned			active_high; /* For use with MPP. */
+};
+
+#endif