summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2012-04-08 21:48:52 +0200
committerJiri Kosina <jkosina@suse.cz>2012-04-08 21:48:52 +0200
commite75d660672ddd11704b7f0fdb8ff21968587b266 (patch)
treeccb9c107744c10b553c0373e450bee3971d16c00 /drivers/regulator
parent61282f37927143e45b03153f3e7b48d6b702147a (diff)
parent0034102808e0dbbf3a2394b82b1bb40b5778de9e (diff)
Merge branch 'master' into for-next
Merge with latest Linus' tree, as I have incoming patches that fix code that is newer than current HEAD of for-next. Conflicts: drivers/net/ethernet/realtek/r8169.c
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/88pm8607.c6
-rw-r--r--drivers/regulator/Kconfig291
-rw-r--r--drivers/regulator/Makefile47
-rw-r--r--drivers/regulator/aat2870-regulator.c14
-rw-r--r--drivers/regulator/ab8500.c10
-rw-r--r--drivers/regulator/ad5398.c4
-rw-r--r--drivers/regulator/anatop-regulator.c242
-rw-r--r--drivers/regulator/bq24022.c162
-rw-r--r--drivers/regulator/core.c208
-rw-r--r--drivers/regulator/da903x.c12
-rw-r--r--drivers/regulator/da9052-regulator.c20
-rw-r--r--drivers/regulator/db8500-prcmu.c118
-rw-r--r--drivers/regulator/dbx500-prcmu.c241
-rw-r--r--drivers/regulator/dbx500-prcmu.h63
-rw-r--r--drivers/regulator/fixed-helper.c52
-rw-r--r--drivers/regulator/fixed.c4
-rw-r--r--drivers/regulator/isl6271a-regulator.c14
-rw-r--r--drivers/regulator/max1586.c4
-rw-r--r--drivers/regulator/max8649.c7
-rw-r--r--drivers/regulator/max8660.c16
-rw-r--r--drivers/regulator/max8925-regulator.c4
-rw-r--r--drivers/regulator/max8997.c37
-rw-r--r--drivers/regulator/max8998.c16
-rw-r--r--drivers/regulator/mc13783-regulator.c3
-rw-r--r--drivers/regulator/mc13892-regulator.c10
-rw-r--r--drivers/regulator/mc13xxx-regulator-core.c2
-rw-r--r--drivers/regulator/pcf50633-regulator.c27
-rw-r--r--drivers/regulator/s5m8767.c790
-rw-r--r--drivers/regulator/tps62360-regulator.c472
-rw-r--r--drivers/regulator/tps65023-regulator.c4
-rw-r--r--drivers/regulator/tps6507x-regulator.c283
-rw-r--r--drivers/regulator/tps65217-regulator.c378
-rw-r--r--drivers/regulator/tps6524x-regulator.c6
-rw-r--r--drivers/regulator/tps6586x-regulator.c7
-rw-r--r--drivers/regulator/tps65910-regulator.c400
-rw-r--r--drivers/regulator/tps65912-regulator.c340
-rw-r--r--drivers/regulator/twl-regulator.c327
-rw-r--r--drivers/regulator/wm831x-dcdc.c9
-rw-r--r--drivers/regulator/wm831x-isink.c2
-rw-r--r--drivers/regulator/wm831x-ldo.c7
-rw-r--r--drivers/regulator/wm8350-regulator.c38
-rw-r--r--drivers/regulator/wm8400-regulator.c6
-rw-r--r--drivers/regulator/wm8994-regulator.c4
43 files changed, 3463 insertions, 1244 deletions
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c
index df33530cec4a..28b81ae4cf7f 100644
--- a/drivers/regulator/88pm8607.c
+++ b/drivers/regulator/88pm8607.c
@@ -196,7 +196,7 @@ static const unsigned int LDO12_suspend_table[] = {
};
static const unsigned int LDO13_table[] = {
- 1300000, 1800000, 2000000, 2500000, 2800000, 3000000, 0, 0,
+ 1200000, 1300000, 1800000, 2000000, 2500000, 2800000, 3000000, 0,
};
static const unsigned int LDO13_suspend_table[] = {
@@ -389,10 +389,10 @@ static struct pm8607_regulator_info pm8607_regulator_info[] = {
PM8607_LDO( 7, LDO7, 0, 3, SUPPLIES_EN12, 1),
PM8607_LDO( 8, LDO8, 0, 3, SUPPLIES_EN12, 2),
PM8607_LDO( 9, LDO9, 0, 3, SUPPLIES_EN12, 3),
- PM8607_LDO(10, LDO10, 0, 3, SUPPLIES_EN12, 4),
+ PM8607_LDO(10, LDO10, 0, 4, SUPPLIES_EN12, 4),
PM8607_LDO(12, LDO12, 0, 4, SUPPLIES_EN12, 5),
PM8607_LDO(13, VIBRATOR_SET, 1, 3, VIBRATOR_SET, 0),
- PM8607_LDO(14, LDO14, 0, 4, SUPPLIES_EN12, 6),
+ PM8607_LDO(14, LDO14, 0, 3, SUPPLIES_EN12, 6),
};
static int __devinit pm8607_regulator_probe(struct platform_device *pdev)
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 7a61b17ddd04..36db5a441eba 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -74,13 +74,72 @@ config REGULATOR_GPIO
and the platform has to provide a mapping of GPIO-states
to target volts/amps.
-config REGULATOR_BQ24022
- tristate "TI bq24022 Dual Input 1-Cell Li-Ion Charger IC"
+config REGULATOR_AD5398
+ tristate "Analog Devices AD5398/AD5821 regulators"
+ depends on I2C
+ help
+ This driver supports AD5398 and AD5821 current regulator chips.
+ If building into module, its name is ad5398.ko.
+
+config REGULATOR_AAT2870
+ tristate "AnalogicTech AAT2870 Regulators"
+ depends on MFD_AAT2870_CORE
+ help
+ If you have a AnalogicTech AAT2870 say Y to enable the
+ regulator driver.
+
+config REGULATOR_DA903X
+ tristate "Dialog Semiconductor DA9030/DA9034 regulators"
+ depends on PMIC_DA903X
+ help
+ Say y here to support the BUCKs and LDOs regulators found on
+ Dialog Semiconductor DA9030/DA9034 PMIC.
+
+config REGULATOR_DA9052
+ tristate "Dialog Semiconductor DA9052/DA9053 regulators"
+ depends on PMIC_DA9052
+ help
+ This driver supports the voltage regulators of DA9052-BC and
+ DA9053-AA/Bx PMIC.
+
+config REGULATOR_ANATOP
+ tristate "Freescale i.MX on-chip ANATOP LDO regulators"
+ depends on MFD_ANATOP
+ help
+ Say y here to support Freescale i.MX on-chip ANATOP LDOs
+ regulators. It is recommended that this option be
+ enabled on i.MX6 platform.
+
+config REGULATOR_MC13XXX_CORE
+ tristate
+
+config REGULATOR_MC13783
+ tristate "Freescale MC13783 regulator driver"
+ depends on MFD_MC13783
+ select REGULATOR_MC13XXX_CORE
+ help
+ Say y here to support the regulators found on the Freescale MC13783
+ PMIC.
+
+config REGULATOR_MC13892
+ tristate "Freescale MC13892 regulator driver"
+ depends on MFD_MC13XXX
+ select REGULATOR_MC13XXX_CORE
+ help
+ Say y here to support the regulators found on the Freescale MC13892
+ PMIC.
+
+config REGULATOR_ISL6271A
+ tristate "Intersil ISL6271A Power regulator"
+ depends on I2C
help
- This driver controls a TI bq24022 Charger attached via
- GPIOs. The provided current regulator can enable/disable
- charging select between 100 mA and 500 mA charging current
- limit.
+ This driver supports ISL6271A voltage regulator chip.
+
+config REGULATOR_88PM8607
+ bool "Marvell 88PM8607 Power regulators"
+ depends on MFD_88PM860X=y
+ help
+ This driver supports 88PM8607 voltage regulator chips.
config REGULATOR_MAX1586
tristate "Maxim 1586/1587 voltage regulator"
@@ -136,61 +195,12 @@ config REGULATOR_MAX8998
via I2C bus. The provided regulator is suitable for S3C6410
and S5PC1XX chips to control VCC_CORE and VCC_USIM voltages.
-config REGULATOR_TWL4030
- bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 PMIC"
- depends on TWL4030_CORE
- help
- This driver supports the voltage regulators provided by
- this family of companion chips.
-
-config REGULATOR_WM831X
- tristate "Wolfson Microelcronics WM831x PMIC regulators"
- depends on MFD_WM831X
- help
- Support the voltage and current regulators of the WM831x series
- of PMIC devices.
-
-config REGULATOR_WM8350
- tristate "Wolfson Microelectronics WM8350 AudioPlus PMIC"
- depends on MFD_WM8350
- help
- This driver provides support for the voltage and current regulators
- of the WM8350 AudioPlus PMIC.
-
-config REGULATOR_WM8400
- tristate "Wolfson Microelectronics WM8400 AudioPlus PMIC"
- depends on MFD_WM8400
- help
- This driver provides support for the voltage regulators of the
- WM8400 AudioPlus PMIC.
-
-config REGULATOR_WM8994
- tristate "Wolfson Microelectronics WM8994 CODEC"
- depends on MFD_WM8994
- help
- This driver provides support for the voltage regulators on the
- WM8994 CODEC.
-
-config REGULATOR_DA903X
- tristate "Support regulators on Dialog Semiconductor DA9030/DA9034 PMIC"
- depends on PMIC_DA903X
- help
- Say y here to support the BUCKs and LDOs regulators found on
- Dialog Semiconductor DA9030/DA9034 PMIC.
-
-config REGULATOR_DA9052
- tristate "Dialog DA9052/DA9053 regulators"
- depends on PMIC_DA9052
- help
- This driver supports the voltage regulators of DA9052-BC and
- DA9053-AA/Bx PMIC.
-
-config REGULATOR_PCF50633
- tristate "PCF50633 regulator driver"
- depends on MFD_PCF50633
+config REGULATOR_PCAP
+ tristate "Motorola PCAP2 regulator driver"
+ depends on EZX_PCAP
help
- Say Y here to support the voltage regulators and convertors
- on PCF50633
+ This driver provides support for the voltage regulators of the
+ PCAP2 PMIC.
config REGULATOR_LP3971
tristate "National Semiconductors LP3971 PMIC regulator driver"
@@ -206,31 +216,20 @@ config REGULATOR_LP3972
Say Y here to support the voltage regulators and convertors
on National Semiconductors LP3972 PMIC
-config REGULATOR_PCAP
- tristate "PCAP2 regulator driver"
- depends on EZX_PCAP
- help
- This driver provides support for the voltage regulators of the
- PCAP2 PMIC.
-
-config REGULATOR_MC13XXX_CORE
- tristate
-
-config REGULATOR_MC13783
- tristate "Support regulators on Freescale MC13783 PMIC"
- depends on MFD_MC13783
- select REGULATOR_MC13XXX_CORE
+config REGULATOR_PCF50633
+ tristate "NXP PCF50633 regulator driver"
+ depends on MFD_PCF50633
help
- Say y here to support the regulators found on the Freescale MC13783
- PMIC.
+ Say Y here to support the voltage regulators and convertors
+ on PCF50633
-config REGULATOR_MC13892
- tristate "Support regulators on Freescale MC13892 PMIC"
- depends on MFD_MC13XXX
- select REGULATOR_MC13XXX_CORE
+config REGULATOR_S5M8767
+ tristate "Samsung S5M8767A voltage regulator"
+ depends on MFD_S5M_CORE
help
- Say y here to support the regulators found on the Freescale MC13892
- PMIC.
+ This driver supports a Samsung S5M8767A voltage output regulator
+ via I2C bus. S5M8767A have 9 Bucks and 28 LDOs output and
+ supports DVS mode with 8bits of output voltage control.
config REGULATOR_AB3100
tristate "ST-Ericsson AB3100 Regulator functions"
@@ -241,6 +240,24 @@ config REGULATOR_AB3100
AB3100 analog baseband dealing with power regulators
for the system.
+config REGULATOR_AB8500
+ bool "ST-Ericsson AB8500 Power Regulators"
+ depends on AB8500_CORE
+ help
+ This driver supports the regulators found on the ST-Ericsson mixed
+ signal AB8500 PMIC
+
+config REGULATOR_DBX500_PRCMU
+ bool
+
+config REGULATOR_DB8500_PRCMU
+ bool "ST-Ericsson DB8500 Voltage Domain Regulators"
+ depends on MFD_DB8500_PRCMU
+ select REGULATOR_DBX500_PRCMU
+ help
+ This driver supports the voltage domain regulators controlled by the
+ DB8500 PRCMU
+
config REGULATOR_TPS6105X
tristate "TI TPS6105X Power regulators"
depends on TPS6105X
@@ -250,6 +267,16 @@ config REGULATOR_TPS6105X
It is a single boost converter primarily for white LEDs and
audio amplifiers.
+config REGULATOR_TPS62360
+ tristate "TI TPS62360 Power Regulator"
+ depends on I2C
+ select REGMAP_I2C
+ help
+ This driver supports TPS62360 voltage regulator chip. This
+ regulator is meant for processor core supply. This chip is
+ high-frequency synchronous step down dc-dc converter optimized
+ for battery-powered portable applications.
+
config REGULATOR_TPS65023
tristate "TI TPS65023 Power regulators"
depends on I2C
@@ -267,73 +294,77 @@ config REGULATOR_TPS6507X
three step-down converters and two general-purpose LDO voltage regulators.
It supports TI's software based Class-2 SmartReflex implementation.
-config REGULATOR_TPS65912
- tristate "TI TPS65912 Power regulator"
- depends on (MFD_TPS65912_I2C || MFD_TPS65912_SPI)
+config REGULATOR_TPS65217
+ tristate "TI TPS65217 Power regulators"
+ depends on MFD_TPS65217
help
- This driver supports TPS65912 voltage regulator chip.
+ This driver supports TPS65217 voltage regulator chips. TPS65217
+ provides three step-down converters and four general-purpose LDO
+ voltage regulators. It supports software based voltage control
+ for different voltage domains
-config REGULATOR_88PM8607
- bool "Marvell 88PM8607 Power regulators"
- depends on MFD_88PM860X=y
+config REGULATOR_TPS6524X
+ tristate "TI TPS6524X Power regulators"
+ depends on SPI
help
- This driver supports 88PM8607 voltage regulator chips.
+ This driver supports TPS6524X voltage regulator chips. TPS6524X
+ provides three step-down converters and two general-purpose LDO
+ voltage regulators. This device is interfaced using a customized
+ serial interface currently supported on the sequencer serial
+ port controller.
-config REGULATOR_ISL6271A
- tristate "Intersil ISL6271A Power regulator"
- depends on I2C
+config REGULATOR_TPS6586X
+ tristate "TI TPS6586X Power regulators"
+ depends on MFD_TPS6586X
help
- This driver supports ISL6271A voltage regulator chip.
+ This driver supports TPS6586X voltage regulator chips.
-config REGULATOR_AD5398
- tristate "Analog Devices AD5398/AD5821 regulators"
- depends on I2C
+config REGULATOR_TPS65910
+ tristate "TI TPS65910/TPS65911 Power Regulators"
+ depends on MFD_TPS65910
help
- This driver supports AD5398 and AD5821 current regulator chips.
- If building into module, its name is ad5398.ko.
+ This driver supports TPS65910/TPS65911 voltage regulator chips.
-config REGULATOR_AB8500
- bool "ST-Ericsson AB8500 Power Regulators"
- depends on AB8500_CORE
+config REGULATOR_TPS65912
+ tristate "TI TPS65912 Power regulator"
+ depends on (MFD_TPS65912_I2C || MFD_TPS65912_SPI)
help
- This driver supports the regulators found on the ST-Ericsson mixed
- signal AB8500 PMIC
+ This driver supports TPS65912 voltage regulator chip.
-config REGULATOR_DB8500_PRCMU
- bool "ST-Ericsson DB8500 Voltage Domain Regulators"
- depends on MFD_DB8500_PRCMU
+config REGULATOR_TWL4030
+ bool "TI TWL4030/TWL5030/TWL6030/TPS659x0 PMIC"
+ depends on TWL4030_CORE
help
- This driver supports the voltage domain regulators controlled by the
- DB8500 PRCMU
+ This driver supports the voltage regulators provided by
+ this family of companion chips.
-config REGULATOR_TPS6586X
- tristate "TI TPS6586X Power regulators"
- depends on MFD_TPS6586X
+config REGULATOR_WM831X
+ tristate "Wolfson Microelectronics WM831x PMIC regulators"
+ depends on MFD_WM831X
help
- This driver supports TPS6586X voltage regulator chips.
+ Support the voltage and current regulators of the WM831x series
+ of PMIC devices.
-config REGULATOR_TPS6524X
- tristate "TI TPS6524X Power regulators"
- depends on SPI
+config REGULATOR_WM8350
+ tristate "Wolfson Microelectronics WM8350 AudioPlus PMIC"
+ depends on MFD_WM8350
help
- This driver supports TPS6524X voltage regulator chips. TPS6524X
- provides three step-down converters and two general-purpose LDO
- voltage regulators. This device is interfaced using a customized
- serial interface currently supported on the sequencer serial
- port controller.
+ This driver provides support for the voltage and current regulators
+ of the WM8350 AudioPlus PMIC.
-config REGULATOR_TPS65910
- tristate "TI TPS65910 Power Regulator"
- depends on MFD_TPS65910
+config REGULATOR_WM8400
+ tristate "Wolfson Microelectronics WM8400 AudioPlus PMIC"
+ depends on MFD_WM8400
help
- This driver supports TPS65910 voltage regulator chips.
+ This driver provides support for the voltage regulators of the
+ WM8400 AudioPlus PMIC.
-config REGULATOR_AAT2870
- tristate "AnalogicTech AAT2870 Regulators"
- depends on MFD_AAT2870_CORE
+config REGULATOR_WM8994
+ tristate "Wolfson Microelectronics WM8994 CODEC"
+ depends on MFD_WM8994
help
- If you have a AnalogicTech AAT2870 say Y to enable the
- regulator driver.
+ This driver provides support for the voltage regulators on the
+ WM8994 CODEC.
endif
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 503bac87715e..94b52745e957 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -3,50 +3,55 @@
#
-obj-$(CONFIG_REGULATOR) += core.o dummy.o
+obj-$(CONFIG_REGULATOR) += core.o dummy.o fixed-helper.o
obj-$(CONFIG_OF) += of_regulator.o
obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o
obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o
obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o
obj-$(CONFIG_REGULATOR_GPIO) += gpio-regulator.o
+obj-$(CONFIG_REGULATOR_88PM8607) += 88pm8607.o
+obj-$(CONFIG_REGULATOR_AAT2870) += aat2870-regulator.o
+obj-$(CONFIG_REGULATOR_AB3100) += ab3100.o
+obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o
obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o
-obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o
+obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o
+obj-$(CONFIG_REGULATOR_DA903X) += da903x.o
+obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o
+obj-$(CONFIG_REGULATOR_DBX500_PRCMU) += dbx500-prcmu.o
+obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
+obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o
obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
-obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o
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
-obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o
-obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o
-obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
-obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o
-obj-$(CONFIG_REGULATOR_TPS6586X) += tps6586x-regulator.o
-obj-$(CONFIG_REGULATOR_DA903X) += da903x.o
-obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o
-obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
-obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o
obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o
-obj-$(CONFIG_REGULATOR_AB3100) += ab3100.o
+obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
+obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
+obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
+obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
obj-$(CONFIG_REGULATOR_TPS65023) += tps65023-regulator.o
obj-$(CONFIG_REGULATOR_TPS6507X) += tps6507x-regulator.o
+obj-$(CONFIG_REGULATOR_TPS65217) += tps65217-regulator.o
obj-$(CONFIG_REGULATOR_TPS6524X) += tps6524x-regulator.o
-obj-$(CONFIG_REGULATOR_TPS65912) += tps65912-regulator.o
-obj-$(CONFIG_REGULATOR_88PM8607) += 88pm8607.o
-obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o
-obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o
-obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
+obj-$(CONFIG_REGULATOR_TPS6586X) += tps6586x-regulator.o
obj-$(CONFIG_REGULATOR_TPS65910) += tps65910-regulator.o
-obj-$(CONFIG_REGULATOR_AAT2870) += aat2870-regulator.o
+obj-$(CONFIG_REGULATOR_TPS65912) += tps65912-regulator.o
+obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o
+obj-$(CONFIG_REGULATOR_WM831X) += wm831x-dcdc.o
+obj-$(CONFIG_REGULATOR_WM831X) += wm831x-isink.o
+obj-$(CONFIG_REGULATOR_WM831X) += wm831x-ldo.o
+obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o
+obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
+obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o
+
ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
diff --git a/drivers/regulator/aat2870-regulator.c b/drivers/regulator/aat2870-regulator.c
index 685ad43b0749..9ed5c5d84e12 100644
--- a/drivers/regulator/aat2870-regulator.c
+++ b/drivers/regulator/aat2870-regulator.c
@@ -31,7 +31,7 @@
#include <linux/mfd/aat2870.h>
struct aat2870_regulator {
- struct platform_device *pdev;
+ struct aat2870_data *aat2870;
struct regulator_desc desc;
const int *voltages; /* uV */
@@ -60,7 +60,7 @@ static int aat2870_ldo_set_voltage_sel(struct regulator_dev *rdev,
unsigned selector)
{
struct aat2870_regulator *ri = rdev_get_drvdata(rdev);
- struct aat2870_data *aat2870 = dev_get_drvdata(ri->pdev->dev.parent);
+ struct aat2870_data *aat2870 = ri->aat2870;
return aat2870->update(aat2870, ri->voltage_addr, ri->voltage_mask,
selector << ri->voltage_shift);
@@ -69,7 +69,7 @@ static int aat2870_ldo_set_voltage_sel(struct regulator_dev *rdev,
static int aat2870_ldo_get_voltage_sel(struct regulator_dev *rdev)
{
struct aat2870_regulator *ri = rdev_get_drvdata(rdev);
- struct aat2870_data *aat2870 = dev_get_drvdata(ri->pdev->dev.parent);
+ struct aat2870_data *aat2870 = ri->aat2870;
u8 val;
int ret;
@@ -83,7 +83,7 @@ static int aat2870_ldo_get_voltage_sel(struct regulator_dev *rdev)
static int aat2870_ldo_enable(struct regulator_dev *rdev)
{
struct aat2870_regulator *ri = rdev_get_drvdata(rdev);
- struct aat2870_data *aat2870 = dev_get_drvdata(ri->pdev->dev.parent);
+ struct aat2870_data *aat2870 = ri->aat2870;
return aat2870->update(aat2870, ri->enable_addr, ri->enable_mask,
ri->enable_mask);
@@ -92,7 +92,7 @@ static int aat2870_ldo_enable(struct regulator_dev *rdev)
static int aat2870_ldo_disable(struct regulator_dev *rdev)
{
struct aat2870_regulator *ri = rdev_get_drvdata(rdev);
- struct aat2870_data *aat2870 = dev_get_drvdata(ri->pdev->dev.parent);
+ struct aat2870_data *aat2870 = ri->aat2870;
return aat2870->update(aat2870, ri->enable_addr, ri->enable_mask, 0);
}
@@ -100,7 +100,7 @@ static int aat2870_ldo_disable(struct regulator_dev *rdev)
static int aat2870_ldo_is_enabled(struct regulator_dev *rdev)
{
struct aat2870_regulator *ri = rdev_get_drvdata(rdev);
- struct aat2870_data *aat2870 = dev_get_drvdata(ri->pdev->dev.parent);
+ struct aat2870_data *aat2870 = ri->aat2870;
u8 val;
int ret;
@@ -185,7 +185,7 @@ static int aat2870_regulator_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Invalid device ID, %d\n", pdev->id);
return -EINVAL;
}
- ri->pdev = pdev;
+ ri->aat2870 = dev_get_drvdata(pdev->dev.parent);
rdev = regulator_register(&ri->desc, &pdev->dev,
pdev->dev.platform_data, ri, NULL);
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index c9b92531ae60..c7ee4c15d6f5 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -201,7 +201,7 @@ static int ab8500_list_voltage(struct regulator_dev *rdev, unsigned selector)
return info->voltages[selector];
}
-static int ab8500_regulator_get_voltage(struct regulator_dev *rdev)
+static int ab8500_regulator_get_voltage_sel(struct regulator_dev *rdev)
{
int ret, val;
struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
@@ -229,11 +229,9 @@ static int ab8500_regulator_get_voltage(struct regulator_dev *rdev)
/* vintcore has a different layout */
val = regval & info->voltage_mask;
if (info->desc.id == AB8500_LDO_INTCORE)
- ret = info->voltages[val >> 0x3];
+ return val >> 0x3;
else
- ret = info->voltages[val];
-
- return ret;
+ return val;
}
static int ab8500_get_best_voltage_index(struct regulator_dev *rdev,
@@ -320,7 +318,7 @@ static struct regulator_ops ab8500_regulator_ops = {
.enable = ab8500_regulator_enable,
.disable = ab8500_regulator_disable,
.is_enabled = ab8500_regulator_is_enabled,
- .get_voltage = ab8500_regulator_get_voltage,
+ .get_voltage_sel = ab8500_regulator_get_voltage_sel,
.set_voltage = ab8500_regulator_set_voltage,
.list_voltage = ab8500_list_voltage,
.enable_time = ab8500_regulator_enable_time,
diff --git a/drivers/regulator/ad5398.c b/drivers/regulator/ad5398.c
index 483c80930852..26d23adfc66f 100644
--- a/drivers/regulator/ad5398.c
+++ b/drivers/regulator/ad5398.c
@@ -94,8 +94,8 @@ static int ad5398_set_current_limit(struct regulator_dev *rdev, int min_uA, int
if (max_uA > chip->max_uA || max_uA < chip->min_uA)
return -EINVAL;
- selector = ((min_uA - chip->min_uA) * chip->current_level +
- range_uA - 1) / range_uA;
+ selector = DIV_ROUND_UP((min_uA - chip->min_uA) * chip->current_level,
+ range_uA);
if (ad5398_calc_current(chip, selector) > max_uA)
return -EINVAL;
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
new file mode 100644
index 000000000000..53969af17558
--- /dev/null
+++ b/drivers/regulator/anatop-regulator.c
@@ -0,0 +1,242 @@
+/*
+ * Copyright (C) 2011 Freescale Semiconductor, Inc. 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 as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+
+ * 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.
+
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/slab.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/mfd/anatop.h>
+#include <linux/regulator/driver.h>
+#include <linux/regulator/of_regulator.h>
+
+struct anatop_regulator {
+ const char *name;
+ u32 control_reg;
+ struct anatop *mfd;
+ int vol_bit_shift;
+ int vol_bit_width;
+ int min_bit_val;
+ int min_voltage;
+ int max_voltage;
+ struct regulator_desc rdesc;
+ struct regulator_init_data *initdata;
+};
+
+static int anatop_set_voltage(struct regulator_dev *reg, int min_uV,
+ int max_uV, unsigned *selector)
+{
+ struct anatop_regulator *anatop_reg = rdev_get_drvdata(reg);
+ u32 val, sel;
+ int uv;
+
+ uv = min_uV;
+ dev_dbg(&reg->dev, "%s: uv %d, min %d, max %d\n", __func__,
+ uv, anatop_reg->min_voltage,
+ anatop_reg->max_voltage);
+
+ if (uv < anatop_reg->min_voltage) {
+ if (max_uV > anatop_reg->min_voltage)
+ uv = anatop_reg->min_voltage;
+ else
+ return -EINVAL;
+ }
+
+ if (!anatop_reg->control_reg)
+ return -ENOTSUPP;
+
+ sel = DIV_ROUND_UP(uv - anatop_reg->min_voltage, 25000);
+ if (sel * 25000 + anatop_reg->min_voltage > anatop_reg->max_voltage)
+ return -EINVAL;
+ val = anatop_reg->min_bit_val + sel;
+ *selector = sel;
+ dev_dbg(&reg->dev, "%s: calculated val %d\n", __func__, val);
+ anatop_set_bits(anatop_reg->mfd,
+ anatop_reg->control_reg,
+ anatop_reg->vol_bit_shift,
+ anatop_reg->vol_bit_width,
+ val);
+
+ return 0;
+}
+
+static int anatop_get_voltage_sel(struct regulator_dev *reg)
+{
+ struct anatop_regulator *anatop_reg = rdev_get_drvdata(reg);
+ u32 val;
+
+ if (!anatop_reg->control_reg)
+ return -ENOTSUPP;
+
+ val = anatop_get_bits(anatop_reg->mfd,
+ anatop_reg->control_reg,
+ anatop_reg->vol_bit_shift,
+ anatop_reg->vol_bit_width);
+
+ ret