Skip to content

Commit

Permalink
Merge remote-tracking branches 'regulator/topic/const', 'regulator/to…
Browse files Browse the repository at this point in the history
…pic/lm363x', 'regulator/topic/lockdep' and 'regulator/topic/lp872x' into regulator-next
  • Loading branch information
Mark Brown committed Jan 12, 2016
5 parents 9fa2957 + b0d6dd3 + faa5cf3 + 70a7fb8 + 8a99cc6 commit 8bd31df
Show file tree
Hide file tree
Showing 19 changed files with 390 additions and 34 deletions.
34 changes: 34 additions & 0 deletions Documentation/devicetree/bindings/regulator/lm363x-regulator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
TI LMU LM363x regulator device tree bindings

LM363x regulator driver supports LM3631 and LM3632.
LM3631 has five regulators and LM3632 supports three regulators.

Required property:
- compatible: "ti,lm363x-regulator"

Optional properties:
LM3632 has external enable pins for two LDOs.
- ti,lcm-en1-gpio: A GPIO specifier for Vpos control pin.
- ti,lcm-en2-gpio: A GPIO specifier for Vneg control pin.

Child nodes:
LM3631
- vboost
- vcont
- voref
- vpos
- vneg

LM3632
- vboost
- vpos
- vneg

Optional properties of a child node:
Each sub-node should contain the constraints and initialization.
Please refer to [1].

Examples: Please refer to ti-lmu dt-bindings [2].

[1] ../regulator/regulator.txt
[2] ../mfd/ti-lmu.txt
9 changes: 9 additions & 0 deletions drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,15 @@ config REGULATOR_ISL6271A
help
This driver supports ISL6271A voltage regulator chip.

config REGULATOR_LM363X
tristate "TI LM363X voltage regulators"
depends on MFD_TI_LMU
help
This driver supports LM3631 and LM3632 voltage regulators for
the LCD bias.
One boost output voltage is configurable and always on.
Other LDOs are used for the display module.

config REGULATOR_LP3971
tristate "National Semiconductors LP3971 PMIC regulator driver"
depends on I2C
Expand Down
1 change: 1 addition & 0 deletions drivers/regulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ obj-$(CONFIG_REGULATOR_GPIO) += gpio-regulator.o
obj-$(CONFIG_REGULATOR_HI6421) += hi6421-regulator.o
obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o
obj-$(CONFIG_REGULATOR_ISL9305) += isl9305.o
obj-$(CONFIG_REGULATOR_LM363X) += lm363x-regulator.o
obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
obj-$(CONFIG_REGULATOR_LP872X) += lp872x.o
Expand Down
10 changes: 9 additions & 1 deletion drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ static bool have_full_constraints(void)
return has_full_constraints || of_have_populated_dt();
}

static inline struct regulator_dev *rdev_get_supply(struct regulator_dev *rdev)
{
if (rdev && rdev->supply)
return rdev->supply->rdev;

return NULL;
}

