aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-28 18:13:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-28 18:13:24 -0400
commit9aca0e7c8c3a8f1fa6e3058abc5465b0509f0f8e (patch)
treea905000d066defcc187e8e073134a1bee3c56fc1
parenta0e3390787ef523699ae1f3f3ea0ca953e630be2 (diff)
parentec10b0e94ebe7de3b301d60e6f7f4a12d3d280c6 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: regulator: max8952 - fix max8952_set_voltage regulator: max8952 - fix max8952_pmic_probe error path regulator: fix build when CONFIG_REGULATOR_DUMMY=n regulator: avoid deadlock when disabling regulator with supply regulator: Add option for machine drivers to enable the dummy regulator Regulator: lp3972 cleanup Regulator: LP3972 PMIC regulator driver MAX8952 PMIC Driver Initial Release
-rw-r--r--drivers/regulator/Kconfig15
-rw-r--r--drivers/regulator/Makefile5
-rw-r--r--drivers/regulator/core.c57
-rw-r--r--drivers/regulator/dummy.h4
-rw-r--r--drivers/regulator/lp3972.c660
-rw-r--r--drivers/regulator/max8952.c366
-rw-r--r--include/linux/regulator/lp3972.h48
-rw-r--r--include/linux/regulator/machine.h5
-rw-r--r--include/linux/regulator/max8952.h135
9 files changed, 1280 insertions, 15 deletions
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 172951bf23a4..dd30e883d4a7 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -100,6 +100,14 @@ config REGULATOR_MAX8925
100 help 100 help
101 Say y here to support the voltage regulaltor of Maxim MAX8925 PMIC. 101 Say y here to support the voltage regulaltor of Maxim MAX8925 PMIC.
102 102
103config REGULATOR_MAX8952
104 tristate "Maxim MAX8952 Power Management IC"
105 depends on I2C
106 help
107 This driver controls a Maxim 8952 voltage output regulator
108 via I2C bus. Maxim 8952 has one voltage output and supports 4 DVS
109 modes ranging from 0.77V to 1.40V by 0.01V steps.
110
103config REGULATOR_MAX8998 111config REGULATOR_MAX8998
104 tristate "Maxim 8998 voltage regulator" 112 tristate "Maxim 8998 voltage regulator"
105 depends on MFD_MAX8998 113 depends on MFD_MAX8998
@@ -164,6 +172,13 @@ config REGULATOR_LP3971
164 Say Y here to support the voltage regulators and convertors 172 Say Y here to support the voltage regulators and convertors
165 on National Semiconductors LP3971 PMIC 173 on National Semiconductors LP3971 PMIC
166 174
175config REGULATOR_LP3972
176 tristate "National Semiconductors LP3972 PMIC regulator driver"
177 depends on I2C
178 help
179 Say Y here to support the voltage regulators and convertors
180 on National Semiconductors LP3972 PMIC
181
167config REGULATOR_PCAP 182config REGULATOR_PCAP
168 tristate "PCAP2 regulator driver" 183 tristate "PCAP2 regulator driver"
169 depends on EZX_PCAP 184 depends on EZX_PCAP
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 8285fd832e16..bff815736780 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -3,20 +3,21 @@
3# 3#
4 4
5 5
6obj-$(CONFIG_REGULATOR) += core.o 6obj-$(CONFIG_REGULATOR) += core.o dummy.o
7obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o 7obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o
8obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o 8obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o
9obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o 9obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o
10 10
11obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o 11obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o
12obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o 12obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o
13obj-$(CONFIG_REGULATOR_DUMMY) += dummy.o
14obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o 13obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
14obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
15obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o 15obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o
16obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o 16obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o
17obj-$(CONFIG_REGULATOR_MAX8649) += max8649.o 17obj-$(CONFIG_REGULATOR_MAX8649) += max8649.o
18obj-$(CONFIG_REGULATOR_MAX8660) += max8660.o 18obj-$(CONFIG_REGULATOR_MAX8660) += max8660.o
19obj-$(CONFIG_REGULATOR_MAX8925) += max8925-regulator.o 19obj-$(CONFIG_REGULATOR_MAX8925) += max8925-regulator.o
20obj-$(CONFIG_REGULATOR_MAX8952) += max8952.o
20obj-$(CONFIG_REGULATOR_MAX8998) += max8998.o 21obj-$(CONFIG_REGULATOR_MAX8998) += max8998.o
21obj-$(CONFIG_REGULATOR_WM831X) += wm831x-dcdc.o 22obj-$(CONFIG_REGULATOR_WM831X) += wm831x-dcdc.o
22obj-$(CONFIG_REGULATOR_WM831X) += wm831x-isink.o 23obj-$(CONFIG_REGULATOR_WM831X) += wm831x-isink.o
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index cc8b337b9119..f1d10c974cd4 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -33,6 +33,7 @@ static DEFINE_MUTEX(regulator_list_mutex);
33static LIST_HEAD(regulator_list); 33static LIST_HEAD(regulator_list);
34static LIST_HEAD(regulator_map_list); 34static LIST_HEAD(regulator_map_list);
35static int has_full_constraints; 35static int has_full_constraints;
36static bool board_wants_dummy_regulator;
36 37
37/* 38/*
38 * struct regulator_map 39 * struct regulator_map
@@ -63,7 +64,8 @@ struct regulator {
63}; 64};
64 65
65static int _regulator_is_enabled(struct regulator_dev *rdev); 66static int _regulator_is_enabled(struct regulator_dev *rdev);
66static int _regulator_disable(struct regulator_dev *rdev); 67static int _regulator_disable(struct regulator_dev *rdev,
68 struct regulator_dev **supply_rdev_ptr);
67static int _regulator_get_voltage(struct regulator_dev *rdev); 69static int _regulator_get_voltage(struct regulator_dev *rdev);
68static int _regulator_get_current_limit(struct regulator_dev *rdev); 70static int _regulator_get_current_limit(struct regulator_dev *rdev);
69static unsigned int _regulator_get_mode(struct regulator_dev *rdev); 71static unsigned int _regulator_get_mode(struct regulator_dev *rdev);
@@ -1108,6 +1110,11 @@ static struct regulator *_regulator_get(struct device *dev, const char *id,
1108 } 1110 }
1109 } 1111 }
1110 1112
1113 if (board_wants_dummy_regulator) {
1114 rdev = dummy_regulator_rdev;
1115 goto found;
1116 }
1117
1111#ifdef CONFIG_REGULATOR_DUMMY 1118#ifdef CONFIG_REGULATOR_DUMMY
1112 if (!devname) 1119 if (!devname)
1113 devname = "deviceless"; 1120 devname = "deviceless";
@@ -1348,7 +1355,8 @@ int regulator_enable(struct regulator *regulator)
1348EXPORT_SYMBOL_GPL(regulator_enable); 1355EXPORT_SYMBOL_GPL(regulator_enable);
1349 1356
1350/* locks held by regulator_disable() */ 1357/* locks held by regulator_disable() */
1351static int _regulator_disable(struct regulator_dev *rdev) 1358static int _regulator_disable(struct regulator_dev *rdev,
1359 struct regulator_dev **supply_rdev_ptr)
1352{ 1360{
1353 int ret = 0; 1361 int ret = 0;
1354 1362
@@ -1376,8 +1384,7 @@ static int _regulator_disable(struct regulator_dev *rdev)
1376 } 1384 }
1377 1385
1378 /* decrease our supplies ref count and disable if required */ 1386 /* decrease our supplies ref count and disable if required */
1379 if (rdev->supply) 1387 *supply_rdev_ptr = rdev->supply;
1380 _regulator_disable(rdev->supply);
1381 1388
1382 rdev->use_count = 0; 1389 rdev->use_count = 0;
1383 } else if (rdev->use_count > 1) { 1390 } else if (rdev->use_count > 1) {
@@ -1407,17 +1414,29 @@ static int _regulator_disable(struct regulator_dev *rdev)
1407int regulator_disable(struct regulator *regulator) 1414int regulator_disable(struct regulator *regulator)
1408{ 1415{
1409 struct regulator_dev *rdev = regulator->rdev; 1416 struct regulator_dev *rdev = regulator->rdev;
1417 struct regulator_dev *supply_rdev = NULL;
1410 int ret = 0; 1418 int ret = 0;
1411 1419
1412 mutex_lock(&rdev->mutex); 1420 mutex_lock(&rdev->mutex);
1413 ret = _regulator_disable(rdev); 1421 ret = _regulator_disable(rdev, &supply_rdev);
1414 mutex_unlock(&rdev->mutex); 1422 mutex_unlock(&rdev->mutex);
1423
1424 /* decrease our supplies ref count and disable if required */
1425 while (supply_rdev != NULL) {
1426 rdev = supply_rdev;
1427
1428 mutex_lock(&rdev->mutex);
1429 _regulator_disable(rdev, &supply_rdev);
1430 mutex_unlock(&rdev->mutex);
1431 }
1432
1415 return ret; 1433 return ret;
1416} 1434}
1417EXPORT_SYMBOL_GPL(regulator_disable); 1435EXPORT_SYMBOL_GPL(regulator_disable);
1418 1436
1419/* locks held by regulator_force_disable() */ 1437/* locks held by regulator_force_disable() */
1420static int _regulator_force_disable(struct regulator_dev *rdev) 1438static int _regulator_force_disable(struct regulator_dev *rdev,
1439 struct regulator_dev **supply_rdev_ptr)
1421{ 1440{
1422 int ret = 0; 1441 int ret = 0;
1423 1442
@@ -1436,8 +1455,7 @@ static int _regulator_force_disable(struct regulator_dev *rdev)
1436 } 1455 }
1437 1456
1438 /* decrease our supplies ref count and disable if required */ 1457 /* decrease our supplies ref count and disable if required */
1439 if (rdev->supply)