diff mbox series

[v2,4/4] dt-bindings: mfd: update TI tps6105x chip bindings

Message ID 20191119154611.29625-5-TheSven73@gmail.com
State Superseded, archived
Headers show
Series tps6105x add devicetree and leds support | expand

Checks

Context Check Description
robh/checkpatch success

Commit Message

Sven Van Asbroeck Nov. 19, 2019, 3:46 p.m. UTC
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 <TheSven73@gmail.com>
---
 .../devicetree/bindings/mfd/tps6105x.txt      | 42 ++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

Comments

Dan Murphy Nov. 19, 2019, 6:36 p.m. UTC | #1
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 <TheSven73@gmail.com>
> ---
>   .../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?


> +		};
>   	};
>   };
Sven Van Asbroeck Nov. 19, 2019, 7:03 p.m. UTC | #2
On Tue, Nov 19, 2019 at 1:37 PM Dan Murphy <dmurphy@ti.com> 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.
Jacek Anaszewski Nov. 19, 2019, 7:38 p.m. UTC | #3
Hi Sven,

On 11/19/19 8:03 PM, Sven Van Asbroeck wrote:
> On Tue, Nov 19, 2019 at 1:37 PM Dan Murphy <dmurphy@ti.com> 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.
Sven Van Asbroeck Nov. 19, 2019, 8:22 p.m. UTC | #4
On Tue, Nov 19, 2019 at 2:38 PM Jacek Anaszewski
<jacek.anaszewski@gmail.com> 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?
diff mbox series

Patch

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";
+		};
 	};
 };