/**
* regulator_lock_supply - lock a regulator and its supplies
* @rdev: regulator source
Expand All @@ -140,7 +148,7 @@ static void regulator_lock_supply(struct regulator_dev *rdev)
{
int i;

for (i = 0; rdev->supply; rdev = rdev->supply->rdev, i++)
for (i = 0; rdev; rdev = rdev_get_supply(rdev), i++)
mutex_lock_nested(&rdev->mutex, i);
}

Expand Down
10 changes: 5 additions & 5 deletions drivers/regulator/da903x.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static const struct regulator_linear_range da9034_ldo12_ranges[] = {
REGULATOR_LINEAR_RANGE(2700000, 8, 15, 50000),
};

static struct regulator_ops da903x_regulator_ldo_ops = {
static const struct regulator_ops da903x_regulator_ldo_ops = {
.set_voltage_sel = da903x_set_voltage_sel,
.get_voltage_sel = da903x_get_voltage_sel,
.list_voltage = regulator_list_voltage_linear,
Expand All @@ -268,7 +268,7 @@ static struct regulator_ops da903x_regulator_ldo_ops = {
};

/* NOTE: this is dedicated for the insane DA9030 LDO14 */
static struct regulator_ops da9030_regulator_ldo14_ops = {
static const struct regulator_ops da9030_regulator_ldo14_ops = {
.set_voltage_sel = da903x_set_voltage_sel,
.get_voltage_sel = da903x_get_voltage_sel,
.list_voltage = da9030_list_ldo14_voltage,
Expand All @@ -279,7 +279,7 @@ static struct regulator_ops da9030_regulator_ldo14_ops = {
};

/* NOTE: this is dedicated for the DA9030 LDO1 and LDO15 that have locks */
static struct regulator_ops da9030_regulator_ldo1_15_ops = {
static const struct regulator_ops da9030_regulator_ldo1_15_ops = {
.set_voltage_sel = da9030_set_ldo1_15_voltage_sel,
.get_voltage_sel = da903x_get_voltage_sel,
.list_voltage = regulator_list_voltage_linear,
Expand All @@ -289,7 +289,7 @@ static struct regulator_ops da9030_regulator_ldo1_15_ops = {
.is_enabled = da903x_is_enabled,
};

static struct regulator_ops da9034_regulator_dvc_ops = {
static const struct regulator_ops da9034_regulator_dvc_ops = {
.set_voltage_sel = da9034_set_dvc_voltage_sel,
.get_voltage_sel = da903x_get_voltage_sel,
.list_voltage = regulator_list_voltage_linear,
Expand All @@ -300,7 +300,7 @@ static struct regulator_ops da9034_regulator_dvc_ops = {
};

/* NOTE: this is dedicated for the insane LDO12 */
static struct regulator_ops da9034_regulator_ldo12_ops = {
static const struct regulator_ops da9034_regulator_ldo12_ops = {
.set_voltage_sel = da903x_set_voltage_sel,
.get_voltage_sel = da903x_get_voltage_sel,
.list_voltage = regulator_list_voltage_linear_range,
Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/da9052-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ static int da9052_regulator_set_voltage_time_sel(struct regulator_dev *rdev,
return ret;
}

static struct regulator_ops da9052_dcdc_ops = {
static const struct regulator_ops da9052_dcdc_ops = {
.get_current_limit = da9052_dcdc_get_current_limit,
.set_current_limit = da9052_dcdc_set_current_limit,

Expand All @@ -279,7 +279,7 @@ static struct regulator_ops da9052_dcdc_ops = {
.disable = regulator_disable_regmap,
};

static struct regulator_ops da9052_ldo_ops = {
static const struct regulator_ops da9052_ldo_ops = {
.list_voltage = da9052_list_voltage,
.map_voltage = da9052_map_voltage,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/da9055-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ static int da9055_suspend_disable(struct regulator_dev *rdev)
return 0;
}

static struct regulator_ops da9055_buck_ops = {
static const struct regulator_ops da9055_buck_ops = {
.get_mode = da9055_buck_get_mode,
.set_mode = da9055_buck_set_mode,

Expand All @@ -345,7 +345,7 @@ static struct regulator_ops da9055_buck_ops = {
.set_suspend_mode = da9055_buck_set_mode,
};

static struct regulator_ops da9055_ldo_ops = {
static const struct regulator_ops da9055_ldo_ops = {
.get_mode = da9055_ldo_get_mode,
.set_mode = da9055_ldo_set_mode,

Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/da9062-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ static int da9062_ldo_set_suspend_mode(struct regulator_dev *rdev,
return regmap_field_write(regl->suspend_sleep, val);
}

static struct regulator_ops da9062_buck_ops = {
static const struct regulator_ops da9062_buck_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
Expand All @@ -389,7 +389,7 @@ static struct regulator_ops da9062_buck_ops = {
.set_suspend_mode = da9062_buck_set_suspend_mode,
};

static struct regulator_ops da9062_ldo_ops = {
static const struct regulator_ops da9062_ldo_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/da9063-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static int da9063_ldo_set_suspend_mode(struct regulator_dev *rdev, unsigned mode
return regmap_field_write(regl->suspend_sleep, val);
}

static struct regulator_ops da9063_buck_ops = {
static const struct regulator_ops da9063_buck_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
Expand All @@ -445,7 +445,7 @@ static struct regulator_ops da9063_buck_ops = {
.set_suspend_mode = da9063_buck_set_suspend_mode,
};

static struct regulator_ops da9063_ldo_ops = {
static const struct regulator_ops da9063_ldo_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/da9210-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static int da9210_set_current_limit(struct regulator_dev *rdev, int min_uA,
int max_uA);
static int da9210_get_current_limit(struct regulator_dev *rdev);

static struct regulator_ops da9210_buck_ops = {
static const struct regulator_ops da9210_buck_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/da9211-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static int da9211_get_current_limit(struct regulator_dev *rdev)
return current_limits[data];
}

static struct regulator_ops da9211_buck_ops = {
static const struct regulator_ops da9211_buck_ops = {
.get_mode = da9211_buck_get_mode,
.set_mode = da9211_buck_set_mode,
.enable = regulator_enable_regmap,
Expand Down
Loading

0 comments on commit 8bd31df

Please sign in to comment.