diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 18:13:24 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 18:13:24 -0400 |
| commit | 9aca0e7c8c3a8f1fa6e3058abc5465b0509f0f8e (patch) | |
| tree | a905000d066defcc187e8e073134a1bee3c56fc1 | |
| parent | a0e3390787ef523699ae1f3f3ea0ca953e630be2 (diff) | |
| parent | ec10b0e94ebe7de3b301d60e6f7f4a12d3d280c6 (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/Kconfig | 15 | ||||
| -rw-r--r-- | drivers/regulator/Makefile | 5 | ||||
| -rw-r--r-- | drivers/regulator/core.c | 57 | ||||
| -rw-r--r-- | drivers/regulator/dummy.h | 4 | ||||
| -rw-r--r-- | drivers/regulator/lp3972.c | 660 | ||||
| -rw-r--r-- | drivers/regulator/max8952.c | 366 | ||||
| -rw-r--r-- | include/linux/regulator/lp3972.h | 48 | ||||
| -rw-r--r-- | include/linux/regulator/machine.h | 5 | ||||
| -rw-r--r-- | include/linux/regulator/max8952.h | 135 |
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 | ||
| 103 | config 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 | |||
| 103 | config REGULATOR_MAX8998 | 111 | config 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 | ||
| 175 | config 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 | |||
| 167 | config REGULATOR_PCAP | 182 | config 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 | ||
| 6 | obj-$(CONFIG_REGULATOR) += core.o | 6 | obj-$(CONFIG_REGULATOR) += core.o dummy.o |
| 7 | obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o | 7 | obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o |
| 8 | obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o | 8 | obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o |
| 9 | obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o | 9 | obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o |
| 10 | 10 | ||
| 11 | obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o | 11 | obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o |
| 12 | obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o | 12 | obj-$(CONFIG_REGULATOR_BQ24022) += bq24022.o |
| 13 | obj-$(CONFIG_REGULATOR_DUMMY) += dummy.o | ||
| 14 | obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o | 13 | obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o |
| 14 | obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o | ||
| 15 | obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o | 15 | obj-$(CONFIG_REGULATOR_MAX1586) += max1586.o |
| 16 | obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o | 16 | obj-$(CONFIG_REGULATOR_TWL4030) += twl-regulator.o |
| 17 | obj-$(CONFIG_REGULATOR_MAX8649) += max8649.o | 17 | obj-$(CONFIG_REGULATOR_MAX8649) += max8649.o |
| 18 | obj-$(CONFIG_REGULATOR_MAX8660) += max8660.o | 18 | obj-$(CONFIG_REGULATOR_MAX8660) += max8660.o |
| 19 | obj-$(CONFIG_REGULATOR_MAX8925) += max8925-regulator.o | 19 | obj-$(CONFIG_REGULATOR_MAX8925) += max8925-regulator.o |
| 20 | obj-$(CONFIG_REGULATOR_MAX8952) += max8952.o | ||
| 20 | obj-$(CONFIG_REGULATOR_MAX8998) += max8998.o | 21 | obj-$(CONFIG_REGULATOR_MAX8998) += max8998.o |
| 21 | obj-$(CONFIG_REGULATOR_WM831X) += wm831x-dcdc.o | 22 | obj-$(CONFIG_REGULATOR_WM831X) += wm831x-dcdc.o |
| 22 | obj-$(CONFIG_REGULATOR_WM831X) += wm831x-isink.o | 23 | obj-$(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); | |||
| 33 | static LIST_HEAD(regulator_list); | 33 | static LIST_HEAD(regulator_list); |
| 34 | static LIST_HEAD(regulator_map_list); | 34 | static LIST_HEAD(regulator_map_list); |
| 35 | static int has_full_constraints; | 35 | static int has_full_constraints; |
| 36 | static 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 | ||
| 65 | static int _regulator_is_enabled(struct regulator_dev *rdev); | 66 | static int _regulator_is_enabled(struct regulator_dev *rdev); |
| 66 | static int _regulator_disable(struct regulator_dev *rdev); | 67 | static int _regulator_disable(struct regulator_dev *rdev, |
| 68 | struct regulator_dev **supply_rdev_ptr); | ||
| 67 | static int _regulator_get_voltage(struct regulator_dev *rdev); | 69 | static int _regulator_get_voltage(struct regulator_dev *rdev); |
| 68 | static int _regulator_get_current_limit(struct regulator_dev *rdev); | 70 | static int _regulator_get_current_limit(struct regulator_dev *rdev); |
| 69 | static unsigned int _regulator_get_mode(struct regulator_dev *rdev); | 71 | static 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) | |||
| 1348 | EXPORT_SYMBOL_GPL(regulator_enable); | 1355 | EXPORT_SYMBOL_GPL(regulator_enable); |
| 1349 | 1356 | ||
| 1350 | /* locks held by regulator_disable() */ | 1357 | /* locks held by regulator_disable() */ |
| 1351 | static int _regulator_disable(struct regulator_dev *rdev) | 1358 | static 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) | |||
| 1407 | int regulator_disable(struct regulator *regulator) | 1414 | int 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 | } |
| 1417 | EXPORT_SYMBOL_GPL(regulator_disable); | 1435 | EXPORT_SYMBOL_GPL(regulator_disable); |
| 1418 | 1436 | ||
| 1419 | /* locks held by regulator_force_disable() */ | 1437 | /* locks held by regulator_force_disable() */ |
| 1420 | static int _regulator_force_disable(struct regulator_dev *rdev) | 1438 | static 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) | ||
