Commit 98537ee9 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'regulator-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "A couple of new features in the core, the most interesting one being
  support for complex regulator coupling configurations initially
  targeted at nVidia Tegra SoCs, and some new drivers but otherwise
  quite a quiet release.

  Summary:

   - Core support for gradual ramping of voltages for devices that can't
     manage large changes in hardware from Bartosz Golaszewski.

   - Core support for systems that have complex coupling requirements
     best described via code, contributed by Dmitry Osipenko.

   - New drivers for Dialog SLG51000, Qualcomm PM8005 and ST
     Microelectronics STM32-Booster"

* tag 'regulator-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (52 commits)
  regulator: max77650: use vsel_step
  regulator: implement selector stepping
  regulator: max77650: add MODULE_ALIAS()
  regulator: max77620: remove redundant assignment to variable ret
  dt-bindings: regulator: add support for the stm32-booster
  regulator: add support for the stm32-booster
  regulator: s2mps11: Adjust supported buck voltages to real values
  regulator: s2mps11: Fix buck7 and buck8 wrong voltages
  gpio: Fix return value mismatch of function gpiod_get_from_of_node()
  regulator: core: Expose some of core functions needed by couplers
  regulator: core: Introduce API for regulators coupling customization
  regulator: s2mps11: Add support for disabling S2MPS11 regulators in suspend
  regulator: s2mps11: Reduce number of rdev_get_id() calls
  regulator: qcom_spmi: Do NULL check for lvs
  regulator: qcom_spmi: Fix math of spmi_regulator_set_voltage_time_sel
  regulator: da9061/62: Adjust LDO voltage selection minimum value
  regulator: s2mps11: Fix ERR_PTR dereference on GPIO lookup failure
  regulator: qcom_spmi: add PMS405 SPMI regulator
  dt-bindings: qcom_spmi: Document pms405 support
  arm64: dts: msm8998-mtp: Add pm8005_s1 regulator
  ...
