From 0178f3e28e2166664916265c5d4922b1376b9fa1 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 26 Apr 2010 15:18:14 +0100 Subject: regulator: Allow regulator-regulator supplies to be specified by name When one regulator supplies another allow the relationship to be specified using names rather than struct regulators, in a similar manner to that allowed for consumer supplies. This allows static configuration at compile time, reducing the need for dynamic init code. Also change the references to LINE supply to be system supply since line is sometimes used for actual supplies and therefore potentially confusing. Signed-off-by: Mark Brown Signed-off-by: Liam Girdwood --- include/linux/regulator/machine.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h index 234a8476cba8..e2980287245e 100644 --- a/include/linux/regulator/machine.h +++ b/include/linux/regulator/machine.h @@ -157,7 +157,11 @@ struct regulator_consumer_supply { * * Initialisation constraints, our supply and consumers supplies. * - * @supply_regulator_dev: Parent regulator (if any). + * @supply_regulator: Parent regulator. Specified using the regulator name + * as it appears in the name field in sysfs, which can + * be explicitly set using the constraints field 'name'. + * @supply_regulator_dev: Parent regulator (if any) - DEPRECATED in favour + * of supply_regulator. * * @constraints: Constraints. These must be specified for the regulator to * be usable. @@ -168,7 +172,8 @@ struct regulator_consumer_supply { * @driver_data: Data passed to regulator_init. */ struct regulator_init_data { - struct device *supply_regulator_dev; /* or NULL for LINE */ + const char *supply_regulator; /* or NULL for system supply */ + struct device *supply_regulator_dev; /* or NULL for system supply */ struct regulation_constraints constraints; -- cgit v1.2.3 From 9f79e9db2e282857912bcfe7f741bcdd5c46e860 Mon Sep 17 00:00:00 2001 From: Haojian Zhuang Date: Tue, 4 May 2010 09:54:51 -0400 Subject: regulator: use voltage number array in 88pm860x A lot of condition comparision statements are used in original driver. These statements are used to check the boundary of voltage numbers since voltage number isn't linear. Now use array of voltage numbers instead. Clean code with simpler way. Signed-off-by: Haojian Zhuang Acked-by: Mark Brown Signed-off-by: Liam Girdwood --- include/linux/mfd/88pm860x.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h index 73f92c5feea2..e3c4ff8c3e38 100644 --- a/include/linux/mfd/88pm860x.h +++ b/include/linux/mfd/88pm860x.h @@ -132,6 +132,7 @@ enum { PM8607_ID_LDO9, PM8607_ID_LDO10, PM8607_ID_LDO12, + PM8607_ID_LDO13, PM8607_ID_LDO14, PM8607_ID_RG_MAX, @@ -309,7 +310,7 @@ struct pm860x_chip { }; -#define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */ +#define PM8607_MAX_REGULATOR PM8607_ID_RG_MAX /* 3 Bucks, 13 LDOs */ enum { GI2C_PORT = 0, -- cgit v1.2.3