1
0
Fork 0

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>
hifive-unleashed-5.1
MyungJoo Ham 2011-03-11 11:34:44 +09:00 committed by Samuel Ortiz
parent e93c53870c
commit bd6ca2cf50
4 changed files with 1250 additions and 1 deletions

View File

@ -108,6 +108,15 @@ config REGULATOR_MAX8952
via I2C bus. Maxim 8952 has one voltage output and supports 4 DVS
modes ranging from 0.77V to 1.40V by 0.01V steps.
config REGULATOR_MAX8997
tristate "Maxim 8997/8966 regulator"
depends on MFD_MAX8997
help
This driver controls a Maxim 8997/8966 regulator
via I2C bus. The provided regulator is suitable for S5PC110,
S5PV210, and Exynos-4 chips to control VCC_CORE and
VCC_USIM voltages.
config REGULATOR_MAX8998
tristate "Maxim 8998 voltage regulator"
depends on MFD_MAX8998

View File

@ -18,6 +18,7 @@ obj-$(CONFIG_REGULATOR_MAX8649) += max8649.o
obj-$(CONFIG_REGULATOR_MAX8660) += max8660.o
obj-$(CONFIG_REGULATOR_MAX8925) += max8925-regulator.o
obj-$(CONFIG_REGULATOR_MAX8952) += max8952.o
obj-$(CONFIG_REGULATOR_MAX8997) += max8997.o
obj-$(CONFIG_REGULATOR_MAX8998) += max8998.o
obj-$(CONFIG_REGULATOR_WM831X) += wm831x-dcdc.o
obj-$(CONFIG_REGULATOR_WM831X) += wm831x-isink.o

File diff suppressed because it is too large Load Diff

View File

@ -68,6 +68,8 @@ enum max8998_regulators {
MAX8997_CHARGER_CV, /* control MBCCV of MBCCTRL3 */
MAX8997_CHARGER, /* charger current, MBCCTRL4 */
MAX8997_CHARGER_TOPOFF, /* MBCCTRL5 */
MAX8997_REG_MAX,
};
struct max8997_regulator_data {
@ -77,7 +79,31 @@ struct max8997_regulator_data {
struct max8997_platform_data {
bool wakeup;
/* PMIC: Not implemented */
/* IRQ: Not implemented */
/* ---- PMIC ---- */
struct max8997_regulator_data *regulators;
int num_regulators;
/*
* SET1~3 DVS GPIOs control Buck1, 2, and 5 simultaneously. Therefore,
* With buckx_gpiodvs enabled, the buckx cannot be controlled
* independently. To control buckx (of 1, 2, and 5) independently,
* disable buckx_gpiodvs and control with BUCKxDVS1 register.
*
* When buckx_gpiodvs and bucky_gpiodvs are both enabled, set_voltage
* on buckx will change the voltage of bucky at the same time.
*
*/
bool ignore_gpiodvs_side_effect;
int buck125_gpios[3]; /* GPIO of [0]SET1, [1]SET2, [2]SET3 */
int buck125_default_idx; /* Default value of SET1, 2, 3 */
unsigned int buck1_voltage[8]; /* buckx_voltage in uV */
bool buck1_gpiodvs;
unsigned int buck2_voltage[8];
bool buck2_gpiodvs;
unsigned int buck5_voltage[8];
bool buck5_gpiodvs;
/* MUIC: Not implemented */
/* HAPTIC: Not implemented */
/* RTC: Not implemented */