parents 12a5146b 0ed4513c
......@@ -5,7 +5,8 @@ of analogue I/O.
This document lists regulator specific bindings, see the primary binding
document:
../mfd/arizona.txt
For Wolfson Microelectronic Arizona codecs: ../mfd/arizona.txt
For Cirrus Logic Madera codecs: ../mfd/madera.txt
Optional properties:
- wlf,ldoena : GPIO specifier for the GPIO controlling LDOENA
......
......@@ -12,10 +12,13 @@ maintainers:
description:
Any property defined as part of the core regulator binding, defined in
regulator.txt, can also be used. However a fixed voltage regulator is
regulator.yaml, can also be used. However a fixed voltage regulator is
expected to have the regulator-min-microvolt and regulator-max-microvolt
to be the same.
allOf:
- $ref: "regulator.yaml#"
properties:
compatible:
const: regulator-fixed
......
GPIO controlled regulators
Required properties:
- compatible : Must be "regulator-gpio".
- regulator-name : Defined in regulator.txt as optional, but required
here.
- gpios : Array of one or more GPIO pins used to select the
regulator voltage/current listed in "states".
- states : Selection of available voltages/currents provided by
this regulator and matching GPIO configurations to
achieve them. If there are no states in the "states"
array, use a fixed regulator instead.
Optional properties:
- enable-gpios : GPIO used to enable/disable the regulator.
Warning, the GPIO phandle flags are ignored and the
GPIO polarity is controlled solely by the presence
of "enable-active-high" DT property. This is due to
compatibility with old DTs.
- enable-active-high : Polarity of "enable-gpio" GPIO is active HIGH.
Default is active LOW.
- gpios-states : On operating systems, that don't support reading back
gpio values in output mode (most notably linux), this
array provides the state of GPIO pins set when
requesting them from the gpio controller. Systems,
that are capable of preserving state when requesting
the lines, are free to ignore this property.
0: LOW, 1: HIGH. Default is LOW if nothing else
is specified.
- startup-delay-us : Startup time in microseconds.
- regulator-type : Specifies what is being regulated, must be either
"voltage" or "current", defaults to voltage.
Any property defined as part of the core regulator binding defined in
regulator.txt can also be used.
Example:
mmciv: gpio-regulator {
compatible = "regulator-gpio";
regulator-name = "mmci-gpio-supply";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <2600000>;
regulator-boot-on;
enable-gpios = <&gpio0 23 0x4>;
gpios = <&gpio0 24 0x4
&gpio0 25 0x4>;
states = <1800000 0x3
2200000 0x2
2600000 0x1
2900000 0x0>;
startup-delay-us = <100000>;
enable-active-high;
};
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/gpio-regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: GPIO controlled regulators
maintainers:
- Liam Girdwood <lgirdwood@gmail.com>
- Mark Brown <broonie@kernel.org>
description:
Any property defined as part of the core regulator binding, defined in
regulator.txt, can also be used.
allOf:
- $ref: "regulator.yaml#"
properties:
compatible:
const: regulator-gpio
regulator-name: true
enable-gpios:
description: GPIO to use to enable/disable the regulator.
Warning, the GPIO phandle flags are ignored and the GPIO polarity is
controlled solely by the presence of "enable-active-high" DT property.
This is due to compatibility with old DTs.
maxItems: 1
gpios:
description: Array of one or more GPIO pins used to select the regulator
voltage/current listed in "states".
minItems: 1
maxItems: 8 # Should be enough...
gpios-states:
description: |
On operating systems, that don't support reading back gpio values in
output mode (most notably linux), this array provides the state of GPIO
pins set when requesting them from the gpio controller. Systems, that are
capable of preserving state when requesting the lines, are free to ignore
this property.
0: LOW
1: HIGH
Default is LOW if nothing else is specified.
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32-array
- maxItems: 8
items:
enum: [ 0, 1 ]
default: 0
states:
description: Selection of available voltages/currents provided by this
regulator and matching GPIO configurations to achieve them. If there are
no states in the "states" array, use a fixed regulator instead.
allOf:
- $ref: /schemas/types.yaml#/definitions/uint32-matrix
- maxItems: 8
items:
items:
- description: Voltage in microvolts
- description: GPIO group state value
startup-delay-us:
description: startup time in microseconds
enable-active-high:
description: Polarity of "enable-gpio" GPIO is active HIGH. Default is
active LOW.
type: boolean
gpio-open-drain:
description:
GPIO is open drain type. If this property is missing then default
assumption is false.
type: boolean
regulator-type:
description: Specifies what is being regulated.
allOf:
- $ref: /schemas/types.yaml#/definitions/string
- enum:
- voltage
- current
default: voltage
required:
- compatible
- regulator-name
- gpios
- states
examples:
- |
gpio-regulator {
compatible = "regulator-gpio";
regulator-name = "mmci-gpio-supply";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <2600000>;
regulator-boot-on;
enable-gpios = <&gpio0 23 0x4>;
gpios = <&gpio0 24 0x4
&gpio0 25 0x4>;
states = <1800000 0x3>,
<2200000 0x2>,
<2600000 0x1>,
<2900000 0x0>;
startup-delay-us = <100000>;
enable-active-high;
};
...
Maxim MAX8660 voltage regulator
Required properties:
- compatible: must be one of "maxim,max8660", "maxim,max8661"
- reg: I2C slave address, usually 0x34
- any required generic properties defined in regulator.txt
Example:
i2c_master {
max8660@34 {
compatible = "maxim,max8660";
reg = <0x34>;
regulators {
regulator@0 {
regulator-compatible= "V3(DCDC)";
regulator-min-microvolt = <725000>;
regulator-max-microvolt = <1800000>;
};
regulator@1 {
regulator-compatible= "V4(DCDC)";
regulator-min-microvolt = <725000>;
regulator-max-microvolt = <1800000>;
};
regulator@2 {
regulator-compatible= "V5(LDO)";
regulator-min-microvolt = <1700000>;
regulator-max-microvolt = <2000000>;
};
regulator@3 {
regulator-compatible= "V6(LDO)";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
};
regulator@4 {
regulator-compatible= "V7(LDO)";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
};
};
};
};
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/max8660.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Maxim MAX8660 voltage regulator
maintainers:
- Daniel Mack <zonque@gmail.com>
properties:
$nodename:
pattern: "pmic@[0-9a-f]{1,2}"
compatible:
enum:
- maxim,max8660
- maxim,max8661
reg:
maxItems: 1
regulators:
type: object
patternProperties:
"regulator-.+":
$ref: "regulator.yaml#"
additionalProperties: false
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
pmic@34 {
compatible = "maxim,max8660";
reg = <0x34>;
regulators {
regulator-V3 {
regulator-compatible= "V3(DCDC)";
regulator-min-microvolt = <725000>;
regulator-max-microvolt = <1800000>;
};
regulator-V4 {
regulator-compatible= "V4(DCDC)";
regulator-min-microvolt = <725000>;
regulator-max-microvolt = <1800000>;
};
regulator-V5 {
regulator-compatible= "V5(LDO)";
regulator-min-microvolt = <1700000>;
regulator-max-microvolt = <2000000>;
};
regulator-V6 {
regulator-compatible= "V6(LDO)";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
};
regulator-V7 {
regulator-compatible= "V7(LDO)";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
};
};
};
};
...
......@@ -4,11 +4,13 @@ Qualcomm SPMI Regulators
Usage: required
Value type: <string>
Definition: must be one of:
"qcom,pm8005-regulators"
"qcom,pm8841-regulators"
"qcom,pm8916-regulators"
"qcom,pm8941-regulators"
"qcom,pm8994-regulators"
"qcom,pmi8994-regulators"
"qcom,pms405-regulators"
- interrupts:
Usage: optional
......@@ -110,6 +112,23 @@ Qualcomm SPMI Regulators
Definition: Reference to regulator supplying the input pin, as
described in the data sheet.
- vdd_l1_l2-supply:
- vdd_l3_l8-supply:
- vdd_l4-supply:
- vdd_l5_l6-supply:
- vdd_l10_l11_l12_l13-supply:
- vdd_l7-supply:
- vdd_l9-supply:
- vdd_s1-supply:
- vdd_s2-supply:
- vdd_s3-supply:
- vdd_s4-supply:
- vdd_s5-supply
Usage: optional (pms405 only)
Value type: <phandle>
Definition: Reference to regulator supplying the input pin, as
described in the data sheet.
- qcom,saw-reg:
Usage: optional
Value type: <phandle>
......@@ -120,6 +139,9 @@ The regulator node houses sub-nodes for each regulator within the device. Each
sub-node is identified using the node's name, with valid values listed for each
of the PMICs below.
pm8005:
s1, s2, s3, s4
pm8841:
s1, s2, s3, s4, s5, s6, s7, s8
......
Voltage/Current Regulators
Optional properties:
- regulator-name: A string used as a descriptive name for regulator outputs
- regulator-min-microvolt: smallest voltage consumers may set
- regulator-max-microvolt: largest voltage consumers may set
- regulator-microvolt-offset: Offset applied to voltages to compensate for voltage drops
- regulator-min-microamp: smallest current consumers may set
- regulator-max-microamp: largest current consumers may set
- regulator-input-current-limit-microamp: maximum input current regulator allows
- regulator-always-on: boolean, regulator should never be disabled
- regulator-boot-on: bootloader/firmware enabled regulator
- regulator-allow-bypass: allow the regulator to go into bypass mode
- regulator-allow-set-load: allow the regulator performance level to be configured
- <name>-supply: phandle to the parent supply/regulator node
- regulator-ramp-delay: ramp delay for regulator(in uV/us)
For hardware which supports disabling ramp rate, it should be explicitly
initialised to zero (regulator-ramp-delay = <0>) for disabling ramp delay.
- regulator-enable-ramp-delay: The time taken, in microseconds, for the supply
rail to reach the target voltage, plus/minus whatever tolerance the board
design requires. This property describes the total system ramp time
required due to the combination of internal ramping of the regulator itself,
and board design issues such as trace capacitance and load on the supply.
- regulator-settling-time-us: Settling time, in microseconds, for voltage
change if regulator have the constant time for any level voltage change.
This is useful when regulator have exponential voltage change.
- regulator-settling-time-up-us: Settling time, in microseconds, for voltage
increase if the regulator needs a constant time to settle after voltage
increases of any level. This is useful for regulators with exponential
voltage changes.
- regulator-settling-time-down-us: Settling time, in microseconds, for voltage
decrease if the regulator needs a constant time to settle after voltage
decreases of any level. This is useful for regulators with exponential
voltage changes.
- regulator-soft-start: Enable soft start so that voltage ramps slowly
- regulator-state-standby sub-root node for Standby mode
: equivalent with standby Linux sleep state, which provides energy savings
with a relatively quick transition back time.
- regulator-state-mem sub-root node for Suspend-to-RAM mode
: suspend to memory, the device goes to sleep, but all data stored in memory,
only some external interrupt can wake the device.
- regulator-state-disk sub-root node for Suspend-to-DISK mode
: suspend to disk, this state operates similarly to Suspend-to-RAM,
but includes a final step of writing memory contents to disk.
- regulator-state-[mem/disk/standby] node has following common properties:
- regulator-on-in-suspend: regulator should be on in suspend state.
- regulator-off-in-suspend: regulator should be off in suspend state.
- regulator-suspend-min-microvolt: minimum voltage may be set in
suspend state.
- regulator-suspend-max-microvolt: maximum voltage may be set in
suspend state.
- regulator-suspend-microvolt: the default voltage which regulator
would be set in suspend. This property is now deprecated, instead
setting voltage for suspend mode via the API which regulator
driver provides is recommended.
- regulator-changeable-in-suspend: whether the default voltage and
the regulator on/off in suspend can be changed in runtime.
- regulator-mode: operating mode in the given suspend state.
The set of possible operating modes depends on the capabilities of
every hardware so the valid modes are documented on each regulator
device tree binding document.
- regulator-initial-mode: initial operating mode. The set of possible operating
modes depends on the capabilities of every hardware so each device binding
documentation explains which values the regulator supports.
- regulator-allowed-modes: list of operating modes that software is allowed to
configure for the regulator at run-time. Elements may be specified in any
order. The set of possible operating modes depends on the capabilities of
every hardware so each device binding document explains which values the
regulator supports.
- regulator-system-load: Load in uA present on regulator that is not captured by
any consumer request.
- regulator-pull-down: Enable pull down resistor when the regulator is disabled.
- regulator-over-current-protection: Enable over current protection.
- regulator-active-discharge: tristate, enable/disable active discharge of
regulators. The values are:
0: Disable active discharge.
1: Enable active discharge.
Absence of this property will leave configuration to default.
- regulator-coupled-with: Regulators with which the regulator
is coupled. The linkage is 2-way - all coupled regulators should be linked
with each other. A regulator should not be coupled with its supplier.
- regulator-coupled-max-spread: Array of maximum spread between voltages of
coupled regulators in microvolts, each value in the array relates to the
corresponding couple specified by the regulator-coupled-with property.
- regulator-max-step-microvolt: Maximum difference between current and target
voltages that can be changed safely in a single step.
Deprecated properties:
- regulator-compatible: If a regulator chip contains multiple
regulators, and if the chip's binding contains a child node that
describes each regulator, then this property indicates which regulator
this child node is intended to configure. If this property is missing,
the node's name will be used instead.
Example:
xyzreg: regulator@0 {
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <2500000>;
regulator-always-on;
vin-supply = <&vin>;
regulator-state-mem {
regulator-on-in-suspend;
};
};
Regulator Consumers:
Consumer nodes can reference one or more of its supplies/
regulators using the below bindings.
- <name>-supply: phandle to the regulator node
These are the same bindings that a regulator in the above
example used to reference its own supply, in which case
its just seen as a special case of a regulator being a
consumer itself.
Example of a consumer device node (mmc) referencing two
regulators (twl_reg1 and twl_reg2),
twl_reg1: regulator@0 {
...
...
...
};
twl_reg2: regulator@1 {
...
...
...
};
mmc: mmc@0 {
...
...
vmmc-supply = <&twl_reg1>;
vmmcaux-supply = <&twl_reg2>;
};
This file has moved to regulator.yaml.
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/regulator/regulator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Voltage/Current Regulators
maintainers:
- Liam Girdwood <lgirdwood@gmail.com>
- Mark Brown <broonie@kernel.org>
properties:
regulator-name:
description: A string used as a descriptive name for regulator outputs
$ref: "/schemas/types.yaml#/definitions/string"
regulator-min-microvolt:
description: smallest voltage consumers may set
regulator-max-microvolt:
description: largest voltage consumers may set
regulator-microvolt-offset:
description: Offset applied to voltages to compensate for voltage drops
regulator-min-microamp:
description: smallest current consumers may set
regulator-max-microamp:
description: largest current consumers may set
regulator-input-current-limit-microamp:
description: maximum input current regulator allows
regulator-always-on:
description: boolean, regulator should never be disabled
type: boolean
regulator-boot-on:
description: bootloader/firmware enabled regulator
type: boolean
regulator-allow-bypass:
description: allow the regulator to go into bypass mode
type: boolean
regulator-allow-set-load:
description: allow the regulator performance level to be configured
type: boolean
regulator-ramp-delay:
description: ramp delay for regulator(in uV/us) For hardware which supports
disabling ramp rate, it should be explicitly initialised to zero (regulator-ramp-delay
= <0>) for disabling ramp delay.
$ref: "/schemas/types.yaml#/definitions/uint32"
regulator-enable-ramp-delay:
description: The time taken, in microseconds, for the supply rail to
reach the target voltage, plus/minus whatever tolerance the board
design requires. This property describes the total system ramp time
required due to the combination of internal ramping of the regulator
itself, and board design issues such as trace capacitance and load
on the supply.
$ref: "/schemas/types.yaml#/definitions/uint32"
regulator-settling-time-us:
description: Settling time, in microseconds, for voltage change if regulator
have the constant time for any level voltage change. This is useful
when regulator have exponential voltage change.
regulator-settling-time-up-us:
description: Settling time, in microseconds, for voltage increase if
the regulator needs a constant time to settle after voltage increases
of any level. This is useful for regulators with exponential voltage
changes.
regulator-settling-time-down-us:
description: Settling time, in microseconds, for voltage decrease if
the regulator needs a constant time to settle after voltage decreases
of any level. This is useful for regulators with exponential voltage
changes.
regulator-soft-start:
description: Enable soft start so that voltage ramps slowly
type: boolean
regulator-initial-mode:
description: initial operating mode. The set of possible operating modes
depends on the capabilities of every hardware so each device binding
documentation explains which values the regulator supports.
$ref: "/schemas/types.yaml#/definitions/uint32"
regulator-allowed-modes:
description: list of operating modes that software is allowed to configure
for the regulator at run-time. Elements may be specified in any order.
The set of possible operating modes depends on the capabilities of
every hardware so each device binding document explains which values
the regulator supports.
$ref: "/schemas/types.yaml#/definitions/uint32-array"
regulator-system-load:
description: Load in uA present on regulator that is not captured by
any consumer request.
$ref: "/schemas/types.yaml#/definitions/uint32"
regulator-pull-down:
description: Enable pull down resistor when the regulator is disabled.
type: boolean
regulator-over-current-protection:
description: Enable over current protection.
type: boolean
regulator-active-discharge:
description: |
tristate, enable/disable active discharge of regulators. The values are:
0: Disable active discharge.
1: Enable active discharge.
Absence of this property will leave configuration to default.
allOf:
- $ref: "/schemas/types.yaml#/definitions/uint32"
- enum: [ 0, 1 ]
regulator-coupled-with:
description: Regulators with which the regulator is coupled. The linkage
is 2-way - all coupled regulators should be linked with each other.
A regulator should not be coupled with its supplier.
$ref: "/schemas/types.yaml#/definitions/phandle-array"
regulator-coupled-max-spread:
description: Array of maximum spread between voltages of coupled regulators
in microvolts, each value in the array relates to the corresponding
couple specified by the regulator-coupled-with property.
$ref: "/schemas/types.yaml#/definitions/uint32"
regulator-max-step-microvolt:
description: Maximum difference between current and target voltages
that can be changed safely in a single step.
patternProperties:
".*-supply$":
description: Input supply phandle(s) for this node
regulator-state-(standby|mem|disk):
type: object
description:
sub-nodes for regulator state in Standby, Suspend-to-RAM, and
Suspend-to-DISK modes. Equivalent with standby, mem, and disk Linux
sleep states.
properties:
regulator-on-in-suspend:
description: regulator should be on in suspend state.
type: boolean
regulator-off-in-suspend:
description: regulator should be off in suspend state.
type: boolean
regulator-suspend-min-microvolt:
description: minimum voltage may be set in suspend state.
regulator-suspend-max-microvolt:
description: maximum voltage may be set in suspend state.
regulator-suspend-microvolt:
description: the default voltage which regulator would be set in
suspend. This property is now deprecated, instead setting voltage
for suspend mode via the API which regulator driver provides is
recommended.
regulator-changeable-in-suspend:
description: whether the default voltage and the regulator on/off
in suspend can be changed in runtime.
type: boolean
regulator-mode:
description: operating mode in the given suspend state. The set
of possible operating modes depends on the capabilities of every
hardware so the valid modes are documented on each regulator device
tree binding document.
$ref: "/schemas/types.yaml#/definitions/uint32"
additionalProperties: false
examples:
- |
xyzreg: regulator@0 {
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <2500000>;
regulator-always-on;
vin-supply = <&vin>;
regulator-state-mem {
regulator-on-in-suspend;
};
};
...
* Dialog Semiconductor SLG51000 Voltage Regulator
Required properties:
- compatible : Should be "dlg,slg51000" for SLG51000
- reg : Specifies the I2C slave address.
- xxx-supply: Input voltage supply regulator for ldo3 to ldo7.
These entries are required if regulators are enabled for a device.
An absence of these properties can cause the regulator registration to fail.
If some of input supply is powered through battery or always-on supply then
also it is required to have these parameters with proper node handle of always
on power supply.
vin3-supply: Input supply for ldo3
vin4-supply: Input supply for ldo4
vin5-supply: Input supply for ldo5
vin6-supply: Input supply for ldo6
vin7-supply: Input supply for ldo7
Optional properties:
- interrupt-parent : Specifies the reference to the interrupt controller.
- interrupts : IRQ line information.
- dlg,cs-gpios : Specify a valid GPIO for chip select
Sub-nodes:
- regulators : This node defines the settings for the regulators.
The content of the sub-node is defined by the standard binding
for regulators; see regulator.txt.
The SLG51000 regulators are bound using their names listed below:
ldo1
ldo2
ldo3
ldo4
ldo5
ldo6
ldo7
Optional properties for regulators:
- enable-gpios : Specify a valid GPIO for platform control of the regulator.
Example:
pmic: slg51000@75 {
compatible = "dlg,slg51000";
reg = <0x75>;
regulators {
ldo1 {
regulator-name = "ldo1";
regulator-min-microvolt = <2400000>;
regulator-max-microvolt = <3300000>;
};
ldo2 {
regulator-name = "ldo2";
regulator-min-microvolt = <2400000>;
regulator-max-microvolt = <3300000>;
};
ldo3 {
regulator-name = "ldo3";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3750000>;
};
ldo4 {
regulator-name = "ldo4";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3750000>;
};
ldo5 {
regulator-name = "ldo5";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1200000>;
};
ldo6 {
regulator-name = "ldo6";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1200000>;
};
ldo7 {
regulator-name = "ldo7";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3750000>;
};
};
};
STM32 BOOSTER - Booster for ADC analog input switches
Some STM32 devices embed a 3.3V booster supplied by Vdda, that can be used
to supply ADC analog input switches.
Required properties:
- compatible: Should be one of:
"st,stm32h7-booster"
"st,stm32mp1-booster"
- st,syscfg: Phandle to system configuration controller.
- vdda-supply: Phandle to the vdda input analog voltage.
Example:
booster: regulator-booster {
compatible = "st,stm32mp1-booster";
st,syscfg = <&syscfg>;
vdda-supply = <&vdda>;
};
......@@ -4714,6 +4714,7 @@ F: Documentation/devicetree/bindings/mfd/da90*.txt
F: Documentation/devicetree/bindings/input/da90??-onkey.txt
F: Documentation/devicetree/bindings/thermal/da90??-thermal.txt
F: Documentation/devicetree/bindings/regulator/da92*.txt
F: Documentation/devicetree/bindings/regulator/slg51000.txt
F: Documentation/devicetree/bindings/watchdog/da90??-wdt.txt
F: Documentation/devicetree/bindings/sound/da[79]*.txt
F: drivers/gpio/gpio-da90??.c
......@@ -4729,6 +4730,7 @@ F: drivers/power/supply/da9052-battery.c
F: drivers/power/supply/da91??-*.c
F: drivers/regulator/da903x.c
F: drivers/regulator/da9???-regulator.[ch]
F: drivers/regulator/slg51000-regulator.[ch]
F: drivers/thermal/da90??-thermal.c
F: drivers/rtc/rtc-da90??.c
F: drivers/video/backlight/da90??_bl.c
......
......@@ -15,6 +15,7 @@
#include <linux/io.h>
#include <linux/init.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <linux/leds.h>
#include <linux/delay.h>
#include <linux/mmc/host.h>
......@@ -398,7 +399,6 @@ static struct pca953x_platform_data crag6410_pca_data = {
/* VDDARM is controlled by DVS1 connected to GPK(0) */
static struct wm831x_buckv_pdata vddarm_pdata = {
.dvs_control_src = 1,
.dvs_gpio = S3C64XX_GPK(0),
};
static struct regulator_consumer_supply vddarm_consumers[] = {
......@@ -596,6 +596,24 @@ static struct wm831x_pdata crag_pmic_pdata = {
.touch = &touch_pdata,
};
/*
* VDDARM is eventually ending up as a regulator hanging on the MFD cell device
* "wm831x-buckv.1" spawn from drivers/mfd/wm831x-core.c.
*
* From the note on the platform data we can see that this is clearly DVS1
* and assigned as dcdc1 resource to the MFD core which sets .id of the cell
* spawning the DVS1 platform device to 1, then the cell platform device
* name is calculated from 10*instance + id resulting in the device name
* "wm831x-buckv.11"
*/
static struct gpiod_lookup_table crag_pmic_gpiod_table = {
.dev_id = "wm831x-buckv.11",
.table = {
GPIO_LOOKUP("GPIOK", 0, "dvs", GPIO_ACTIVE_HIGH),
{ },
},
};
static struct i2c_board_info i2c_devs0[] = {
{ I2C_BOARD_INFO("24c08", 0x50), },
{ I2C_BOARD_INFO("tca6408", 0x20),
......@@ -836,6 +854,7 @@ static void __init crag6410_machine_init(void)
s3c_fb_set_platdata(&crag6410_lcd_pdata);
dwc2_hsotg_set_platdata(&crag6410_hsotg_pdata);
gpiod_add_lookup_table(&crag_pmic_gpiod_table);
i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0));
i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1));
......
......@@ -27,6 +27,23 @@ &blsp2_uart1 {
status = "okay";
};
&pm8005_lsid1 {
pm8005-regulators {
compatible = "qcom,pm8005-regulators";
vdd_s1-supply = <&vph_pwr>;
pm8005_s1: s1 { /* VDD_GFX supply */
regulator-min-microvolt = <524000>;
regulator-max-microvolt = <1100000>;
regulator-enable-ramp-delay = <500>;
/* hack until we rig up the gpu consumer */
regulator-always-on;
};
};
};
&qusb2phy {
status = "okay";
......
......@@ -4257,8 +4257,7 @@ EXPORT_SYMBOL_GPL(gpiod_get_index);
*
* Returns:
* On successful request the GPIO pin is configured in accordance with
* provided @dflags. If the node does not have the requested GPIO
* property, NULL is returned.
* provided @dflags.
*
* In case of error an ERR_PTR() is returned.
*/
......@@ -4280,9 +4279,6 @@ struct gpio_desc *gpiod_get_from_of_node(struct device_node *node,
index, &flags);
if (!desc || IS_ERR(desc)) {
/* If it is not there, just return NULL */
if (PTR_ERR(desc) == -ENOENT)
return NULL;
return desc;
}
......
......@@ -136,19 +136,20 @@ config REGULATOR_AB8500
signal AB8500 PMIC
config REGULATOR_ARIZONA_LDO1
tristate "Wolfson Arizona class devices LDO1"
depends on MFD_ARIZONA
tristate "Cirrus Madera and Wolfson Arizona class devices LDO1"
depends on MFD_ARIZONA || MFD_MADERA
depends on SND_SOC
help
Support for the LDO1 regulators found on Wolfson Arizona class
devices.
Support for the LDO1 regulators found on Cirrus Logic Madera codecs
and Wolfson Microelectronic Arizona codecs.
config REGULATOR_ARIZONA_MICSUPP
tristate "Wolfson Arizona class devices MICSUPP"
depends on MFD_ARIZONA
tristate "Cirrus Madera and Wolfson Arizona class devices MICSUPP"
depends on MFD_ARIZONA || MFD_MADERA
depends on SND_SOC
help
Support for the MICSUPP regulators found on Wolfson Arizona class
Support for the MICSUPP regulators found on Cirrus Logic Madera codecs
and Wolfson Microelectronic Arizona codecs
devices.
config REGULATOR_AS3711
......@@ -258,7 +259,7 @@ config REGULATOR_DA9062
config REGULATOR_DA9063
tristate "Dialog Semiconductor DA9063 regulators"
depends on MFD_DA9063
depends on MFD_DA9063 && OF
help
Say y here to support the BUCKs and LDOs regulators found on
DA9063 PMICs.
......@@ -829,6 +830,26 @@ config REGULATOR_SKY81452
This driver can also be built as a module. If so, the module
will be called sky81452-regulator.
config REGULATOR_SLG51000
tristate "Dialog Semiconductor SLG51000 regulators"
depends on I2C
select REGMAP_I2C
help
Say y here to support for the Dialog Semiconductor SLG51000.
The SLG51000 is seven compact and customizable low dropout
regulators.
config REGULATOR_STM32_BOOSTER
tristate "STMicroelectronics STM32 BOOSTER"
depends on ARCH_STM32 || COMPILE_TEST
help
This driver supports internal booster (3V3) embedded in some
STMicroelectronics STM32 chips. It can be used to supply ADC analog
input switches when vdda supply is below 2.7V.
This driver can also be built as a module. If so, the module
will be called stm32-booster.
config REGULATOR_STM32_VREFBUF
tristate "STMicroelectronics STM32 VREFBUF"
depends on ARCH_STM32 || COMPILE_TEST
......
......@@ -11,7 +11,7 @@ obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o
obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o
obj-$(CONFIG_REGULATOR_88PG86X) += 88pg86x.o
obj-$(CONFIG_REGULATOR_88PM800) += 88pm800.o
obj-$(CONFIG_REGULATOR_88PM800) += 88pm800-regulator.o
obj-$(CONFIG_REGULATOR_88PM8607) += 88pm8607.o
obj-$(CONFIG_REGULATOR_CPCAP) += cpcap-regulator.o
obj-$(CONFIG_REGULATOR_AAT2870) += aat2870-regulator.o
......@@ -104,6 +104,8 @@ obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
obj-$(CONFIG_REGULATOR_SC2731) += sc2731-regulator.o
obj-$(CONFIG_REGULATOR_SKY81452) += sky81452-regulator.o
obj-$(CONFIG_REGULATOR_SLG51000) += slg51000-regulator.o
obj-$(CONFIG_REGULATOR_STM32_BOOSTER) += stm32-booster.o
obj-$(CONFIG_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o
obj-$(CONFIG_REGULATOR_STM32_PWR) += stm32-pwr.o
obj-$(CONFIG_REGULATOR_STPMIC1) += stpmic1_regulator.o
......
......@@ -25,6 +25,10 @@
#include <linux/mfd/arizona/pdata.h>
#include <linux/mfd/arizona/registers.h>
#include <linux/mfd/madera/core.h>
#include <linux/mfd/madera/pdata.h>
#include <linux/mfd/madera/registers.h>
struct arizona_ldo1 {
struct regulator_dev *regulator;
struct regmap *regmap;
......@@ -158,6 +162,31 @@ static const struct regulator_init_data arizona_ldo1_wm5110 = {
.num_consumer_supplies = 1,
};
static const struct regulator_desc madera_ldo1 = {
.name = "LDO1",
.supply_name = "LDOVDD",
.type = REGULATOR_VOLTAGE,
.ops = &arizona_ldo1_ops,
.vsel_reg = MADERA_LDO1_CONTROL_1,
.vsel_mask = MADERA_LDO1_VSEL_MASK,
.min_uV = 900000,
.uV_step = 25000,
.n_voltages = 13,
.enable_time = 3000,
.owner = THIS_MODULE,
};
static const struct regulator_init_data madera_ldo1_default = {
.constraints = {
.min_uV = 1200000,
.max_uV = 1200000,
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = 1,
};
static int arizona_ldo1_of_get_pdata(struct arizona_ldo1_pdata *pdata,
struct regulator_config *config,
const struct regulator_desc *desc,
......@@ -320,6 +349,32 @@ static int arizona_ldo1_remove(struct platform_device *pdev)
return 0;
}
static int madera_ldo1_probe(struct platform_device *pdev)
{
struct madera *madera = dev_get_drvdata(pdev->dev.parent);
struct arizona_ldo1 *ldo1;
bool external_dcvdd;
int ret;
ldo1 = devm_kzalloc(&pdev->dev, sizeof(*ldo1), GFP_KERNEL);
if (!ldo1)
return -ENOMEM;
ldo1->regmap = madera->regmap;
ldo1->init_data = madera_ldo1_default;
ret = arizona_ldo1_common_init(pdev, ldo1, &madera_ldo1,
&madera->pdata.ldo1,
&external_dcvdd);
if (ret)
return ret;
madera->internal_dcvdd = !external_dcvdd;
return 0;
}
static struct platform_driver arizona_ldo1_driver = {
.probe = arizona_ldo1_probe,
.remove = arizona_ldo1_remove,
......@@ -328,10 +383,36 @@ static struct platform_driver arizona_ldo1_driver = {
},
};
module_platform_driver(arizona_ldo1_driver);
static struct platform_driver madera_ldo1_driver = {
.probe = madera_ldo1_probe,
.remove = arizona_ldo1_remove,
.driver = {
.name = "madera-ldo1",
},
};
static struct platform_driver * const madera_ldo1_drivers[] = {
&arizona_ldo1_driver,
&madera_ldo1_driver,
};
static int __init arizona_ldo1_init(void)
{
return platform_register_drivers(madera_ldo1_drivers,
ARRAY_SIZE(madera_ldo1_drivers));
}
module_init(arizona_ldo1_init);
static void __exit madera_ldo1_exit(void)
{
platform_unregister_drivers(madera_ldo1_drivers,
ARRAY_SIZE(madera_ldo1_drivers));
}
module_exit(madera_ldo1_exit);
/* Module information */
MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
MODULE_DESCRIPTION("Arizona LDO1 driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:arizona-ldo1");
MODULE_ALIAS("platform:madera-ldo1");
......@@ -16,7 +16,6 @@
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/gpio.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <sound/soc.h>
......@@ -25,6 +24,10 @@
#include <linux/mfd/arizona/pdata.h>
#include <linux/mfd/arizona/registers.h>
#include <linux/mfd/madera/core.h>
#include <linux/mfd/madera/pdata.h>
#include <linux/mfd/madera/registers.h>
#include <linux/regulator/arizona-micsupp.h>
struct arizona_micsupp {
......@@ -200,6 +203,28 @@ static const struct regulator_init_data arizona_micsupp_ext_default = {
.num_consumer_supplies = 1,
};
static const struct regulator_desc madera_micsupp = {
.name = "MICVDD",
.supply_name = "CPVDD1",
.type = REGULATOR_VOLTAGE,
.n_voltages = 40,
.ops = &arizona_micsupp_ops,
.vsel_reg = MADERA_LDO2_CONTROL_1,
.vsel_mask = MADERA_LDO2_VSEL_MASK,
.enable_reg = MADERA_MIC_CHARGE_PUMP_1,
.enable_mask = MADERA_CPMIC_ENA,
.bypass_reg = MADERA_MIC_CHARGE_PUMP_1,
.bypass_mask = MADERA_CPMIC_BYPASS,
.linear_ranges = arizona_micsupp_ext_ranges,
.n_linear_ranges = ARRAY_SIZE(arizona_micsupp_ext_ranges),
.enable_time = 3000,
.owner = THIS_MODULE,
};
static int arizona_micsupp_of_get_pdata(struct arizona_micsupp_pdata *pdata,
struct regulator_config *config,
const struct regulator_desc *desc)
......@@ -316,6 +341,24 @@ static int arizona_micsupp_probe(struct platform_device *pdev)
&arizona->pdata.micvdd);
}
static int madera_micsupp_probe(struct platform_device *pdev)
{
struct madera *madera = dev_get_drvdata(pdev->dev.parent);
struct arizona_micsupp *micsupp;
micsupp = devm_kzalloc(&pdev->dev, sizeof(*micsupp), GFP_KERNEL);
if (!micsupp)
return -ENOMEM;
micsupp->regmap = madera->regmap;
micsupp->dapm = &madera->dapm;
micsupp->dev = madera->dev;
micsupp->init_data = arizona_micsupp_ext_default;
return arizona_micsupp_common_init(pdev, micsupp, &madera_micsupp,
&madera->pdata.micvdd);
}
static struct platform_driver arizona_micsupp_driver = {
.probe = arizona_micsupp_probe,
.driver = {
......@@ -323,10 +366,35 @@ static struct platform_driver arizona_micsupp_driver = {
},
};
module_platform_driver(arizona_micsupp_driver);
static struct platform_driver madera_micsupp_driver = {
.probe = madera_micsupp_probe,
.driver = {
.name = "madera-micsupp",
},
};
static struct platform_driver * const arizona_micsupp_drivers[] = {
&arizona_micsupp_driver,
&madera_micsupp_driver,
};
static int __init arizona_micsupp_init(void)
{
return platform_register_drivers(arizona_micsupp_drivers,
ARRAY_SIZE(arizona_micsupp_drivers));
}
module_init(arizona_micsupp_init);
static void __exit arizona_micsupp_exit(void)
{
platform_unregister_drivers(arizona_micsupp_drivers,
ARRAY_SIZE(arizona_micsupp_drivers));
}
module_exit(arizona_micsupp_exit);
/* Module information */
MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
MODULE_DESCRIPTION("Arizona microphone supply driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:arizona-micsupp");
MODULE_ALIAS("platform:madera-micsupp");
......@@ -4,7 +4,6 @@
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mfd/rohm-bd70528.h>
......
......@@ -4,7 +4,6 @@
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mfd/rohm-bd718x7.h>
......
This diff is collapsed.
......@@ -90,7 +90,7 @@
#define CPCAP_REG_OFF_MODE_SEC BIT(15)
/**
* SoC specific configuraion for CPCAP regulator. There are at least three
* SoC specific configuration for CPCAP regulator. There are at least three
* different SoCs each with their own parameters: omap3, omap4 and tegra2.
*
* The assign_reg and assign_mask seem to allow toggling between primary
......
......@@ -493,12 +493,13 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = {
.desc.ops = &da9062_ldo_ops,
.desc.min_uV = (900) * 1000,
.desc.uV_step = (50) * 1000,
.desc.n_voltages = ((3600) - (900))/(50) + 1,
.desc.n_voltages = ((3600) - (900))/(50) + 1
+ DA9062AA_VLDO_A_MIN_SEL,
.desc.enable_reg = DA9062AA_LDO1_CONT,
.desc.enable_mask = DA9062AA_LDO1_EN_MASK,
.desc.vsel_reg = DA9062AA_VLDO1_A,
.desc.vsel_mask = DA9062AA_VLDO1_A_MASK,
.desc.linear_min_sel = 0,
.desc.linear_min_sel = DA9062AA_VLDO_A_MIN_SEL,
.sleep = REG_FIELD(DA9062AA_VLDO1_A,
__builtin_ffs((int)DA9062AA_LDO1_SL_A_MASK) - 1,
sizeof(unsigned int) * 8 -
......@@ -525,12 +526,13 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = {
.desc.ops = &da9062_ldo_ops,
.desc.min_uV = (900) * 1000,
.desc.uV_step = (50) * 1000,
.desc.n_voltages = ((3600) - (600))/(50) + 1,
.desc.n_voltages = ((3600) - (900))/(50) + 1
+ DA9062AA_VLDO_A_MIN_SEL,
.desc.enable_reg = DA9062AA_LDO2_CONT,
.desc.enable_mask = DA9062AA_LDO2_EN_MASK,
.desc.vsel_reg = DA9062AA_VLDO2_A,
.desc.vsel_mask = DA9062AA_VLDO2_A_MASK,
.desc.linear_min_sel = 0,
.desc.linear_min_sel = DA9062AA_VLDO_A_MIN_SEL,
.sleep = REG_FIELD(DA9062AA_VLDO2_A,
__builtin_ffs((int)DA9062AA_LDO2_SL_A_MASK) - 1,
sizeof(unsigned int) * 8 -
......@@ -557,12 +559,13 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = {
.desc.ops = &da9062_ldo_ops,
.desc.min_uV = (900) * 1000,
.desc.uV_step = (50) * 1000,
.desc.n_voltages = ((3600) - (900))/(50) + 1,
.desc.n_voltages = ((3600) - (900))/(50) + 1
+ DA9062AA_VLDO_A_MIN_SEL,
.desc.enable_reg = DA9062AA_LDO3_CONT,
.desc.enable_mask = DA9062AA_LDO3_EN_MASK,
.desc.vsel_reg = DA9062AA_VLDO3_A,
.desc.vsel_mask = DA9062AA_VLDO3_A_MASK,
.desc.linear_min_sel = 0,
.desc.linear_min_sel = DA9062AA_VLDO_A_MIN_SEL,
.sleep = REG_FIELD(DA9062AA_VLDO3_A,
__builtin_ffs((int)DA9062AA_LDO3_SL_A_MASK) - 1,
sizeof(unsigned int) * 8 -
......@@ -589,12 +592,13 @@ static const struct da9062_regulator_info local_da9061_regulator_info[] = {
.desc.ops = &da9062_ldo_ops,
.desc.min_uV = (900) * 1000,
.desc.uV_step = (50) * 1000,
.desc.n_voltages = ((3600) - (900))/(50) + 1,
.desc.n_voltages = ((3600) - (900))/(50) + 1
+ DA9062AA_VLDO_A_MIN_SEL,
.desc.enable_reg = DA9062AA_LDO4_CONT,
.desc.enable_mask = DA9062AA_LDO4_EN_MASK,
.desc.vsel_reg = DA9062AA_VLDO4_A,
.desc.vsel_mask = DA9062AA_VLDO4_A_MASK,
.desc.linear_min_sel = 0,
.desc.linear_min_sel = DA9062AA_VLDO_A_MIN_SEL,
.sleep = REG_FIELD(DA9062AA_VLDO4_A,
__builtin_ffs((int)DA9062AA_LDO4_SL_A_MASK) - 1,
sizeof(unsigned int) * 8 -
......@@ -769,12 +773,13 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = {
.desc.ops = &da9062_ldo_ops,
.desc.min_uV = (900) * 1000,
.desc.uV_step = (50) * 1000,
.desc.n_voltages = ((3600) - (900))/(50) + 1,
.desc.n_voltages = ((3600) - (900))/(50) + 1
+ DA9062AA_VLDO_A_MIN_SEL,
.desc.enable_reg = DA9062AA_LDO1_CONT,
.desc.enable_mask = DA9062AA_LDO1_EN_MASK,
.desc.vsel_reg = DA9062AA_VLDO1_A,
.desc.vsel_mask = DA9062AA_VLDO1_A_MASK,
.desc.linear_min_sel = 0,
.desc.linear_min_sel = DA9062AA_VLDO_A_MIN_SEL,
.sleep = REG_FIELD(DA9062AA_VLDO1_A,
__builtin_ffs((int)DA9062AA_LDO1_SL_A_MASK) - 1,
sizeof(unsigned int) * 8 -
......@@ -801,12 +806,13 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = {
.desc.ops = &da9062_ldo_ops,
.desc.min_uV = (900) * 1000,
.desc.uV_step = (50) * 1000,
.desc.n_voltages = ((3600) - (600))/(50) + 1,
.desc.n_voltages = ((3600) - (900))/(50) + 1
+ DA9062AA_VLDO_A_MIN_SEL,
.desc.enable_reg = DA9062AA_LDO2_CONT,
.desc.enable_mask = DA9062AA_LDO2_EN_MASK,
.desc.vsel_reg = DA9062AA_VLDO2_A,
.desc.vsel_mask = DA9062AA_VLDO2_A_MASK,
.desc.linear_min_sel = 0,
.desc.linear_min_sel = DA9062AA_VLDO_A_MIN_SEL,
.sleep = REG_FIELD(DA9062AA_VLDO2_A,
__builtin_ffs((int)DA9062AA_LDO2_SL_A_MASK) - 1,
sizeof(unsigned int) * 8 -
......@@ -833,12 +839,13 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = {
.desc.ops = &da9062_ldo_ops,
.desc.min_uV = (900) * 1000,
.desc.uV_step = (50) * 1000,
.desc.n_voltages = ((3600) - (900))/(50) + 1,
.desc.n_voltages = ((3600) - (900))/(50) + 1
+ DA9062AA_VLDO_A_MIN_SEL,
.desc.enable_reg = DA9062AA_LDO3_CONT,
.desc.enable_mask = DA9062AA_LDO3_EN_MASK,
.desc.vsel_reg = DA9062AA_VLDO3_A,
.desc.vsel_mask = DA9062AA_VLDO3_A_MASK,
.desc.linear_min_sel = 0,
.desc.linear_min_sel = DA9062AA_VLDO_A_MIN_SEL,
.sleep = REG_FIELD(DA9062AA_VLDO3_A,
__builtin_ffs((int)DA9062AA_LDO3_SL_A_MASK) - 1,
sizeof(unsigned int) * 8 -
......@@ -865,12 +872,13 @@ static const struct da9062_regulator_info local_da9062_regulator_info[] = {
.desc.ops = &da9062_ldo_ops,
.desc.min_uV = (900) * 1000,
.desc.uV_step = (50) * 1000,
.desc.n_voltages = ((3600) - (900))/(50) + 1,
.desc.n_voltages = ((3600) - (900))/(50) + 1
+ DA9062AA_VLDO_A_MIN_SEL,
.desc.enable_reg = DA9062AA_LDO4_CONT,
.desc.enable_mask = DA9062AA_LDO4_EN_MASK,
.desc.vsel_reg = DA9062AA_VLDO4_A,
.desc.vsel_mask = DA9062AA_VLDO4_A_MASK,
.desc.linear_min_sel = 0,
.desc.linear_min_sel = DA9062AA_VLDO_A_MIN_SEL,
.sleep = REG_FIELD(DA9062AA_VLDO4_A,
__builtin_ffs((int)DA9062AA_LDO4_SL_A_MASK) - 1,
sizeof(unsigned int) * 8 -
......
......@@ -19,7 +19,6 @@
#include <linux/regulator/machine.h>
#include <linux/regulator/of_regulator.h>
#include <linux/mfd/da9063/core.h>
#include <linux/mfd/da9063/pdata.h>
#include <linux/mfd/da9063/registers.h>
......@@ -28,6 +27,49 @@
REG_FIELD(_reg, __builtin_ffs((int)_mask) - 1, \
sizeof(unsigned int) * 8 - __builtin_clz((_mask)) - 1)
/* DA9063 and DA9063L regulator IDs */
enum {
/* BUCKs */
DA9063_ID_BCORE1,
DA9063_ID_BCORE2,
DA9063_ID_BPRO,
DA9063_ID_BMEM,
DA9063_ID_BIO,
DA9063_ID_BPERI,
/* BCORE1 and BCORE2 in merged mode */
DA9063_ID_BCORES_MERGED,
/* BMEM and BIO in merged mode */
DA9063_ID_BMEM_BIO_MERGED,
/* When two BUCKs are merged, they cannot be reused separately */
/* LDOs on both DA9063 and DA9063L */
DA9063_ID_LDO3,
DA9063_ID_LDO7,
DA9063_ID_LDO8,
DA9063_ID_LDO9,
DA9063_ID_LDO11,
/* DA9063-only LDOs */
DA9063_ID_LDO1,
DA9063_ID_LDO2,
DA9063_ID_LDO4,
DA9063_ID_LDO5,
DA9063_ID_LDO6,
DA9063_ID_LDO10,
};
/* Old regulator platform data */
struct da9063_regulator_data {
int id;
struct regulator_init_data *initdata;
};
struct da9063_regulators_pdata {
unsigned n_regulators;
struct da9063_regulator_data *regulator_data;
};
/* Regulator capabilities and registers description */
struct da9063_regulator_info {
struct regulator_desc desc;
......@@ -592,7 +634,6 @@ static const struct regulator_init_data *da9063_get_regulator_initdata(
return NULL;
}
#ifdef CONFIG_OF
static struct of_regulator_match da9063_matches[] = {
[DA9063_ID_BCORE1] = { .name = "bcore1" },
[DA9063_ID_BCORE2] = { .name = "bcore2" },
......@@ -670,20 +711,10 @@ static struct da9063_regulators_pdata *da9063_parse_regulators_dt(
*da9063_reg_matches = da9063_matches;
return pdata;
}
#else
static struct da9063_regulators_pdata *da9063_parse_regulators_dt(
struct platform_device *pdev,
struct of_regulator_match **da9063_reg_matches)
{
*da9063_reg_matches = NULL;
return ERR_PTR(-ENODEV);
}
#endif
static int da9063_regulator_probe(struct platform_device *pdev)
{
struct da9063 *da9063 = dev_get_drvdata(pdev->dev.parent);
struct da9063_pdata *da9063_pdata = dev_get_platdata(da9063->dev);
struct of_regulator_match *da9063_reg_matches = NULL;
struct da9063_regulators_pdata *regl_pdata;
const struct da9063_dev_model *model;
......@@ -693,11 +724,7 @@ static int da9063_regulator_probe(struct platform_device *pdev)
bool bcores_merged, bmem_bio_merged;
int id, irq, n, n_regulators, ret, val;
regl_pdata = da9063_pdata ? da9063_pdata->regulators_pdata : NULL;
if (!regl_pdata)
regl_pdata = da9063_parse_regulators_dt(pdev,
&da9063_reg_matches);
regl_pdata = da9063_parse_regulators_dt(pdev, &da9063_reg_matches);
if (IS_ERR(regl_pdata) || regl_pdata->n_regulators == 0) {
dev_err(&pdev->dev,
......
......@@ -289,6 +289,8 @@ static struct da9211_pdata *da9211_parse_regulators_dt(
0,
GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
"da9211-enable");
if (IS_ERR(pdata->gpiod_ren[n]))
pdata->gpiod_ren[n] = NULL;
n++;
}
......
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* helpers.c -- Voltage/Current Regulator framework helper functions.
*
* Copyright 2007, 2008 Wolfson Microelectronics PLC.
* Copyright 2008 SlimLogic Ltd.
*/
//
// helpers.c -- Voltage/Current Regulator framework helper functions.
//
// Copyright 2007, 2008 Wolfson Microelectronics PLC.
// Copyright 2008 SlimLogic Ltd.
#include <linux/kernel.h>
#include <linux/err.h>
......
......@@ -467,7 +467,7 @@ static int max77620_regulator_is_enabled(struct regulator_dev *rdev)
{
struct max77620_regulator *pmic = rdev_get_drvdata(rdev);
int id = rdev_get_id(rdev);
int ret = 1;
int ret;
if (pmic->active_fps_src[id] != MAX77620_FPS_SRC_NONE)
return 1;
......@@ -758,6 +758,24 @@ static struct max77620_regulator_info max20024_regs_info[MAX77620_NUM_REGS] = {
RAIL_LDO(LDO8, ldo8, "in-ldo7-8", N, 800000, 3950000, 50000),
};
static struct max77620_regulator_info max77663_regs_info[MAX77620_NUM_REGS] = {
RAIL_SD(SD0, sd0, "in-sd0", SD0, 600000, 3387500, 12500, 0xFF, NONE),
RAIL_SD(SD1, sd1, "in-sd1", SD1, 800000, 1587500, 12500, 0xFF, NONE),
RAIL_SD(SD2, sd2, "in-sd2", SDX, 600000, 3787500, 12500, 0xFF, NONE),
RAIL_SD(SD3, sd3, "in-sd3", SDX, 600000, 3787500, 12500, 0xFF, NONE),
RAIL_SD(SD4, sd4, "in-sd4", SDX, 600000, 3787500, 12500, 0xFF, NONE),
RAIL_LDO(LDO0, ldo0, "in-ldo0-1", N, 800000, 2375000, 25000),
RAIL_LDO(LDO1, ldo1, "in-ldo0-1", N, 800000, 2375000, 25000),
RAIL_LDO(LDO2, ldo2, "in-ldo2", P, 800000, 3950000, 50000),
RAIL_LDO(LDO3, ldo3, "in-ldo3-5", P, 800000, 3950000, 50000),
RAIL_LDO(LDO4, ldo4, "in-ldo4-6", P, 800000, 1587500, 12500),
RAIL_LDO(LDO5, ldo5, "in-ldo3-5", P, 800000, 3950000, 50000),
RAIL_LDO(LDO6, ldo6, "in-ldo4-6", P, 800000, 3950000, 50000),
RAIL_LDO(LDO7, ldo7, "in-ldo7-8", N, 800000, 3950000, 50000),
RAIL_LDO(LDO8, ldo8, "in-ldo7-8", N, 800000, 3950000, 50000),
};
static int max77620_regulator_probe(struct platform_device *pdev)
{
struct max77620_chip *max77620_chip = dev_get_drvdata(pdev->dev.parent);
......@@ -782,9 +800,14 @@ static int max77620_regulator_probe(struct platform_device *pdev)
case MAX77620:
rinfo = max77620_regs_info;
break;
default:
case MAX20024:
rinfo = max20024_regs_info;
break;
case MAX77663:
rinfo = max77663_regs_info;
break;
default:
return -EINVAL;
}
config.regmap = pmic->rmap;
......@@ -878,6 +901,7 @@ static const struct dev_pm_ops max77620_regulator_pm_ops = {
static const struct platform_device_id max77620_regulator_devtype[] = {
{ .name = "max77620-pmic", },
{ .name = "max20024-pmic", },
{ .name = "max77663-pmic", },
{},
};
MODULE_DEVICE_TABLE(platform, max77620_regulator_devtype);
......
......@@ -20,6 +20,8 @@
#define MAX77650_REGULATOR_V_LDO_MASK GENMASK(6, 0)
#define MAX77650_REGULATOR_V_SBB_MASK GENMASK(5, 0)
#define MAX77651_REGULATOR_V_SBB1_MASK GENMASK(5, 2)
#define MAX77651_REGULATOR_V_SBB1_RANGE_MASK GENMASK(1, 0)
#define MAX77650_REGULATOR_AD_MASK BIT(3)
#define MAX77650_REGULATOR_AD_DISABLED 0x00
......@@ -41,43 +43,22 @@ struct max77650_regulator_desc {
unsigned int regB;
};
static const unsigned int max77651_sbb1_regulator_volt_table[] = {
2400000, 3200000, 4000000, 4800000,
2450000, 3250000, 4050000, 4850000,
2500000, 3300000, 4100000, 4900000,
2550000, 3350000, 4150000, 4950000,
2600000, 3400000, 4200000, 5000000,
2650000, 3450000, 4250000, 5050000,
2700000, 3500000, 4300000, 5100000,
2750000, 3550000, 4350000, 5150000,
2800000, 3600000, 4400000, 5200000,
2850000, 3650000, 4450000, 5250000,
2900000, 3700000, 4500000, 0,
2950000, 3750000, 4550000, 0,
3000000, 3800000, 4600000, 0,
3050000, 3850000, 4650000, 0,
3100000, 3900000, 4700000, 0,
3150000, 3950000, 4750000, 0,
static struct max77650_regulator_desc max77651_SBB1_desc;
static const unsigned int max77651_sbb1_volt_range_sel[] = {
0x0, 0x1, 0x2, 0x3
};
#define MAX77651_REGULATOR_SBB1_SEL_DEC(_val) \
(((_val & 0x3c) >> 2) | ((_val & 0x03) << 4))
#define MAX77651_REGULATOR_SBB1_SEL_ENC(_val) \
(((_val & 0x30) >> 4) | ((_val & 0x0f) << 2))
#define MAX77650_REGULATOR_SBB1_SEL_DECR(_val) \
do { \
_val = MAX77651_REGULATOR_SBB1_SEL_DEC(_val); \
_val--; \
_val = MAX77651_REGULATOR_SBB1_SEL_ENC(_val); \
} while (0)
#define MAX77650_REGULATOR_SBB1_SEL_INCR(_val) \
do { \
_val = MAX77651_REGULATOR_SBB1_SEL_DEC(_val); \
_val++; \
_val = MAX77651_REGULATOR_SBB1_SEL_ENC(_val); \
} while (0)
static const struct regulator_linear_range max77651_sbb1_volt_ranges[] = {
/* range index 0 */
REGULATOR_LINEAR_RANGE(2400000, 0x00, 0x0f, 50000),
/* range index 1 */
REGULATOR_LINEAR_RANGE(3200000, 0x00, 0x0f, 50000),
/* range index 2 */
REGULATOR_LINEAR_RANGE(4000000, 0x00, 0x0f, 50000),
/* range index 3 */
REGULATOR_LINEAR_RANGE(4800000, 0x00, 0x09, 50000),
};
static const unsigned int max77650_current_limit_table[] = {
1000000, 866000, 707000, 500000,
......@@ -127,96 +108,6 @@ static int max77650_regulator_disable(struct regulator_dev *rdev)
MAX77650_REGULATOR_DISABLED);
}
static int max77650_regulator_set_voltage_sel(struct regulator_dev *rdev,
unsigned int sel)
{
int rv = 0, curr, diff;
bool ascending;
/*
* If the regulator is disabled, we can program the desired
* voltage right away.
*/
if (!max77650_regulator_is_enabled(rdev))
return regulator_set_voltage_sel_regmap(rdev, sel);
/*
* Otherwise we need to manually ramp the output voltage up/down
* one step at a time.
*/
curr = regulator_get_voltage_sel_regmap(rdev);
if (curr < 0)
return curr;
diff = curr - sel;
if (diff == 0)
return 0; /* Already there. */
else if (diff > 0)
ascending = false;
else
ascending = true;
/*
* Make sure we'll get to the right voltage and break the loop even if
* the selector equals 0.
*/
for (ascending ? curr++ : curr--;; ascending ? curr++ : curr--) {
rv = regulator_set_voltage_sel_regmap(rdev, curr);
if (rv)
return rv;
if (curr == sel)
break;
}
return 0;
}
/*
* Special case: non-linear voltage table for max77651 SBB1 - software
* must ensure the voltage is ramped in 50mV increments.
*/
static int max77651_regulator_sbb1_set_voltage_sel(struct regulator_dev *rdev,
unsigned int sel)
{
int rv = 0, curr, vcurr, vdest, vdiff;
/*
* If the regulator is disabled, we can program the desired
* voltage right away.
*/
if (!max77650_regulator_is_enabled(rdev))
return regulator_set_voltage_sel_regmap(rdev, sel);
curr = regulator_get_voltage_sel_regmap(rdev);
if (curr < 0)
return curr;
if (curr == sel)
return 0; /* Already there. */
vcurr = max77651_sbb1_regulator_volt_table[curr];
vdest = max77651_sbb1_regulator_volt_table[sel];
vdiff = vcurr - vdest;
for (;;) {
if (vdiff > 0)
MAX77650_REGULATOR_SBB1_SEL_DECR(curr);
else
MAX77650_REGULATOR_SBB1_SEL_INCR(curr);
rv = regulator_set_voltage_sel_regmap(rdev, curr);
if (rv)
return rv;
if (curr == sel)
break;
};
return 0;
}
static const struct regulator_ops max77650_regulator_LDO_ops = {
.is_enabled = max77650_regulator_is_enabled,
.enable = max77650_regulator_enable,
......@@ -224,7 +115,7 @@ static const struct regulator_ops max77650_regulator_LDO_ops = {
.list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_sel = max77650_regulator_set_voltage_sel,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.set_active_discharge = regulator_set_active_discharge_regmap,
};
......@@ -235,20 +126,20 @@ static const struct regulator_ops max77650_regulator_SBB_ops = {
.list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_sel = max77650_regulator_set_voltage_sel,
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_current_limit = regulator_get_current_limit_regmap,
.set_current_limit = regulator_set_current_limit_regmap,
.set_active_discharge = regulator_set_active_discharge_regmap,
};
/* Special case for max77651 SBB1 - non-linear voltage mapping. */
/* Special case for max77651 SBB1 - pickable linear-range voltage mapping. */
static const struct regulator_ops max77651_SBB1_regulator_ops = {
.is_enabled = max77650_regulator_is_enabled,
.enable = max77650_regulator_enable,
.disable = max77650_regulator_disable,
.list_voltage = regulator_list_voltage_table,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
.set_voltage_sel = max77651_regulator_sbb1_set_voltage_sel,
.list_voltage = regulator_list_voltage_pickable_linear_range,
.get_voltage_sel = regulator_get_voltage_sel_pickable_regmap,
.set_voltage_sel = regulator_set_voltage_sel_pickable_regmap,
.get_current_limit = regulator_get_current_limit_regmap,
.set_current_limit = regulator_set_current_limit_regmap,
.set_active_discharge = regulator_set_active_discharge_regmap,
......@@ -265,6 +156,7 @@ static struct max77650_regulator_desc max77650_LDO_desc = {
.min_uV = 1350000,
.uV_step = 12500,
.n_voltages = 128,
.vsel_step = 1,
.vsel_mask = MAX77650_REGULATOR_V_LDO_MASK,
.vsel_reg = MAX77650_REG_CNFG_LDO_A,
.active_discharge_off = MAX77650_REGULATOR_AD_DISABLED,
......@@ -290,6 +182,7 @@ static struct max77650_regulator_desc max77650_SBB0_desc = {
.min_uV = 800000,
.uV_step = 25000,
.n_voltages = 64,
.vsel_step = 1,
.vsel_mask = MAX77650_REGULATOR_V_SBB_MASK,
.vsel_reg = MAX77650_REG_CNFG_SBB0_A,
.active_discharge_off = MAX77650_REGULATOR_AD_DISABLED,
......@@ -319,6 +212,7 @@ static struct max77650_regulator_desc max77650_SBB1_desc = {
.min_uV = 800000,
.uV_step = 12500,
.n_voltages = 64,
.vsel_step = 1,
.vsel_mask = MAX77650_REGULATOR_V_SBB_MASK,
.vsel_reg = MAX77650_REG_CNFG_SBB1_A,
.active_discharge_off = MAX77650_REGULATOR_AD_DISABLED,
......@@ -345,9 +239,14 @@ static struct max77650_regulator_desc max77651_SBB1_desc = {
.supply_name = "in-sbb1",
.id = MAX77650_REGULATOR_ID_SBB1,
.ops = &max77651_SBB1_regulator_ops,
.volt_table = max77651_sbb1_regulator_volt_table,
.n_voltages = ARRAY_SIZE(max77651_sbb1_regulator_volt_table),
.vsel_mask = MAX77650_REGULATOR_V_SBB_MASK,
.linear_range_selectors = max77651_sbb1_volt_range_sel,
.linear_ranges = max77651_sbb1_volt_ranges,
.n_linear_ranges = ARRAY_SIZE(max77651_sbb1_volt_ranges),
.n_voltages = 58,
.vsel_step = 1,
.vsel_range_mask = MAX77651_REGULATOR_V_SBB1_RANGE_MASK,
.vsel_range_reg = MAX77650_REG_CNFG_SBB1_A,
.vsel_mask = MAX77651_REGULATOR_V_SBB1_MASK,
.vsel_reg = MAX77650_REG_CNFG_SBB1_A,
.active_discharge_off = MAX77650_REGULATOR_AD_DISABLED,
.active_discharge_on = MAX77650_REGULATOR_AD_ENABLED,
......@@ -376,6 +275,7 @@ static struct max77650_regulator_desc max77650_SBB2_desc = {
.min_uV = 800000,
.uV_step = 50000,
.n_voltages = 64,
.vsel_step = 1,
.vsel_mask = MAX77650_REGULATOR_V_SBB_MASK,
.vsel_reg = MAX77650_REG_CNFG_SBB2_A,
.active_discharge_off = MAX77650_REGULATOR_AD_DISABLED,
......@@ -405,6 +305,7 @@ static struct max77650_regulator_desc max77651_SBB2_desc = {
.min_uV = 2400000,
.uV_step = 50000,
.n_voltages = 64,
.vsel_step = 1,
.vsel_mask = MAX77650_REGULATOR_V_SBB_MASK,
.vsel_reg = MAX77650_REG_CNFG_SBB2_A,
.active_discharge_off = MAX77650_REGULATOR_AD_DISABLED,
......@@ -496,3 +397,4 @@ module_platform_driver(max77650_regulator_driver);
MODULE_DESCRIPTION("MAXIM 77650/77651 regulator driver");
MODULE_AUTHOR("Bartosz Golaszewski <bgolaszewski@baylibre.com>");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:max77650-regulator");
......@@ -14,9 +14,7 @@
#include <linux/kernel.h>
#include <linux/bug.h>
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/slab.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
......
......@@ -13,11 +13,9 @@
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/max8952.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/io.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/regulator/of_regulator.h>
#include <linux/slab.h>
......@@ -37,7 +35,8 @@ enum {
struct max8952_data {
struct i2c_client *client;
struct max8952_platform_data *pdata;
struct gpio_desc *vid0_gpiod;
struct gpio_desc *vid1_gpiod;
bool vid0;
bool vid1;
};
......@@ -87,16 +86,15 @@ static int max8952_set_voltage_sel(struct regulator_dev *rdev,
{
struct max8952_data *max8952 = rdev_get_drvdata(rdev);
if (!gpio_is_valid(max8952->pdata->gpio_vid0) ||
!gpio_is_valid(max8952->pdata->gpio_vid1)) {
if (!max8952->vid0_gpiod || !max8952->vid1_gpiod) {
/* DVS not supported */
return -EPERM;
}
max8952->vid0 = selector & 0x1;
max8952->vid1 = (selector >> 1) & 0x1;
gpio_set_value(max8952->pdata->gpio_vid0, max8952->vid0);
gpio_set_value(max8952->pdata->gpio_vid1, max8952->vid1);
gpiod_set_value(max8952->vid0_gpiod, max8952->vid0);
gpiod_set_value(max8952->vid1_gpiod, max8952->vid1);
return 0;
}
......@@ -134,9 +132,6 @@ static struct max8952_platform_data *max8952_parse_dt(struct device *dev)
if (!pd)
return NULL;
pd->gpio_vid0 = of_get_named_gpio(np, "max8952,vid-gpios", 0);
pd->gpio_vid1 = of_get_named_gpio(np, "max8952,vid-gpios", 1);
if (of_property_read_u32(np, "max8952,default-mode", &pd->default_mode))
dev_warn(dev, "Default mode not specified, assuming 0\n");
......@@ -179,7 +174,7 @@ static struct max8952_platform_data *max8952_parse_dt(struct device *dev)
static int max8952_pmic_probe(struct i2c_client *client,
const struct i2c_device_id *i2c_id)
{
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
struct i2c_adapter *adapter = client->adapter;
struct max8952_platform_data *pdata = dev_get_platdata(&client->dev);
struct regulator_config config = { };
struct max8952_data *max8952;
......@@ -187,7 +182,7 @@ static int max8952_pmic_probe(struct i2c_client *client,
struct gpio_desc *gpiod;
enum gpiod_flags gflags;
int ret = 0, err = 0;
int ret = 0;
if (client->dev.of_node)
pdata = max8952_parse_dt(&client->dev);
......@@ -240,32 +235,31 @@ static int max8952_pmic_probe(struct i2c_client *client,
max8952->vid0 = pdata->default_mode & 0x1;
max8952->vid1 = (pdata->default_mode >> 1) & 0x1;
if (gpio_is_valid(pdata->gpio_vid0) &&
gpio_is_valid(pdata->gpio_vid1)) {
unsigned long gpio_flags;
gpio_flags = max8952->vid0 ?
GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW;
if (devm_gpio_request_one(&client->dev, pdata->gpio_vid0,
gpio_flags, "MAX8952 VID0"))
err = 1;
gpio_flags = max8952->vid1 ?
GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW;
if (devm_gpio_request_one(&client->dev, pdata->gpio_vid1,
gpio_flags, "MAX8952 VID1"))
err = 2;
} else
err = 3;
if (err) {
/* Fetch vid0 and vid1 GPIOs if available */
gflags = max8952->vid0 ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
max8952->vid0_gpiod = devm_gpiod_get_index_optional(&client->dev,
"max8952,vid",
0, gflags);
if (IS_ERR(max8952->vid0_gpiod))
return PTR_ERR(max8952->vid0_gpiod);
gflags = max8952->vid1 ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW;
max8952->vid1_gpiod = devm_gpiod_get_index_optional(&client->dev,
"max8952,vid",
1, gflags);
if (IS_ERR(max8952->vid1_gpiod))
return PTR_ERR(max8952->vid1_gpiod);
/* If either VID GPIO is missing just disable this */
if (!max8952->vid0_gpiod || !max8952->vid1_gpiod) {
dev_warn(&client->dev, "VID0/1 gpio invalid: "
"DVS not available.\n");
"DVS not available.\n");
max8952->vid0 = 0;
max8952->vid1 = 0;
/* Mark invalid */
pdata->gpio_vid0 = -1;
pdata->gpio_vid1 = -1;
/* Make sure if we have any descriptors they get set to low */
if (max8952->vid0_gpiod)
gpiod_set_value(max8952->vid0_gpiod, 0);
if (max8952->vid1_gpiod)
gpiod_set_value(max8952->vid1_gpiod, 0);
/* Disable Pulldown of EN only */
max8952_write_reg(max8952, MAX8952_REG_CONTROL, 0x60);
......
......@@ -21,7 +21,8 @@ static const char *const regulator_states[PM_SUSPEND_MAX + 1] = {
[PM_SUSPEND_MAX] = "regulator-state-disk",
};
static void of_get_regulation_constraints(struct device_node *np,
static int of_get_regulation_constraints(struct device *dev,
struct device_node *np,
struct regulator_init_data **init_data,
const struct regulator_desc *desc)
{
......@@ -30,8 +31,13 @@ static void of_get_regulation_constraints(struct device_node *np,
struct device_node *suspend_np;
unsigned int mode;
int ret, i, len;
int n_phandles;
u32 pval;
n_phandles = of_count_phandle_with_args(np, "regulator-coupled-with",
NULL);
n_phandles = max(n_phandles, 0);
constraints->name = of_get_property(np, "regulator-name", NULL);
if (!of_property_read_u32(np, "regulator-min-microvolt", &pval))
......@@ -163,9 +169,17 @@ static void of_get_regulation_constraints(struct device_node *np,
if (!of_property_read_u32(np, "regulator-system-load", &pval))
constraints->system_load = pval;
if (!of_property_read_u32(np, "regulator-coupled-max-spread",
&pval))
constraints->max_spread = pval;
if (n_phandles) {
constraints->max_spread = devm_kzalloc(dev,
sizeof(*constraints->max_spread) * n_phandles,
GFP_KERNEL);
if (!constraints->max_spread)
return -ENOMEM;
of_property_read_u32_array(np, "regulator-coupled-max-spread",
constraints->max_spread, n_phandles);
}
if (!of_property_read_u32(np, "regulator-max-step-microvolt",
&pval))
......@@ -242,6 +256,8 @@ static void of_get_regulation_constraints(struct device_node *np,
suspend_state = NULL;
suspend_np = NULL;
}
return 0;
}
/**
......@@ -267,7 +283,9 @@ struct regulator_init_data *of_get_regulator_init_data(struct device *dev,
if (!init_data)
return NULL; /* Out of memory? */
of_get_regulation_constraints(node, &init_data, desc);
if (of_get_regulation_constraints(dev, node, &init_data, desc))
return NULL;
return init_data;
}
EXPORT_SYMBOL_GPL(of_get_regulator_init_data);
......@@ -473,7 +491,8 @@ int of_get_n_coupled(struct regulator_dev *rdev)
/* Looks for "to_find" device_node in src's "regulator-coupled-with" property */
static bool of_coupling_find_node(struct device_node *src,
struct device_node *to_find)
struct device_node *to_find,
int *index)
{
int n_phandles, i;
bool found = false;
......@@ -495,8 +514,10 @@ static bool of_coupling_find_node(struct device_node *src,
of_node_put(tmp);
if (found)
if (found) {
*index = i;
break;
}
}
return found;
......@@ -517,22 +538,23 @@ static bool of_coupling_find_node(struct device_node *src,
*/
bool of_check_coupling_data(struct regulator_dev *rdev)
{
int max_spread = rdev->constraints->max_spread;
struct device_node *node = rdev->dev.of_node;
int n_phandles = of_get_n_coupled(rdev);
struct device_node *c_node;
int index;
int i;
bool ret = true;
if (max_spread <= 0) {
dev_err(&rdev->dev, "max_spread value invalid\n");
return false;
}
/* iterate over rdev's phandles */
for (i = 0; i < n_phandles; i++) {
int max_spread = rdev->constraints->max_spread[i];
int c_max_spread, c_n_phandles;
if (max_spread <= 0) {
dev_err(&rdev->dev, "max_spread value invalid\n");
return false;
}
c_node = of_parse_phandle(node,
"regulator-coupled-with", i);
......@@ -549,22 +571,23 @@ bool of_check_coupling_data(struct regulator_dev *rdev)
goto clean;
}
if (of_property_read_u32(c_node, "regulator-coupled-max-spread",
&c_max_spread)) {
if (!of_coupling_find_node(c_node, node, &index)) {
dev_err(&rdev->dev, "missing 2-way linking for coupled regulators\n");
ret = false;
goto clean;
}
if (c_max_spread != max_spread) {
dev_err(&rdev->dev,
"coupled regulators max_spread mismatch\n");
if (of_property_read_u32_index(c_node, "regulator-coupled-max-spread",
index, &c_max_spread)) {
ret = false;
goto clean;
}
if (!of_coupling_find_node(c_node, node)) {
dev_err(&rdev->dev, "missing 2-way linking for coupled regulators\n");
if (c_max_spread != max_spread) {
dev_err(&rdev->dev,
"coupled regulators max_spread mismatch\n");
ret = false;
goto clean;
}
clean:
......
This diff is collapsed.
This diff is collapsed.
......@@ -574,7 +574,9 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
0,
GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
"s5m8767");
if (IS_ERR(rdata->ext_control_gpiod))
if (PTR_ERR(rdata->ext_control_gpiod) == -ENOENT)
rdata->ext_control_gpiod = NULL;
else if (IS_ERR(rdata->ext_control_gpiod))
return PTR_ERR(rdata->ext_control_gpiod);
rdata->id = i;
......
This diff is collapsed.
This diff is collapsed.
// SPDX-License-Identifier: GPL-2.0
// Copyright (C) STMicroelectronics 2019
// Author(s): Fabrice Gasnier <fabrice.gasnier@st.com>.
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/of_regulator.h>
/* STM32H7 SYSCFG register */
#define STM32H7_SYSCFG_PMCR 0x04
#define STM32H7_SYSCFG_BOOSTE_MASK BIT(8)
/* STM32MP1 SYSCFG has set and clear registers */
#define STM32MP1_SYSCFG_PMCSETR 0x04
#define STM32MP1_SYSCFG_PMCCLRR 0x44
#define STM32MP1_SYSCFG_EN_BOOSTER_MASK BIT(8)
static const struct regulator_ops stm32h7_booster_ops = {
.list_voltage = regulator_list_voltage_linear,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
};
static const struct regulator_desc stm32h7_booster_desc = {
.name = "booster",
.supply_name = "vdda",
.n_voltages = 1,
.type = REGULATOR_VOLTAGE,
.min_uV = 3300000,
.fixed_uV = 3300000,
.ramp_delay = 66000, /* up to 50us to stabilize */
.ops = &stm32h7_booster_ops,
.enable_reg = STM32H7_SYSCFG_PMCR,
.enable_mask = STM32H7_SYSCFG_BOOSTE_MASK,
.owner = THIS_MODULE,
};
static int stm32mp1_booster_enable(struct regulator_dev *rdev)
{
return regmap_write(rdev->regmap, STM32MP1_SYSCFG_PMCSETR,
STM32MP1_SYSCFG_EN_BOOSTER_MASK);
}
static int stm32mp1_booster_disable(struct regulator_dev *rdev)
{
return regmap_write(rdev->regmap, STM32MP1_SYSCFG_PMCCLRR,
STM32MP1_SYSCFG_EN_BOOSTER_MASK);
}
static const struct regulator_ops stm32mp1_booster_ops = {
.list_voltage = regulator_list_voltage_linear,
.enable = stm32mp1_booster_enable,
.disable = stm32mp1_booster_disable,
.is_enabled = regulator_is_enabled_regmap,
};
static const struct regulator_desc stm32mp1_booster_desc = {
.name = "booster",
.supply_name = "vdda",
.n_voltages = 1,
.type = REGULATOR_VOLTAGE,
.min_uV = 3300000,
.fixed_uV = 3300000,
.ramp_delay = 66000,
.ops = &stm32mp1_booster_ops,
.enable_reg = STM32MP1_SYSCFG_PMCSETR,
.enable_mask = STM32MP1_SYSCFG_EN_BOOSTER_MASK,
.owner = THIS_MODULE,
};
static int stm32_booster_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *np = pdev->dev.of_node;
struct regulator_config config = { };
const struct regulator_desc *desc;
struct regulator_dev *rdev;
struct regmap *regmap;
int ret;
regmap = syscon_regmap_lookup_by_phandle(np, "st,syscfg");
if (IS_ERR(regmap))
return PTR_ERR(regmap);
desc = (const struct regulator_desc *)
of_match_device(dev->driver->of_match_table, dev)->data;
config.regmap = regmap;
config.dev = dev;
config.of_node = np;
config.init_data = of_get_regulator_init_data(dev, np, desc);
rdev = devm_regulator_register(dev, desc, &config);
if (IS_ERR(rdev)) {
ret = PTR_ERR(rdev);
dev_err(dev, "register failed with error %d\n", ret);
return ret;
}
return 0;
}
static const struct of_device_id stm32_booster_of_match[] = {
{
.compatible = "st,stm32h7-booster",
.data = (void *)&stm32h7_booster_desc
}, {
.compatible = "st,stm32mp1-booster",
.data = (void *)&stm32mp1_booster_desc
}, {
},
};
MODULE_DEVICE_TABLE(of, stm32_booster_of_match);
static struct platform_driver stm32_booster_driver = {
.probe = stm32_booster_probe,
.driver = {
.name = "stm32-booster",
.of_match_table = of_match_ptr(stm32_booster_of_match),
},
};
module_platform_driver(stm32_booster_driver);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Fabrice Gasnier <fabrice.gasnier@st.com>");
MODULE_DESCRIPTION("STMicroelectronics STM32 booster regulator driver");
MODULE_ALIAS("platform:stm32-booster");
......@@ -371,11 +371,12 @@ static struct tps65090_platform_data *tps65090_parse_dt_reg_data(
"dcdc-ext-control-gpios", 0,
gflags,
"tps65090");
if (IS_ERR(rpdata->gpiod))
return ERR_CAST(rpdata->gpiod);
if (!rpdata->gpiod)
if (PTR_ERR(rpdata->gpiod) == -ENOENT) {
dev_err(&pdev->dev,
"could not find DCDC external control GPIO\n");
rpdata->gpiod = NULL;
} else if (IS_ERR(rpdata->gpiod))
return ERR_CAST(rpdata->gpiod);
}
if (of_property_read_u32(tps65090_matches[idx].of_node,
......
......@@ -15,7 +15,7 @@
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/machine.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
#include <linux/slab.h>
#include <linux/mfd/wm831x/core.h>
......@@ -50,7 +50,7 @@ struct wm831x_dcdc {
int base;
struct wm831x *wm831x;
struct regulator_dev *regulator;
int dvs_gpio;
struct gpio_desc *dvs_gpiod;
int dvs_gpio_state;
int on_vsel;
int dvs_vsel;
......@@ -217,7 +217,7 @@ static int wm831x_buckv_set_dvs(struct regulator_dev *rdev, int state)
return 0;
dcdc->dvs_gpio_state = state;
gpio_set_value(dcdc->dvs_gpio, state);
gpiod_set_value(dcdc->dvs_gpiod, state);
/* Should wait for DVS state change to be asserted if we have
* a GPIO for it, for now assume the device is configured
......@@ -237,10 +237,10 @@ static int wm831x_buckv_set_voltage_sel(struct regulator_dev *rdev,
int ret;
/* If this value is already set then do a GPIO update if we can */
if (dcdc->dvs_gpio && dcdc->on_vsel == vsel)
if (dcdc->dvs_gpiod && dcdc->on_vsel == vsel)
return wm831x_buckv_set_dvs(rdev, 0);
if (dcdc->dvs_gpio && dcdc->dvs_vsel == vsel)
if (dcdc->dvs_gpiod && dcdc->dvs_vsel == vsel)
return wm831x_buckv_set_dvs(rdev, 1);
/* Always set the ON status to the minimum voltage */
......@@ -249,7 +249,7 @@ static int wm831x_buckv_set_voltage_sel(struct regulator_dev *rdev,
return ret;
dcdc->on_vsel = vsel;
if (!dcdc->dvs_gpio)
if (!dcdc->dvs_gpiod)
return ret;
/* Kick the voltage transition now */
......@@ -296,7 +296,7 @@ static int wm831x_buckv_get_voltage_sel(struct regulator_dev *rdev)
{
struct wm831x_dcdc *dcdc = rdev_get_drvdata(rdev);
if (dcdc->dvs_gpio && dcdc->dvs_gpio_state)
if (dcdc->dvs_gpiod && dcdc->dvs_gpio_state)
return dcdc->dvs_vsel;
else
return dcdc->on_vsel;
......@@ -337,7 +337,7 @@ static void wm831x_buckv_dvs_init(struct platform_device *pdev,
int ret;
u16 ctrl;
if (!pdata || !pdata->dvs_gpio)
if (!pdata)
return;
/* gpiolib won't let us read the GPIO status so pick the higher
......@@ -345,17 +345,14 @@ static void wm831x_buckv_dvs_init(struct platform_device *pdev,
*/
dcdc->dvs_gpio_state = pdata->dvs_init_state;
ret = devm_gpio_request_one(&pdev->dev, pdata->dvs_gpio,
dcdc->dvs_gpio_state ? GPIOF_INIT_HIGH : 0,
"DCDC DVS");
if (ret < 0) {
dev_err(wm831x->dev, "Failed to get %s DVS GPIO: %d\n",
dcdc->name, ret);
dcdc->dvs_gpiod = devm_gpiod_get(&pdev->dev, "dvs",
dcdc->dvs_gpio_state ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW);
if (IS_ERR(dcdc->dvs_gpiod)) {
dev_err(wm831x->dev, "Failed to get %s DVS GPIO: %ld\n",
dcdc->name, PTR_ERR(dcdc->dvs_gpiod));
return;
}
dcdc->dvs_gpio = pdata->dvs_gpio;
switch (pdata->dvs_control_src) {
case 1:
ctrl = 2 << WM831X_DC1_DVS_SRC_SHIFT;
......
......@@ -797,6 +797,9 @@
#define DA9062AA_BUCK3_SL_A_SHIFT 7
#define DA9062AA_BUCK3_SL_A_MASK BIT(7)
/* DA9062AA_VLDO[1-4]_A common */
#define DA9062AA_VLDO_A_MIN_SEL 2
/* DA9062AA_VLDO1_A = 0x0A9 */
#define DA9062AA_VLDO1_A_SHIFT 0
#define DA9062AA_VLDO1_A_MASK 0x3f
......
......@@ -11,55 +11,6 @@
#ifndef __MFD_DA9063_PDATA_H__
#define __MFD_DA9063_PDATA_H__
#include <linux/regulator/machine.h>
/*
* Regulator configuration
*/
/* DA9063 and DA9063L regulator IDs */
enum {
/* BUCKs */
DA9063_ID_BCORE1,
DA9063_ID_BCORE2,
DA9063_ID_BPRO,
DA9063_ID_BMEM,
DA9063_ID_BIO,
DA9063_ID_BPERI,
/* BCORE1 and BCORE2 in merged mode */
DA9063_ID_BCORES_MERGED,
/* BMEM and BIO in merged mode */
DA9063_ID_BMEM_BIO_MERGED,
/* When two BUCKs are merged, they cannot be reused separately */
/* LDOs on both DA9063 and DA9063L */
DA9063_ID_LDO3,
DA9063_ID_LDO7,
DA9063_ID_LDO8,
DA9063_ID_LDO9,
DA9063_ID_LDO11,
/* DA9063-only LDOs */
DA9063_ID_LDO1,
DA9063_ID_LDO2,
DA9063_ID_LDO4,
DA9063_ID_LDO5,
DA9063_ID_LDO6,
DA9063_ID_LDO10,
};
/* Regulators platform data */
struct da9063_regulator_data {
int id;
struct regulator_init_data *initdata;
};
struct da9063_regulators_pdata {
unsigned n_regulators;
struct da9063_regulator_data *regulator_data;
};
/*
* RGB LED configuration
*/
......
......@@ -20,6 +20,7 @@
#define MIN_850_MV 850000
#define MIN_800_MV 800000
#define MIN_750_MV 750000
#define MIN_650_MV 650000
#define MIN_600_MV 600000
#define MIN_500_MV 500000
......
......@@ -170,7 +170,9 @@ enum s2mps11_regulators {
#define S2MPS11_ENABLE_MASK (0x03 << S2MPS11_ENABLE_SHIFT)
#define S2MPS11_ENABLE_SHIFT 0x06
#define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1)
#define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1)
#define S2MPS11_BUCK12346_N_VOLTAGES 153
#define S2MPS11_BUCK5_N_VOLTAGES 216
#define S2MPS11_BUCK7810_N_VOLTAGES 225
#define S2MPS11_BUCK9_N_VOLTAGES (S2MPS11_BUCK9_VSEL_MASK + 1)
#define S2MPS11_RAMP_DELAY 25000 /* uV/us */
......@@ -188,4 +190,9 @@ enum s2mps11_regulators {
#define S2MPS11_BUCK6_RAMP_EN_SHIFT 0
#define S2MPS11_PMIC_EN_SHIFT 6
/*
* Bits for "enable suspend" (On/Off controlled by PWREN)
* are the same as in S2MPS14: S2MPS14_ENABLE_SUSPEND
*/
#endif /* __LINUX_MFD_S2MPS11_H */
......@@ -47,7 +47,6 @@ struct wm831x_battery_pdata {
* I2C or SPI buses.
*/
struct wm831x_buckv_pdata {
int dvs_gpio; /** CPU GPIO to use for DVS switching */
int dvs_control_src; /** Hardware DVS source to use (1 or 2) */
int dvs_init_state; /** DVS state to expect on startup */
int dvs_state_gpio; /** CPU GPIO to use for monitoring status */
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* coupler.h -- SoC Regulator support, coupler API.
*
* Regulator Coupler Interface.
*/
#ifndef __LINUX_REGULATOR_COUPLER_H_
#define __LINUX_REGULATOR_COUPLER_H_
#include <linux/kernel.h>
#include <linux/suspend.h>
struct regulator_coupler;
struct regulator_dev;
/**
* struct regulator_coupler - customized regulator's coupler
*
* Regulator's coupler allows to customize coupling algorithm.
*
* @list: couplers list entry
* @attach_regulator: Callback invoked on creation of a coupled regulator,
* couples are unresolved at this point. The callee should
* check that it could handle the regulator and return 0 on
* success, -errno on failure and 1 if given regulator is
* not suitable for this coupler (case of having multiple
* regulators in a system). Callback shall be implemented.
* @detach_regulator: Callback invoked on destruction of a coupled regulator.
* This callback is optional and could be NULL.
* @balance_voltage: Callback invoked when voltage of a coupled regulator is
* changing. Called with all of the coupled rdev's being held
* under "consumer lock". The callee should perform voltage
* balancing, changing voltage of the coupled regulators as
* needed. It's up to the coupler to verify the voltage
* before changing it in hardware, i.e. coupler should
* check consumer's min/max and etc. This callback is
* optional and could be NULL, in which case a generic
* voltage balancer will be used.
*/
struct regulator_coupler {
struct list_head list;
int (*attach_regulator)(struct regulator_coupler *coupler,
struct regulator_dev *rdev);
int (*detach_regulator)(struct regulator_coupler *coupler,
struct regulator_dev *rdev);
int (*balance_voltage)(struct regulator_coupler *coupler,
struct regulator_dev *rdev,
suspend_state_t state);
};
#ifdef CONFIG_REGULATOR
int regulator_coupler_register(struct regulator_coupler *coupler);
const char *rdev_get_name(struct regulator_dev *rdev);
int regulator_check_consumers(struct regulator_dev *rdev,
int *min_uV, int *max_uV,
suspend_state_t state);
int regulator_check_voltage(struct regulator_dev *rdev,
int *min_uV, int *max_uV);
int regulator_get_voltage_rdev(struct regulator_dev *rdev);
int regulator_set_voltage_rdev(struct regulator_dev *rdev,
int min_uV, int max_uV,
suspend_state_t state);
#else
static inline int regulator_coupler_register(struct regulator_coupler *coupler)
{
return 0;
}
static inline const char *rdev_get_name(struct regulator_dev *rdev)
{
return NULL;
}
static inline int regulator_check_consumers(struct regulator_dev *rdev,
int *min_uV, int *max_uV,
suspend_state_t state)
{
return -EINVAL;
}
static inline int regulator_check_voltage(struct regulator_dev *rdev,
int *min_uV, int *max_uV)
{
return -EINVAL;
}
static inline int regulator_get_voltage_rdev(struct regulator_dev *rdev)
{
return -EINVAL;
}
static inline int regulator_set_voltage_rdev(struct regulator_dev *rdev,
int min_uV, int max_uV,
suspend_state_t state)
{
return -EINVAL;
}
#endif
#endif
......@@ -12,8 +12,6 @@
#ifndef __LINUX_REGULATOR_DRIVER_H_
#define __LINUX_REGULATOR_DRIVER_H_
#define MAX_COUPLED 2
#include <linux/device.h>
#include <linux/notifier.h>
#include <linux/regulator/consumer.h>
......@@ -283,6 +281,11 @@ enum regulator_type {
* @vsel_range_mask: Mask for register bitfield used for range selector
* @vsel_reg: Register for selector when using regulator_regmap_X_voltage_
* @vsel_mask: Mask for register bitfield used for selector
* @vsel_step: Specify the resolution of selector stepping when setting
* voltage. If 0, then no stepping is done (requested selector is
* set directly), if >0 then the regulator API will ramp the
* voltage up/down gradually each time increasing/decreasing the
* selector by the specified step value.
* @csel_reg: Register for current limit selector using regmap set_current_limit
* @csel_mask: Mask for register bitfield used for current limit selector
* @apply_reg: Register for initiate voltage change on the output when
......@@ -357,6 +360,7 @@ struct regulator_desc {
unsigned int vsel_range_mask;
unsigned int vsel_reg;
unsigned int vsel_mask;
unsigned int vsel_step;
unsigned int csel_reg;
unsigned int csel_mask;
unsigned int apply_reg;
......@@ -423,7 +427,8 @@ struct regulator_config {
* incremented.
*/
struct coupling_desc {
struct regulator_dev *coupled_rdevs[MAX_COUPLED];
struct regulator_dev **coupled_rdevs;
struct regulator_coupler *coupler;
int n_resolved;
int n_coupled;
};
......@@ -549,4 +554,5 @@ void regulator_unlock(struct regulator_dev *rdev);
*/
int regulator_desc_list_voltage_linear_range(const struct regulator_desc *desc,
unsigned int selector);
#endif
......@@ -153,7 +153,7 @@ struct regulation_constraints {
int system_load;
/* used for coupled regulators */
int max_spread;
u32 *max_spread;
/* used for changing voltage in steps */
int max_uV_step;
......
......@@ -105,9 +105,6 @@ enum {
#define MAX8952_NUM_DVS_MODE 4
struct max8952_platform_data {
int gpio_vid0;
int gpio_vid1;
u32 default_mode;
u32 dvs_mode[MAX8952_NUM_DVS_MODE]; /* MAX8952_DVS_MODEx_XXXXmV */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment