* [PATCH v3 0/4] mfd: lp87565: convert DT to yaml, ignore ENx pins and add LP87524-Q1 @ 2020-06-22 20:43 Luca Ceresoli 2020-06-22 20:43 ` [PATCH v3 1/4] regulator: lp87565: enable voltage regardless of ENx pin Luca Ceresoli ` (4 more replies) 0 siblings, 5 replies; 8+ messages in thread From: Luca Ceresoli @ 2020-06-22 20:43 UTC (permalink / raw) To: Liam Girdwood, Mark Brown Cc: Luca Ceresoli, devicetree, linux-kernel, Lee Jones, Rob Herring, Keerthy, Axel Lin Hi, the first patch in this series is a small but significant variation in how the lp87565 driver enables the output rails, to allow the kernel to always know when it is enabling an output. However it can change existing behaviour (depending on the hardware setup) and thus it should be carefully evaluated. The following patches are a fairly straightforward addition of a new chip variant along DT bindings conversion to yaml. v3 fixes the yaml errors present in v2. RFC,v1: https://lkml.org/lkml/2020/6/3/908 v2: https://lkml.org/lkml/2020/6/17/492 Luca Luca Ceresoli (4): regulator: lp87565: enable voltage regardless of ENx pin dt-bindings: mfd: lp87565: convert to yaml dt-bindings: mfd: lp87565: add LP87524-Q1 variant mfd: lp87565: add LP87524-Q1 variant .../devicetree/bindings/mfd/lp87565.txt | 79 ------ .../devicetree/bindings/mfd/ti,lp875xx.yaml | 225 ++++++++++++++++++ drivers/mfd/lp87565.c | 4 + drivers/regulator/lp87565-regulator.c | 21 +- include/linux/mfd/lp87565.h | 1 + 5 files changed, 249 insertions(+), 81 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mfd/lp87565.txt create mode 100644 Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml -- 2.27.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 1/4] regulator: lp87565: enable voltage regardless of ENx pin 2020-06-22 20:43 [PATCH v3 0/4] mfd: lp87565: convert DT to yaml, ignore ENx pins and add LP87524-Q1 Luca Ceresoli @ 2020-06-22 20:43 ` Luca Ceresoli 2020-06-22 20:43 ` [PATCH v3 2/4] dt-bindings: mfd: lp87565: convert to yaml Luca Ceresoli ` (3 subsequent siblings) 4 siblings, 0 replies; 8+ messages in thread From: Luca Ceresoli @ 2020-06-22 20:43 UTC (permalink / raw) To: Liam Girdwood, Mark Brown Cc: Luca Ceresoli, devicetree, linux-kernel, Lee Jones, Rob Herring, Keerthy, Axel Lin This driver enables outputs by setting bit EN_BUCKn in the BUCKn_CTRL1 register. However, if bit EN_PIN_CTRLn in the same register is set, the output is actually enabled only if EN_BUCKn is set AND an enable pin is active. Since the driver does not touch EN_PIN_CTRLn, the choice is left to the hardware, which in turn gets this bit from OTP memory, and in absence of OTP data it uses a default value that is documented in the datasheet for LP8752x, but not for LP8756x. Thus the driver doesn't really "know" whether it is actually enabling the output or not. In order to make sure activation is always driver-controlled, just clear the EN_PIN_CTRLn bit. Now all activation solely depend on the EN_BUCKn bit. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> --- As discussed in RFC,v1 [0] there is a potential regression on existing hardware, see the discussion for more details. So far Mark Brown kind of approved the idea behind this patch, but more discussion about the correct way to handle this situation would be greatly appreciated. [0] https://lkml.org/lkml/2020/6/3/907 Changes in v3: none Changes in v2: none --- drivers/regulator/lp87565-regulator.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/lp87565-regulator.c b/drivers/regulator/lp87565-regulator.c index 5d525dacf959..fbed6bc80c1a 100644 --- a/drivers/regulator/lp87565-regulator.c +++ b/drivers/regulator/lp87565-regulator.c @@ -11,8 +11,8 @@ #include <linux/mfd/lp87565.h> -#define LP87565_REGULATOR(_name, _id, _of, _ops, _n, _vr, _vm, _er, _em, \ - _delay, _lr, _cr) \ +#define LP87565_REGULATOR(_name, _id, _of, _ops, _n, _vr, _vm, \ + _er, _em, _ev, _delay, _lr, _cr) \ [_id] = { \ .desc = { \ .name = _name, \ @@ -28,6 +28,7 @@ .vsel_mask = _vm, \ .enable_reg = _er, \ .enable_mask = _em, \ + .enable_val = _ev, \ .ramp_delay = _delay, \ .linear_ranges = _lr, \ .n_linear_ranges = ARRAY_SIZE(_lr), \ @@ -121,38 +122,54 @@ static const struct lp87565_regulator regulators[] = { LP87565_REGULATOR("BUCK0", LP87565_BUCK_0, "buck0", lp87565_buck_ops, 256, LP87565_REG_BUCK0_VOUT, LP87565_BUCK_VSET, LP87565_REG_BUCK0_CTRL_1, + LP87565_BUCK_CTRL_1_EN | + LP87565_BUCK_CTRL_1_EN_PIN_CTRL, LP87565_BUCK_CTRL_1_EN, 3230, buck0_1_2_3_ranges, LP87565_REG_BUCK0_CTRL_2), LP87565_REGULATOR("BUCK1", LP87565_BUCK_1, "buck1", lp87565_buck_ops, 256, LP87565_REG_BUCK1_VOUT, LP87565_BUCK_VSET, LP87565_REG_BUCK1_CTRL_1, + LP87565_BUCK_CTRL_1_EN | + LP87565_BUCK_CTRL_1_EN_PIN_CTRL, LP87565_BUCK_CTRL_1_EN, 3230, buck0_1_2_3_ranges, LP87565_REG_BUCK1_CTRL_2), LP87565_REGULATOR("BUCK2", LP87565_BUCK_2, "buck2", lp87565_buck_ops, 256, LP87565_REG_BUCK2_VOUT, LP87565_BUCK_VSET, LP87565_REG_BUCK2_CTRL_1, + LP87565_BUCK_CTRL_1_EN | + LP87565_BUCK_CTRL_1_EN_PIN_CTRL, LP87565_BUCK_CTRL_1_EN, 3230, buck0_1_2_3_ranges, LP87565_REG_BUCK2_CTRL_2), LP87565_REGULATOR("BUCK3", LP87565_BUCK_3, "buck3", lp87565_buck_ops, 256, LP87565_REG_BUCK3_VOUT, LP87565_BUCK_VSET, LP87565_REG_BUCK3_CTRL_1, + LP87565_BUCK_CTRL_1_EN | + LP87565_BUCK_CTRL_1_EN_PIN_CTRL, LP87565_BUCK_CTRL_1_EN, 3230, buck0_1_2_3_ranges, LP87565_REG_BUCK3_CTRL_2), LP87565_REGULATOR("BUCK10", LP87565_BUCK_10, "buck10", lp87565_buck_ops, 256, LP87565_REG_BUCK0_VOUT, LP87565_BUCK_VSET, LP87565_REG_BUCK0_CTRL_1, LP87565_BUCK_CTRL_1_EN | + LP87565_BUCK_CTRL_1_EN_PIN_CTRL | + LP87565_BUCK_CTRL_1_FPWM_MP_0_2, + LP87565_BUCK_CTRL_1_EN | LP87565_BUCK_CTRL_1_FPWM_MP_0_2, 3230, buck0_1_2_3_ranges, LP87565_REG_BUCK0_CTRL_2), LP87565_REGULATOR("BUCK23", LP87565_BUCK_23, "buck23", lp87565_buck_ops, 256, LP87565_REG_BUCK2_VOUT, LP87565_BUCK_VSET, LP87565_REG_BUCK2_CTRL_1, + LP87565_BUCK_CTRL_1_EN | + LP87565_BUCK_CTRL_1_EN_PIN_CTRL, LP87565_BUCK_CTRL_1_EN, 3230, buck0_1_2_3_ranges, LP87565_REG_BUCK2_CTRL_2), LP87565_REGULATOR("BUCK3210", LP87565_BUCK_3210, "buck3210", lp87565_buck_ops, 256, LP87565_REG_BUCK0_VOUT, LP87565_BUCK_VSET, LP87565_REG_BUCK0_CTRL_1, LP87565_BUCK_CTRL_1_EN | + LP87565_BUCK_CTRL_1_EN_PIN_CTRL | + LP87565_BUCK_CTRL_1_FPWM_MP_0_2, + LP87565_BUCK_CTRL_1_EN | LP87565_BUCK_CTRL_1_FPWM_MP_0_2, 3230, buck0_1_2_3_ranges, LP87565_REG_BUCK0_CTRL_2), }; -- 2.27.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 2/4] dt-bindings: mfd: lp87565: convert to yaml 2020-06-22 20:43 [PATCH v3 0/4] mfd: lp87565: convert DT to yaml, ignore ENx pins and add LP87524-Q1 Luca Ceresoli 2020-06-22 20:43 ` [PATCH v3 1/4] regulator: lp87565: enable voltage regardless of ENx pin Luca Ceresoli @ 2020-06-22 20:43 ` Luca Ceresoli 2020-07-13 19:01 ` Rob Herring 2020-06-22 20:43 ` [PATCH v3 3/4] dt-bindings: mfd: lp87565: add LP87524-Q1 variant Luca Ceresoli ` (2 subsequent siblings) 4 siblings, 1 reply; 8+ messages in thread From: Luca Ceresoli @ 2020-06-22 20:43 UTC (permalink / raw) To: Liam Girdwood, Mark Brown Cc: Luca Ceresoli, devicetree, linux-kernel, Lee Jones, Rob Herring, Keerthy, Axel Lin The definition of "xxx-in-supply" was generic, thus define in detail the possible cases for each chip variant. Also document that the only possible I2C slave address is 0x60 as per the datasheet and fix the second example accordingly. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> --- Changes in v3: - fix yaml errors Changes in v2: - this patch replaces patch "regulator: lp87565: dt: remove duplicated section" in RFC,v1 (Rob Herring) - use capital letters consistently (Lee Jones) - replace "regulator" -> "mfd" in subject line (Lee Jones) - replace "dt:" suffix with "dt-bindings:" prefix in subject line --- .../devicetree/bindings/mfd/lp87565.txt | 79 ---------- .../devicetree/bindings/mfd/ti,lp875xx.yaml | 142 ++++++++++++++++++ 2 files changed, 142 insertions(+), 79 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mfd/lp87565.txt create mode 100644 Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml diff --git a/Documentation/devicetree/bindings/mfd/lp87565.txt b/Documentation/devicetree/bindings/mfd/lp87565.txt deleted file mode 100644 index 41671e0dc26b..000000000000 --- a/Documentation/devicetree/bindings/mfd/lp87565.txt +++ /dev/null @@ -1,79 +0,0 @@ -TI LP87565 PMIC MFD driver - -Required properties: - - compatible: "ti,lp87565", "ti,lp87565-q1" - - reg: I2C slave address. - - gpio-controller: Marks the device node as a GPIO Controller. - - #gpio-cells: Should be two. The first cell is the pin number and - the second cell is used to specify flags. - See ../gpio/gpio.txt for more information. - - xxx-in-supply: Phandle to parent supply node of each regulator - populated under regulators node. xxx should match - the supply_name populated in driver. -Example: - -lp87565_pmic: pmic@60 { - compatible = "ti,lp87565-q1"; - reg = <0x60>; - gpio-controller; - #gpio-cells = <2>; - - buck10-in-supply = <&vsys_3v3>; - buck23-in-supply = <&vsys_3v3>; - - regulators: regulators { - buck10_reg: buck10 { - /* VDD_MPU */ - regulator-name = "buck10"; - regulator-min-microvolt = <850000>; - regulator-max-microvolt = <1250000>; - regulator-always-on; - regulator-boot-on; - }; - - buck23_reg: buck23 { - /* VDD_GPU */ - regulator-name = "buck23"; - regulator-min-microvolt = <850000>; - regulator-max-microvolt = <1250000>; - regulator-boot-on; - regulator-always-on; - }; - }; -}; - -TI LP87561 PMIC: - -This is a single output 4-phase regulator configuration - -Required properties: - - compatible: "ti,lp87561-q1" - - reg: I2C slave address. - - gpio-controller: Marks the device node as a GPIO Controller. - - #gpio-cells: Should be two. The first cell is the pin number and - the second cell is used to specify flags. - See ../gpio/gpio.txt for more information. - - xxx-in-supply: Phandle to parent supply node of each regulator - populated under regulators node. xxx should match - the supply_name populated in driver. -Example: - -lp87561_pmic: pmic@62 { - compatible = "ti,lp87561-q1"; - reg = <0x62>; - gpio-controller; - #gpio-cells = <2>; - - buck3210-in-supply = <&vsys_3v3>; - - regulators: regulators { - buck3210_reg: buck3210 { - /* VDD_CORE */ - regulator-name = "buck3210"; - regulator-min-microvolt = <800000>; - regulator-max-microvolt = <800000>; - regulator-always-on; - regulator-boot-on; - }; - }; -}; diff --git a/Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml b/Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml new file mode 100644 index 000000000000..2da703918d6a --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml @@ -0,0 +1,142 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/ti,lp875xx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI LP875xx PMIC MFD driver + +maintainers: + - Keerthy <j-keerthy@ti.com> + +properties: + compatible: + oneOf: + - const: ti,lp87565 + - const: ti,lp87565-q1 + - const: ti,lp87561-q1 + + reg: + description: I2C slave address + const: 0x60 + + gpio-controller: true + + '#gpio-cells': + description: + The first cell is the pin number. + The second cell is is used to specify flags. + See ../gpio/gpio.txt for more information. + const: 2 + +required: + - compatible + - reg + - gpio-controller + - '#gpio-cells' + +allOf: + - if: + properties: + compatible: + contains: + enum: + - ti,lp87565 + - ti,lp87565-q1 + then: + properties: + buck10-in-supply: + description: + Phandle to parent supply node for BUCK0 and BUCK1 converters. + + buck23-in-supply: + description: + Phandle to parent supply node for BUCK2 and BUCK3 converters. + + required: + - buck10-in-supply + - buck23-in-supply + + - if: + properties: + compatible: + contains: + enum: + - ti,lp87561-q1 + then: + properties: + buck3210-in-supply: + description: + Phandle to parent supply node for all the four BUCK converters. + + required: + - buck3210-in-supply + +examples: + - | + /* TI LP87565-Q1 PMIC (dual 2-phase output configuration) */ + i2c@0 { + reg = <0x0 0x100>; + #address-cells = <1>; + #size-cells = <0>; + + pmic@60 { + compatible = "ti,lp87565-q1"; + reg = <0x60>; + gpio-controller; + #gpio-cells = <2>; + + buck10-in-supply = <&vsys_3v3>; + buck23-in-supply = <&vsys_3v3>; + + regulators { + buck10_reg: buck10 { + /* VDD_MPU */ + regulator-name = "buck10"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1250000>; + regulator-always-on; + regulator-boot-on; + }; + + buck23_reg: buck23 { + /* VDD_GPU */ + regulator-name = "buck23"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1250000>; + regulator-boot-on; + regulator-always-on; + }; + }; + }; + }; + + - | + /* TI LP87561 PMIC (single 4-phase output configuration) */ + i2c@0 { + reg = <0x0 0x100>; + #address-cells = <1>; + #size-cells = <0>; + + pmic@60 { + compatible = "ti,lp87561-q1"; + reg = <0x60>; + gpio-controller; + #gpio-cells = <2>; + + buck3210-in-supply = <&vsys_3v3>; + + regulators { + buck3210_reg: buck3210 { + /* VDD_CORE */ + regulator-name = "buck3210"; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <800000>; + regulator-always-on; + regulator-boot-on; + }; + }; + }; + }; + +... -- 2.27.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/4] dt-bindings: mfd: lp87565: convert to yaml 2020-06-22 20:43 ` [PATCH v3 2/4] dt-bindings: mfd: lp87565: convert to yaml Luca Ceresoli @ 2020-07-13 19:01 ` Rob Herring 2020-07-14 9:26 ` Luca Ceresoli 0 siblings, 1 reply; 8+ messages in thread From: Rob Herring @ 2020-07-13 19:01 UTC (permalink / raw) To: Luca Ceresoli Cc: Liam Girdwood, Mark Brown, devicetree, linux-kernel, Lee Jones, Keerthy, Axel Lin On Mon, Jun 22, 2020 at 10:43:27PM +0200, Luca Ceresoli wrote: > The definition of "xxx-in-supply" was generic, thus define in detail the > possible cases for each chip variant. > > Also document that the only possible I2C slave address is 0x60 as per the > datasheet and fix the second example accordingly. > > Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> > > --- > > Changes in v3: > - fix yaml errors > > Changes in v2: > - this patch replaces patch "regulator: lp87565: dt: remove duplicated > section" in RFC,v1 (Rob Herring) > - use capital letters consistently (Lee Jones) > - replace "regulator" -> "mfd" in subject line (Lee Jones) > - replace "dt:" suffix with "dt-bindings:" prefix in subject line > --- > .../devicetree/bindings/mfd/lp87565.txt | 79 ---------- > .../devicetree/bindings/mfd/ti,lp875xx.yaml | 142 ++++++++++++++++++ > 2 files changed, 142 insertions(+), 79 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/mfd/lp87565.txt > create mode 100644 Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml > > diff --git a/Documentation/devicetree/bindings/mfd/lp87565.txt b/Documentation/devicetree/bindings/mfd/lp87565.txt > deleted file mode 100644 > index 41671e0dc26b..000000000000 > --- a/Documentation/devicetree/bindings/mfd/lp87565.txt > +++ /dev/null > @@ -1,79 +0,0 @@ > -TI LP87565 PMIC MFD driver > - > -Required properties: > - - compatible: "ti,lp87565", "ti,lp87565-q1" > - - reg: I2C slave address. > - - gpio-controller: Marks the device node as a GPIO Controller. > - - #gpio-cells: Should be two. The first cell is the pin number and > - the second cell is used to specify flags. > - See ../gpio/gpio.txt for more information. > - - xxx-in-supply: Phandle to parent supply node of each regulator > - populated under regulators node. xxx should match > - the supply_name populated in driver. > -Example: > - > -lp87565_pmic: pmic@60 { > - compatible = "ti,lp87565-q1"; > - reg = <0x60>; > - gpio-controller; > - #gpio-cells = <2>; > - > - buck10-in-supply = <&vsys_3v3>; > - buck23-in-supply = <&vsys_3v3>; > - > - regulators: regulators { > - buck10_reg: buck10 { > - /* VDD_MPU */ > - regulator-name = "buck10"; > - regulator-min-microvolt = <850000>; > - regulator-max-microvolt = <1250000>; > - regulator-always-on; > - regulator-boot-on; > - }; > - > - buck23_reg: buck23 { > - /* VDD_GPU */ > - regulator-name = "buck23"; > - regulator-min-microvolt = <850000>; > - regulator-max-microvolt = <1250000>; > - regulator-boot-on; > - regulator-always-on; > - }; > - }; > -}; > - > -TI LP87561 PMIC: > - > -This is a single output 4-phase regulator configuration > - > -Required properties: > - - compatible: "ti,lp87561-q1" > - - reg: I2C slave address. > - - gpio-controller: Marks the device node as a GPIO Controller. > - - #gpio-cells: Should be two. The first cell is the pin number and > - the second cell is used to specify flags. > - See ../gpio/gpio.txt for more information. > - - xxx-in-supply: Phandle to parent supply node of each regulator > - populated under regulators node. xxx should match > - the supply_name populated in driver. > -Example: > - > -lp87561_pmic: pmic@62 { > - compatible = "ti,lp87561-q1"; > - reg = <0x62>; > - gpio-controller; > - #gpio-cells = <2>; > - > - buck3210-in-supply = <&vsys_3v3>; > - > - regulators: regulators { > - buck3210_reg: buck3210 { > - /* VDD_CORE */ > - regulator-name = "buck3210"; > - regulator-min-microvolt = <800000>; > - regulator-max-microvolt = <800000>; > - regulator-always-on; > - regulator-boot-on; > - }; > - }; > -}; > diff --git a/Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml b/Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml > new file mode 100644 > index 000000000000..2da703918d6a > --- /dev/null > +++ b/Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml > @@ -0,0 +1,142 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/mfd/ti,lp875xx.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: TI LP875xx PMIC MFD driver > + > +maintainers: > + - Keerthy <j-keerthy@ti.com> > + > +properties: > + compatible: > + oneOf: > + - const: ti,lp87565 > + - const: ti,lp87565-q1 > + - const: ti,lp87561-q1 > + > + reg: > + description: I2C slave address > + const: 0x60 > + > + gpio-controller: true > + > + '#gpio-cells': > + description: > + The first cell is the pin number. > + The second cell is is used to specify flags. > + See ../gpio/gpio.txt for more information. > + const: 2 > + > +required: > + - compatible > + - reg > + - gpio-controller > + - '#gpio-cells' > + > +allOf: > + - if: > + properties: > + compatible: > + contains: > + enum: > + - ti,lp87565 > + - ti,lp87565-q1 > + then: > + properties: > + buck10-in-supply: > + description: > + Phandle to parent supply node for BUCK0 and BUCK1 converters. > + > + buck23-in-supply: > + description: > + Phandle to parent supply node for BUCK2 and BUCK3 converters. > + > + required: > + - buck10-in-supply > + - buck23-in-supply > + > + - if: > + properties: > + compatible: > + contains: > + enum: > + - ti,lp87561-q1 > + then: > + properties: > + buck3210-in-supply: > + description: > + Phandle to parent supply node for all the four BUCK converters. > + > + required: > + - buck3210-in-supply I think this should probably be 2 schema documents (and a 3rd for the next patch)... > + > +examples: > + - | > + /* TI LP87565-Q1 PMIC (dual 2-phase output configuration) */ > + i2c@0 { > + reg = <0x0 0x100>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + pmic@60 { > + compatible = "ti,lp87565-q1"; > + reg = <0x60>; > + gpio-controller; > + #gpio-cells = <2>; > + > + buck10-in-supply = <&vsys_3v3>; > + buck23-in-supply = <&vsys_3v3>; > + > + regulators { > + buck10_reg: buck10 { The regulators also need to be documented. > + /* VDD_MPU */ > + regulator-name = "buck10"; > + regulator-min-microvolt = <850000>; > + regulator-max-microvolt = <1250000>; > + regulator-always-on; > + regulator-boot-on; > + }; > + > + buck23_reg: buck23 { > + /* VDD_GPU */ > + regulator-name = "buck23"; > + regulator-min-microvolt = <850000>; > + regulator-max-microvolt = <1250000>; > + regulator-boot-on; > + regulator-always-on; > + }; > + }; > + }; > + }; > + > + - | > + /* TI LP87561 PMIC (single 4-phase output configuration) */ > + i2c@0 { > + reg = <0x0 0x100>; > + #address-cells = <1>; > + #size-cells = <0>; > + > + pmic@60 { > + compatible = "ti,lp87561-q1"; > + reg = <0x60>; > + gpio-controller; > + #gpio-cells = <2>; > + > + buck3210-in-supply = <&vsys_3v3>; > + > + regulators { > + buck3210_reg: buck3210 { > + /* VDD_CORE */ > + regulator-name = "buck3210"; > + regulator-min-microvolt = <800000>; > + regulator-max-microvolt = <800000>; > + regulator-always-on; > + regulator-boot-on; > + }; > + }; > + }; > + }; > + > +... > -- > 2.27.0 > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 2/4] dt-bindings: mfd: lp87565: convert to yaml 2020-07-13 19:01 ` Rob Herring @ 2020-07-14 9:26 ` Luca Ceresoli 0 siblings, 0 replies; 8+ messages in thread From: Luca Ceresoli @ 2020-07-14 9:26 UTC (permalink / raw) To: Rob Herring Cc: Liam Girdwood, Mark Brown, devicetree, linux-kernel, Lee Jones, Keerthy, Axel Lin Hi Rob, On 13/07/20 21:01, Rob Herring wrote: > On Mon, Jun 22, 2020 at 10:43:27PM +0200, Luca Ceresoli wrote: >> The definition of "xxx-in-supply" was generic, thus define in detail the >> possible cases for each chip variant. >> >> Also document that the only possible I2C slave address is 0x60 as per the >> datasheet and fix the second example accordingly. >> >> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> [...] >> +allOf: >> + - if: >> + properties: >> + compatible: >> + contains: >> + enum: >> + - ti,lp87565 >> + - ti,lp87565-q1 >> + then: >> + properties: >> + buck10-in-supply: >> + description: >> + Phandle to parent supply node for BUCK0 and BUCK1 converters. >> + >> + buck23-in-supply: >> + description: >> + Phandle to parent supply node for BUCK2 and BUCK3 converters. >> + >> + required: >> + - buck10-in-supply >> + - buck23-in-supply >> + >> + - if: >> + properties: >> + compatible: >> + contains: >> + enum: >> + - ti,lp87561-q1 >> + then: >> + properties: >> + buck3210-in-supply: >> + description: >> + Phandle to parent supply node for all the four BUCK converters. >> + >> + required: >> + - buck3210-in-supply > > I think this should probably be 2 schema documents (and a 3rd for the > next patch)... No problem, will do. Is there a specific rule to know when to split, or is it just when the amount of changes is relevant? >> + >> +examples: >> + - | >> + /* TI LP87565-Q1 PMIC (dual 2-phase output configuration) */ >> + i2c@0 { >> + reg = <0x0 0x100>; >> + #address-cells = <1>; >> + #size-cells = <0>; >> + >> + pmic@60 { >> + compatible = "ti,lp87565-q1"; >> + reg = <0x60>; >> + gpio-controller; >> + #gpio-cells = <2>; >> + >> + buck10-in-supply = <&vsys_3v3>; >> + buck23-in-supply = <&vsys_3v3>; >> + >> + regulators { >> + buck10_reg: buck10 { > > The regulators also need to be documented. OK. -- Luca ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 3/4] dt-bindings: mfd: lp87565: add LP87524-Q1 variant 2020-06-22 20:43 [PATCH v3 0/4] mfd: lp87565: convert DT to yaml, ignore ENx pins and add LP87524-Q1 Luca Ceresoli 2020-06-22 20:43 ` [PATCH v3 1/4] regulator: lp87565: enable voltage regardless of ENx pin Luca Ceresoli 2020-06-22 20:43 ` [PATCH v3 2/4] dt-bindings: mfd: lp87565: convert to yaml Luca Ceresoli @ 2020-06-22 20:43 ` Luca Ceresoli 2020-06-22 20:43 ` [PATCH v3 4/4] " Luca Ceresoli 2020-07-01 22:23 ` [PATCH v3 0/4] mfd: lp87565: convert DT to yaml, ignore ENx pins and add LP87524-Q1 Mark Brown 4 siblings, 0 replies; 8+ messages in thread From: Luca Ceresoli @ 2020-06-22 20:43 UTC (permalink / raw) To: Liam Girdwood, Mark Brown Cc: Luca Ceresoli, devicetree, linux-kernel, Lee Jones, Rob Herring, Keerthy, Axel Lin Add the LP87524-Q1 to the LP87565 bindings document along with an example. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> --- Changes in v3: - fix yaml errors Changes in v2: - RFC,v1 was based on the txt file, rewrite for yaml - use uppercase consistently in model names (Lee Jones) - replace "regulator" -> "mfd" in subject line (Lee Jones) - replace "dt:" suffix with "dt-bindings:" prefix in subject line --- .../devicetree/bindings/mfd/ti,lp875xx.yaml | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml b/Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml index 2da703918d6a..e6fdf61e89a8 100644 --- a/Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml +++ b/Documentation/devicetree/bindings/mfd/ti,lp875xx.yaml @@ -15,6 +15,7 @@ properties: - const: ti,lp87565 - const: ti,lp87565-q1 - const: ti,lp87561-q1 + - const: ti,lp87524-q1 reg: description: I2C slave address @@ -72,6 +73,36 @@ allOf: required: - buck3210-in-supply + - if: + properties: + compatible: + contains: + enum: + - ti,lp87524-q1 + then: + properties: + buck0-in-supply: + description: + Phandle to parent supply node for the BUCK0 converter. + + buck1-in-supply: + description: + Phandle to parent supply node for the BUCK1 converter. + + buck2-in-supply: + description: + Phandle to parent supply node for the BUCK2 converter. + + buck3-in-supply: + description: + Phandle to parent supply node for the BUCK3 converter. + + required: + - buck0-in-supply + - buck1-in-supply + - buck2-in-supply + - buck3-in-supply + examples: - | /* TI LP87565-Q1 PMIC (dual 2-phase output configuration) */ @@ -139,4 +170,56 @@ examples: }; }; + - | + /* TI LP87524-Q1 PMIC (four 1-phase output configuration) */ + i2c@0 { + reg = <0x0 0x100>; + #address-cells = <1>; + #size-cells = <0>; + + pmic@60 { + compatible = "ti,lp87524-q1"; + reg = <0x60>; + gpio-controller; + #gpio-cells = <2>; + + buck0-in-supply = <&vdd_5v0>; + buck1-in-supply = <&vdd_5v0>; + buck2-in-supply = <&vdd_5v0>; + buck3-in-supply = <&vdd_5v0>; + + regulators { + buck0_reg: buck0 { + regulator-name = "buck0"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + buck1_reg: buck1 { + regulator-name = "buck1"; + regulator-min-microvolt = <1350000>; + regulator-max-microvolt = <1350000>; + regulator-always-on; + }; + + buck2_reg: buck2 { + regulator-name = "buck2"; + regulator-min-microvolt = <950000>; + regulator-max-microvolt = <950000>; + regulator-always-on; + }; + + buck3_reg: buck3 { + regulator-name = "buck3"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + }; + }; + }; + + + ... -- 2.27.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 4/4] mfd: lp87565: add LP87524-Q1 variant 2020-06-22 20:43 [PATCH v3 0/4] mfd: lp87565: convert DT to yaml, ignore ENx pins and add LP87524-Q1 Luca Ceresoli ` (2 preceding siblings ...) 2020-06-22 20:43 ` [PATCH v3 3/4] dt-bindings: mfd: lp87565: add LP87524-Q1 variant Luca Ceresoli @ 2020-06-22 20:43 ` Luca Ceresoli 2020-07-01 22:23 ` [PATCH v3 0/4] mfd: lp87565: convert DT to yaml, ignore ENx pins and add LP87524-Q1 Mark Brown 4 siblings, 0 replies; 8+ messages in thread From: Luca Ceresoli @ 2020-06-22 20:43 UTC (permalink / raw) To: Liam Girdwood, Mark Brown Cc: Luca Ceresoli, devicetree, linux-kernel, Lee Jones, Rob Herring, Keerthy, Axel Lin Add support for the LP87524B/J/P-Q1 Four 4-MHz Buck Converter. This is a variant of the LP87565 having 4 single-phase outputs and up to 10 A of total output current. Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org> --- Changes in v3: none Changes in v2: - replace "regulator" -> "mfd" in subject line (Lee Jones) - add Acked-for-MFD-by: from Lee Jones --- drivers/mfd/lp87565.c | 4 ++++ include/linux/mfd/lp87565.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/mfd/lp87565.c b/drivers/mfd/lp87565.c index 4a5c8ade4ae0..cc1072927f6d 100644 --- a/drivers/mfd/lp87565.c +++ b/drivers/mfd/lp87565.c @@ -26,6 +26,10 @@ static const struct mfd_cell lp87565_cells[] = { static const struct of_device_id of_lp87565_match_table[] = { { .compatible = "ti,lp87565", }, + { + .compatible = "ti,lp87524-q1", + .data = (void *)LP87565_DEVICE_TYPE_LP87524_Q1, + }, { .compatible = "ti,lp87565-q1", .data = (void *)LP87565_DEVICE_TYPE_LP87565_Q1, diff --git a/include/linux/mfd/lp87565.h b/include/linux/mfd/lp87565.h index ce965354bbad..ad240f2d0d3f 100644 --- a/include/linux/mfd/lp87565.h +++ b/include/linux/mfd/lp87565.h @@ -14,6 +14,7 @@ enum lp87565_device_type { LP87565_DEVICE_TYPE_UNKNOWN = 0, + LP87565_DEVICE_TYPE_LP87524_Q1, LP87565_DEVICE_TYPE_LP87561_Q1, LP87565_DEVICE_TYPE_LP87565_Q1, }; -- 2.27.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v3 0/4] mfd: lp87565: convert DT to yaml, ignore ENx pins and add LP87524-Q1 2020-06-22 20:43 [PATCH v3 0/4] mfd: lp87565: convert DT to yaml, ignore ENx pins and add LP87524-Q1 Luca Ceresoli ` (3 preceding siblings ...) 2020-06-22 20:43 ` [PATCH v3 4/4] " Luca Ceresoli @ 2020-07-01 22:23 ` Mark Brown 4 siblings, 0 replies; 8+ messages in thread From: Mark Brown @ 2020-07-01 22:23 UTC (permalink / raw) To: Luca Ceresoli, Liam Girdwood Cc: Keerthy, linux-kernel, Lee Jones, devicetree, Rob Herring, Axel Lin On Mon, 22 Jun 2020 22:43:25 +0200, Luca Ceresoli wrote: > the first patch in this series is a small but significant variation in how > the lp87565 driver enables the output rails, to allow the kernel to always > know when it is enabling an output. However it can change existing > behaviour (depending on the hardware setup) and thus it should be carefully > evaluated. > > The following patches are a fairly straightforward addition of a new chip > variant along DT bindings conversion to yaml. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next Thanks! [1/1] regulator: lp87565: enable voltage regardless of ENx pin commit: 81fdcef3a615f5d4ef2a2bd87a65d46f6816d687 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-07-14 9:26 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-06-22 20:43 [PATCH v3 0/4] mfd: lp87565: convert DT to yaml, ignore ENx pins and add LP87524-Q1 Luca Ceresoli 2020-06-22 20:43 ` [PATCH v3 1/4] regulator: lp87565: enable voltage regardless of ENx pin Luca Ceresoli 2020-06-22 20:43 ` [PATCH v3 2/4] dt-bindings: mfd: lp87565: convert to yaml Luca Ceresoli 2020-07-13 19:01 ` Rob Herring 2020-07-14 9:26 ` Luca Ceresoli 2020-06-22 20:43 ` [PATCH v3 3/4] dt-bindings: mfd: lp87565: add LP87524-Q1 variant Luca Ceresoli 2020-06-22 20:43 ` [PATCH v3 4/4] " Luca Ceresoli 2020-07-01 22:23 ` [PATCH v3 0/4] mfd: lp87565: convert DT to yaml, ignore ENx pins and add LP87524-Q1 Mark Brown
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.