Skip to content

Commit

Permalink
Merge tag 'regulator-v4.11' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "Quite a lot of work going on the core this release, mainly around
  system initialization, but a quiet release for drivers:

   - fixes for registration of multiple regulators on a PMIC from Javier
     Martinez Canillas and Jon Hunter.

   - cleanups to the regulator_get() code from Dmitry Torokhov

   - lots of constifcation of structs from Bhumika Goyal

   - support for Motorola CPCAP regulators from Tony Lindgren"

* tag 'regulator-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (52 commits)
  regulator: core: Resolve supplies before disabling unused regulators
  regulator: Fix regulator_summary for deviceless consumers
  regulator: tps65086: Fix DT node referencing in of_parse_cb
  regulator: tps65086: Fix expected switch DT node names
  regulator: core: simplify _regulator_get()
  regulator: core: have regulator_dev_lookup() return ERR_PTR-encoded errors
  regulator: gpio: correct default type
  regulator: cpcap: Add basic regulator support
  regulator: core: fix typo in regulator_bulk_disable()
  regulator: core: optimize devm_regulator_bulk_get()
  regulator: core: simplify regulator_bulk_force_disable()
  regulator: core: have _regulator_get() accept get_type argument
  regulator: core: remove dead code in _regulator_get()
  regulator: rn5t618: constify regulator_ops structure
  regulator: rc5t583-regulator: constify regulator_ops structure
  regulator: pv88090-regulator: constify regulator_ops structure
  regulator: pv88080-regulator: constify regulator_ops structure
  regulator: pv88060-regulator: constify regulator_ops structure
  regulator: pfuze100-regulator: constify regulator_ops structure
  regulator: pcf50633-regulator: constify regulator_ops structure
  ...
  • Loading branch information
Linus Torvalds committed Feb 21, 2017
2 parents b3de5ad + fad9cd4 commit f790bd9
Show file tree
Hide file tree
Showing 48 changed files with 910 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Optional properties:
- anatop-delay-bit-shift: Bit shift for the step time register
- anatop-delay-bit-width: Number of bits used in the step time register
- vin-supply: The supply for this regulator
- anatop-enable-bit: Regulator enable bit offset

Any property defined as part of the core regulator
binding, defined in regulator.txt, can also be used.
Expand Down
34 changes: 34 additions & 0 deletions Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Motorola CPCAP PMIC voltage regulators
------------------------------------

Requires node properties:
- "compatible" value one of:
"motorola,cpcap-regulator"
"motorola,mapphone-cpcap-regulator"

Required regulator properties:
- "regulator-name"
- "regulator-enable-ramp-delay"
- "regulator-min-microvolt"
- "regulator-max-microvolt"

Optional regulator properties:
- "regulator-boot-on"

See Documentation/devicetree/bindings/regulator/regulator.txt
for more details about the regulator properties.

Example:

