2019-11-19 15:47:57

by Sven Van Asbroeck

[permalink] [raw]
Subject: [PATCH v2 4/4] dt-bindings: mfd: update TI tps6105x chip bindings

The driver has been extended to optionally get its operational
mode, regulator init data and led label from the devicetree.

Tree: next-20191118
Signed-off-by: Sven Van Asbroeck <[email protected]>
---
.../devicetree/bindings/mfd/tps6105x.txt | 42 ++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/tps6105x.txt b/Documentation/devicetree/bindings/mfd/tps6105x.txt
index 93602c7a19c8..ab5d4c52074f 100644
--- a/Documentation/devicetree/bindings/mfd/tps6105x.txt
+++ b/Documentation/devicetree/bindings/mfd/tps6105x.txt
@@ -7,11 +7,51 @@ Required properties:
- compatible: "ti,tps61050" or "ti,tps61052"
- reg: Specifies the I2C slave address

-Example:
+Optional sub-node:
+
+This subnode selects the chip's operational mode.
+There can be at most one single available subnode.
+
+- regulator: presence of this sub-node puts the chip in regulator mode.
+ see Documentation/devicetree/bindings/regulator/regulator.txt
+
+- led: presence of this sub-node puts the chip in led mode.
+ Optional properties:
+ - label: see Documentation/devicetree/bindings/leds/common.txt
+
+Example (GPIO operation only):
+
+i2c0 {
+ tps61052@33 {
+ compatible = "ti,tps61052";
+ reg = <0x33>;
+ };
+};
+
+Example (GPIO + regulator operation):

i2c0 {
tps61052@33 {
compatible = "ti,tps61052";
reg = <0x33>;
+
+ regulator {
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-always-on;
+ };
+ };
+};
+
+Example (GPIO + led operation):
+
+i2c0 {
+ tps61052@33 {
+ compatible = "ti,tps61052";
+ reg = <0x33>;
+
+ led {
+ label = "tps-torch";
+ };
};
};
--
2.17.1



2019-11-19 18:40:38

by Dan Murphy

[permalink] [raw]
Subject: Re: [PATCH v2 4/4] dt-bindings: mfd: update TI tps6105x chip bindings

Sven

On 11/19/19 9:46 AM, Sven Van Asbroeck wrote:
> The driver has been extended to optionally get its operational
> mode, regulator init data and led label from the devicetree.
>
> Tree: next-20191118
> Signed-off-by: Sven Van Asbroeck <[email protected]>
> ---
> .../devicetree/bindings/mfd/tps6105x.txt | 42 ++++++++++++++++++-
> 1 file changed, 41 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/tps6105x.txt b/Documentation/devicetree/bindings/mfd/tps6105x.txt
> index 93602c7a19c8..ab5d4c52074f 100644
> --- a/Documentation/devicetree/bindings/mfd/tps6105x.txt
> +++ b/Documentation/devicetree/bindings/mfd/tps6105x.txt
> @@ -7,11 +7,51 @@ Required properties:
> - compatible: "ti,tps61050" or "ti,tps61052"
> - reg: Specifies the I2C slave address
>
> -Example:
> +Optional sub-node:
> +
> +This subnode selects the chip's operational mode.
> +There can be at most one single available subnode.
> +
> +- regulator: presence of this sub-node puts the chip in regulator mode.
> + see Documentation/devicetree/bindings/regulator/regulator.txt
> +
> +- led: presence of this sub-node puts the chip in led mode.
> + Optional properties:
> + - label: see Documentation/devicetree/bindings/leds/common.txt
> +
> +Example (GPIO operation only):
> +
> +i2c0 {
> + tps61052@33 {
> + compatible = "ti,tps61052";
> + reg = <0x33>;
> + };
> +};
> +
> +Example (GPIO + regulator operation):
>
> i2c0 {
> tps61052@33 {
> compatible = "ti,tps61052";
> reg = <0x33>;
> +
> + regulator {
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> + regulator-always-on;
> + };
> + };
> +};
> +
> +Example (GPIO + led operation):
What part of the example is GPIO? Is that the default function?
> +
> +i2c0 {
> + tps61052@33 {
> + compatible = "ti,tps61052";
> + reg = <0x33>;
> +
> + led {
> + label = "tps-torch";

function and color examples?


> + };
> };
> };

2019-11-19 19:07:23

by Sven Van Asbroeck

[permalink] [raw]
Subject: Re: [PATCH v2 4/4] dt-bindings: mfd: update TI tps6105x chip bindings

On Tue, Nov 19, 2019 at 1:37 PM Dan Murphy <[email protected]> wrote:
>
> > +
> > +Example (GPIO + led operation):
> What part of the example is GPIO? Is that the default function?

The gpio function is always available by default.
The mfd driver always adds the gpio mfd_cell.
But no-one has ever implemented a mfd sub-driver for gpio.

> > +
> > +i2c0 {
> > + tps61052@33 {
> > + compatible = "ti,tps61052";
> > + reg = <0x33>;
> > +
> > + led {
> > + label = "tps-torch";
>
> function and color examples?

No function, no colour. This is a simple led control with 8 intensity
steps. We use it as a led torch on an industrial device.

2019-11-19 19:40:26

by Jacek Anaszewski

[permalink] [raw]
Subject: Re: [PATCH v2 4/4] dt-bindings: mfd: update TI tps6105x chip bindings

Hi Sven,

On 11/19/19 8:03 PM, Sven Van Asbroeck wrote:
> On Tue, Nov 19, 2019 at 1:37 PM Dan Murphy <[email protected]> wrote:
>>
>>> +
>>> +Example (GPIO + led operation):
>> What part of the example is GPIO? Is that the default function?
>
> The gpio function is always available by default.
> The mfd driver always adds the gpio mfd_cell.
> But no-one has ever implemented a mfd sub-driver for gpio.
>
>>> +
>>> +i2c0 {
>>> + tps61052@33 {
>>> + compatible = "ti,tps61052";
>>> + reg = <0x33>;
>>> +
>>> + led {
>>> + label = "tps-torch";
>>
>> function and color examples?
>
> No function, no colour. This is a simple led control with 8 intensity
> steps. We use it as a led torch on an industrial device.

label DT property was recently deprecated. We now encourage using
'function' and/or 'color'. Please refer to
Documentation/devicetree/bindings/leds/common.txt.

--
Best regards,
Jacek Anaszewski

2019-11-19 20:24:11

by Sven Van Asbroeck

[permalink] [raw]
Subject: Re: [PATCH v2 4/4] dt-bindings: mfd: update TI tps6105x chip bindings

On Tue, Nov 19, 2019 at 2:38 PM Jacek Anaszewski
<[email protected]> wrote:
>
> label DT property was recently deprecated. We now encourage using
> 'function' and/or 'color'. Please refer to
> Documentation/devicetree/bindings/leds/common.txt.

Ah, I see.

I'm actually back-porting this from a 4.19 vendor kernel, which I believe
does not have function/color support. If I introduce it here, I wouldn't
be able to test it easily, and I'd have to forward/back-port.

All I need is a single led in the system. So I'll just remove the 'label'
code/description, and hard-code the led name to 'tps6105x'. If
anyone wants to use this driver and wants named leds, they can
always add it themselves.

Jacek and Dan, does that satisfy your concerns?