aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/max8997.h
diff options
context:
space:
mode:
authorMyungJoo Ham <myungjoo.ham@samsung.com>2011-03-10 21:34:44 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-23 05:42:07 -0400
commitbd6ca2cf50fbe3cc63513d026343035c3bd2e352 (patch)
treef5dd14851a7139a37781073ef3f1366254940415 /include/linux/mfd/max8997.h
parente93c53870c6d77c40de8981da238af947d6aa084 (diff)
regulator: MAX8997/8966 support
This patch supports PMIC/Regulator part of MAX8997/MAX8966 MFD. In this initial release, selecting voltages or current-limit and switching on/off the regulators are supported. Controlling voltages for DVS with GPIOs is not implemented fully and requires more considerations: it controls multiple bucks (selection of 1, 2, and 5) at the same time with SET1~3 gpios. Thus, when DVS-GPIO is activated, we lose the ability to control the voltage of a single buck regulator independently; i.e., contolling a buck affects other two bucks. Therefore, using the conventional regulator framework directly might be problematic. However, in this driver, we try to choose a setting without such side effect of affecting other regulators and then try to choose a setting with the minimum side effect (the sum of voltage changes in other regulators). On the other hand, controlling all the three bucks simultenously based on the voltage set table may help build cpufreq and similar system more robust; i.e., all the three voltages are consistent every time without glitches during transition. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include/linux/mfd/max8997.h')
-rw-r--r--include/linux/mfd/max8997.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
index d0d9136c104b..cb671b3451bf 100644
--- a/include/linux/mfd/max8997.h
+++ b/include/linux/mfd/max8997.h
@@ -68,6 +68,8 @@ enum max8998_regulators {
68 MAX8997_CHARGER_CV, /* control MBCCV of MBCCTRL3 */ 68 MAX8997_CHARGER_CV, /* control MBCCV of MBCCTRL3 */
69 MAX8997_CHARGER, /* charger current, MBCCTRL4 */ 69 MAX8997_CHARGER, /* charger current, MBCCTRL4 */
70 MAX8997_CHARGER_TOPOFF, /* MBCCTRL5 */ 70 MAX8997_CHARGER_TOPOFF, /* MBCCTRL5 */
71
72 MAX8997_REG_MAX,
71}; 73};
72 74
73struct max8997_regulator_data { 75struct max8997_regulator_data {
@@ -77,7 +79,31 @@ struct max8997_regulator_data {
77 79
78struct max8997_platform_data { 80struct max8997_platform_data {
79 bool wakeup; 81 bool wakeup;
80 /* PMIC: Not implemented */ 82 /* IRQ: Not implemented */
83 /* ---- PMIC ---- */
84 struct max8997_regulator_data *regulators;
85 int num_regulators;
86
87 /*
88 * SET1~3 DVS GPIOs control Buck1, 2, and 5 simultaneously. Therefore,
89 * With buckx_gpiodvs enabled, the buckx cannot be controlled
90 * independently. To control buckx (of 1, 2, and 5) independently,
91 * disable buckx_gpiodvs and control with BUCKxDVS1 register.
92 *
93 * When buckx_gpiodvs and bucky_gpiodvs are both enabled, set_voltage
94 * on buckx will change the voltage of bucky at the same time.
95 *
96 */
97 bool ignore_gpiodvs_side_effect;
98 int buck125_gpios[3]; /* GPIO of [0]SET1, [1]SET2, [2]SET3 */
99 int buck125_default_idx; /* Default value of SET1, 2, 3 */
100 unsigned int buck1_voltage[8]; /* buckx_voltage in uV */
101 bool buck1_gpiodvs;
102 unsigned int buck2_voltage[8];
103 bool buck2_gpiodvs;
104 unsigned int buck5_voltage[8];
105 bool buck5_gpiodvs;
106
81 /* MUIC: Not implemented */ 107 /* MUIC: Not implemented */
82 /* HAPTIC: Not implemented */ 108 /* HAPTIC: Not implemented */
83 /* RTC: Not implemented */ 109 /* RTC: Not implemented */