cpcap_regulator: regulator {
compatible = "motorola,cpcap-regulator";

cpcap_regulators: regulators {
sw5: SW5 {
regulator-min-microvolt = <5050000>;
regulator-max-microvolt = <5050000>;
regulator-enable-ramp-delay = <50000>;
regulator-boot-on;
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Optional properties:
- startup-delay-us : Startup time in microseconds.
- enable-active-high : Polarity of GPIO is active high (default is low).
- regulator-type : Specifies what is being regulated, must be either
"voltage" or "current", defaults to current.
"voltage" or "current", defaults to voltage.

Any property defined as part of the core regulator binding defined in
regulator.txt can also be used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Regulator nodes are identified by their compatible:
"qcom,rpm-pm8841-regulators"
"qcom,rpm-pm8916-regulators"
"qcom,rpm-pm8941-regulators"
"qcom,rpm-pm8994-regulators"
"qcom,rpm-pma8084-regulators"

- vdd_s1-supply:
Expand Down Expand Up @@ -68,6 +69,56 @@ Regulator nodes are identified by their compatible:
Definition: reference to regulator supplying the input pin, as
described in the data sheet

- vdd_s1-supply:
- vdd_s2-supply:
- vdd_s3-supply:
- vdd_s4-supply:
- vdd_s5-supply:
- vdd_s6-supply:
- vdd_s7-supply:
- vdd_s8-supply:
- vdd_s9-supply:
- vdd_s10-supply:
- vdd_s11-supply:
- vdd_s12-supply:
- vdd_l1-supply:
- vdd_l2_l26_l28-supply:
- vdd_l3_l11-supply:
- vdd_l4_l27_l31-supply:
- vdd_l5_l7-supply:
- vdd_l6_l12_l32-supply:
- vdd_l5_l7-supply:
- vdd_l8_l16_l30-supply:
- vdd_l9_l10_l18_l22-supply:
- vdd_l9_l10_l18_l22-supply:
- vdd_l3_l11-supply:
- vdd_l6_l12_l32-supply:
- vdd_l13_l19_l23_l24-supply:
- vdd_l14_l15-supply:
- vdd_l14_l15-supply:
- vdd_l8_l16_l30-supply:
- vdd_l17_l29-supply:
- vdd_l9_l10_l18_l22-supply:
- vdd_l13_l19_l23_l24-supply:
- vdd_l20_l21-supply:
- vdd_l20_l21-supply:
- vdd_l9_l10_l18_l22-supply:
- vdd_l13_l19_l23_l24-supply:
- vdd_l13_l19_l23_l24-supply:
- vdd_l25-supply:
- vdd_l2_l26_l28-supply:
- vdd_l4_l27_l31-supply:
- vdd_l2_l26_l28-supply:
- vdd_l17_l29-supply:
- vdd_l8_l16_l30-supply:
- vdd_l4_l27_l31-supply:
- vdd_l6_l12_l32-supply:
- vdd_lvs1_2-supply:
Usage: optional (pm8994 only)
Value type: <phandle>
Definition: reference to regulator supplying the input pin, as
described in the data sheet

- vdd_s1-supply:
- vdd_s2-supply:
- vdd_s3-supply:
Expand Down Expand Up @@ -113,6 +164,11 @@ pm8941:
l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2,
lvs3, 5vs1, 5vs2

pm8994:
s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, l1, l2, l3, l4, l5,
l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20,
l21, l22, l23, l24, l25, l26, l27, l28, l29, l30, l31, l32, lvs1, lvs2

pma8084:
s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, l1, l2, l3, l4, l5,
l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20,
Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/88pm800.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static int pm800_get_current_limit(struct regulator_dev *rdev)
return info->max_ua;
}

static struct regulator_ops pm800_volt_range_ops = {
static const struct regulator_ops pm800_volt_range_ops = {
.list_voltage = regulator_list_voltage_linear_range,
.map_voltage = regulator_map_voltage_linear_range,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
Expand All @@ -191,7 +191,7 @@ static struct regulator_ops pm800_volt_range_ops = {
.get_current_limit = pm800_get_current_limit,
};

static struct regulator_ops pm800_volt_table_ops = {
static const struct regulator_ops pm800_volt_table_ops = {
.list_voltage = regulator_list_voltage_table,
.map_voltage = regulator_map_voltage_iterate,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/88pm8607.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ static int pm8607_list_voltage(struct regulator_dev *rdev, unsigned index)
return ret;
}

static struct regulator_ops pm8607_regulator_ops = {
static const struct regulator_ops pm8607_regulator_ops = {
.list_voltage = pm8607_list_voltage,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
Expand All @@ -229,7 +229,7 @@ static struct regulator_ops pm8607_regulator_ops = {
.is_enabled = regulator_is_enabled_regmap,
};

static struct regulator_ops pm8606_preg_ops = {
static const struct regulator_ops pm8606_preg_ops = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
Expand Down
7 changes: 7 additions & 0 deletions drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ config REGULATOR_BCM590XX
BCM590xx PMUs. This will enable support for the software
controllable LDO/Switching regulators.

config REGULATOR_CPCAP
tristate "Motorola CPCAP regulator"
depends on MFD_CPCAP
help
Say y here for CPCAP regulator found on some Motorola phones
and tablets such as Droid 4.

config REGULATOR_DA903X
tristate "Dialog Semiconductor DA9030/DA9034 regulators"
depends on PMIC_DA903X
Expand Down
1 change: 1 addition & 0 deletions drivers/regulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o

obj-$(CONFIG_REGULATOR_88PM800) += 88pm800.o
obj-$(CONFIG_REGULATOR_88PM8607) += 88pm8607.o
obj-$(CONFIG_REGULATOR_CPCAP) += cpcap-regulator.o
obj-$(CONFIG_REGULATOR_AAT2870) += aat2870-regulator.o
obj-$(CONFIG_REGULATOR_AB3100) += ab3100.o
obj-$(CONFIG_REGULATOR_AB8500) += ab8500-ext.o ab8500.o
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/aat2870-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static int aat2870_ldo_is_enabled(struct regulator_dev *rdev)
return val & ri->enable_mask ? 1 : 0;
}

static struct regulator_ops aat2870_ldo_ops = {
static const struct regulator_ops aat2870_ldo_ops = {
.list_voltage = regulator_list_voltage_table,
.map_voltage = regulator_map_voltage_ascend,
.set_voltage_sel = aat2870_ldo_set_voltage_sel,
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/act8945a-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static const struct regulator_linear_range act8945a_voltage_ranges[] = {
REGULATOR_LINEAR_RANGE(2400000, 48, 63, 100000),
};

static struct regulator_ops act8945a_ops = {
static const struct regulator_ops act8945a_ops = {
.list_voltage = regulator_list_voltage_linear_range,
.map_voltage = regulator_map_voltage_linear_range,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/ad5398.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static int ad5398_disable(struct regulator_dev *rdev)
return ret;
}

static struct regulator_ops ad5398_ops = {
static const struct regulator_ops ad5398_ops = {
.get_current_limit = ad5398_get_current_limit,
.set_current_limit = ad5398_set_current_limit,
.enable = ad5398_enable,
Expand Down
12 changes: 12 additions & 0 deletions drivers/regulator/anatop-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,19 @@ static int anatop_regulator_probe(struct platform_device *pdev)
return -EINVAL;
}
} else {
u32 enable_bit;

rdesc->ops = &anatop_rops;

if (!of_property_read_u32(np, "anatop-enable-bit",
&enable_bit)) {
anatop_rops.enable = regulator_enable_regmap;
anatop_rops.disable = regulator_disable_regmap;
anatop_rops.is_enabled = regulator_is_enabled_regmap;

rdesc->enable_reg = sreg->control_reg;
rdesc->enable_mask = BIT(enable_bit);
}
}

/* register regulator */
Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/arizona-ldo1.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static int arizona_ldo1_hc_get_voltage_sel(struct regulator_dev *rdev)
return (val & ARIZONA_LDO1_VSEL_MASK) >> ARIZONA_LDO1_VSEL_SHIFT;
}

static struct regulator_ops arizona_ldo1_hc_ops = {
static const struct regulator_ops arizona_ldo1_hc_ops = {
.list_voltage = arizona_ldo1_hc_list_voltage,
.map_voltage = arizona_ldo1_hc_map_voltage,
.get_voltage_sel = arizona_ldo1_hc_get_voltage_sel,
Expand All @@ -135,7 +135,7 @@ static const struct regulator_desc arizona_ldo1_hc = {
.owner = THIS_MODULE,
};

static struct regulator_ops arizona_ldo1_ops = {
static const struct regulator_ops arizona_ldo1_ops = {
.list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
Expand Down
8 changes: 5 additions & 3 deletions drivers/regulator/arizona-micsupp.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static void arizona_micsupp_check_cp(struct work_struct *work)
struct arizona_micsupp *micsupp =
container_of(work, struct arizona_micsupp, check_cp_work);
struct snd_soc_dapm_context *dapm = micsupp->arizona->dapm;
struct snd_soc_component *component = snd_soc_dapm_to_component(dapm);
struct arizona *arizona = micsupp->arizona;
struct regmap *regmap = arizona->regmap;
unsigned int reg;
Expand All @@ -59,9 +60,10 @@ static void arizona_micsupp_check_cp(struct work_struct *work)
if (dapm) {
if ((reg & (ARIZONA_CPMIC_ENA | ARIZONA_CPMIC_BYPASS)) ==
ARIZONA_CPMIC_ENA)
snd_soc_dapm_force_enable_pin(dapm, "MICSUPP");
snd_soc_component_force_enable_pin(component,
"MICSUPP");
else
snd_soc_dapm_disable_pin(dapm, "MICSUPP");
snd_soc_component_disable_pin(component, "MICSUPP");

snd_soc_dapm_sync(dapm);
}
Expand Down Expand Up @@ -104,7 +106,7 @@ static int arizona_micsupp_set_bypass(struct regulator_dev *rdev, bool ena)
return ret;
}

static struct regulator_ops arizona_micsupp_ops = {
static const struct regulator_ops arizona_micsupp_ops = {
.enable = arizona_micsupp_enable,
.disable = arizona_micsupp_disable,
.is_enabled = regulator_is_enabled_regmap,
Expand Down
6 changes: 3 additions & 3 deletions drivers/regulator/as3711-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static unsigned int as3711_get_mode_sd(struct regulator_dev *rdev)
return -EINVAL;
}

static struct regulator_ops as3711_sd_ops = {
static const struct regulator_ops as3711_sd_ops = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
Expand All @@ -94,7 +94,7 @@ static struct regulator_ops as3711_sd_ops = {
.set_mode = as3711_set_mode_sd,
};

static struct regulator_ops as3711_aldo_ops = {
static const struct regulator_ops as3711_aldo_ops = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
Expand All @@ -104,7 +104,7 @@ static struct regulator_ops as3711_aldo_ops = {
.map_voltage = regulator_map_voltage_linear_range,
};

static struct regulator_ops as3711_dldo_ops = {
static const struct regulator_ops as3711_dldo_ops = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
Expand Down
8 changes: 4 additions & 4 deletions drivers/regulator/axp20x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@
.ops = &axp20x_ops_range, \
}

static struct regulator_ops axp20x_ops_fixed = {
static const struct regulator_ops axp20x_ops_fixed = {
.list_voltage = regulator_list_voltage_linear,
};

static struct regulator_ops axp20x_ops_range = {
static const struct regulator_ops axp20x_ops_range = {
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.list_voltage = regulator_list_voltage_linear_range,
Expand All @@ -141,7 +141,7 @@ static struct regulator_ops axp20x_ops_range = {
.is_enabled = regulator_is_enabled_regmap,
};

static struct regulator_ops axp20x_ops = {
static const struct regulator_ops axp20x_ops = {
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.list_voltage = regulator_list_voltage_linear,
Expand All @@ -150,7 +150,7 @@ static struct regulator_ops axp20x_ops = {
.is_enabled = regulator_is_enabled_regmap,
};

static struct regulator_ops axp20x_ops_sw = {
static const struct regulator_ops axp20x_ops_sw = {
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
Expand Down
6 changes: 3 additions & 3 deletions drivers/regulator/bcm590xx-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static int bcm590xx_get_enable_register(int id)
return reg;
}

static struct regulator_ops bcm590xx_ops_ldo = {
static const struct regulator_ops bcm590xx_ops_ldo = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
Expand All @@ -260,7 +260,7 @@ static struct regulator_ops bcm590xx_ops_ldo = {
.map_voltage = regulator_map_voltage_iterate,
};

static struct regulator_ops bcm590xx_ops_dcdc = {
static const struct regulator_ops bcm590xx_ops_dcdc = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
Expand All @@ -270,7 +270,7 @@ static struct regulator_ops bcm590xx_ops_dcdc = {
.map_voltage = regulator_map_voltage_linear_range,
};

static struct regulator_ops bcm590xx_ops_vbus = {
static const struct regulator_ops bcm590xx_ops_vbus = {
.is_enabled = regulator_is_enabled_regmap,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
Expand Down
Loading

0 comments on commit f790bd9

Please sign in to comment.