diff mbox series

[v4,1/1] dt-bindings: hwmon: Convert ltc2978.txt to yaml

Message ID 20240828164133.1131959-1-Frank.Li@nxp.com (mailing list archive)
State Changes Requested
Headers show
Series [v4,1/1] dt-bindings: hwmon: Convert ltc2978.txt to yaml | expand

Commit Message

Frank Li Aug. 28, 2024, 4:41 p.m. UTC
Convert binding doc ltc2978.txt to yaml format.
Additional change:
- add i2c node.
- basic it is regulator according to example, move it under regulator.

Fix below warning:
arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dtb: /soc/i2c@2000000/i2c-mux@77/i2c@2/regulator@5c:
	failed to match any schema with compatible: ['lltc,ltc3882']

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
Change from v3 to v4
- keep under hwmon directory.
Change from v2 to v3
- put my name into maintainers.
change from v1 to v2
- maintainer change to Mark Brown <broonie@kernel.org> (regulator maintainer)
- update title to (from ltc2978 data sheet).
octal, digital power-supply monitor, supervisor, sequencer, and margin controller.
---
 .../bindings/hwmon/lltc,ltc2972.yaml          | 94 +++++++++++++++++++
 .../devicetree/bindings/hwmon/ltc2978.txt     | 62 ------------
 2 files changed, 94 insertions(+), 62 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/hwmon/lltc,ltc2972.yaml
 delete mode 100644 Documentation/devicetree/bindings/hwmon/ltc2978.txt

Comments

Guenter Roeck Aug. 28, 2024, 5:06 p.m. UTC | #1
On 8/28/24 09:41, Frank Li wrote:
> Convert binding doc ltc2978.txt to yaml format.
> Additional change:
> - add i2c node.
> - basic it is regulator according to example, move it under regulator.
> 
> Fix below warning:
> arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dtb: /soc/i2c@2000000/i2c-mux@77/i2c@2/regulator@5c:
> 	failed to match any schema with compatible: ['lltc,ltc3882']
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> Change from v3 to v4
> - keep under hwmon directory.
> Change from v2 to v3
> - put my name into maintainers.
> change from v1 to v2
> - maintainer change to Mark Brown <broonie@kernel.org> (regulator maintainer)
> - update title to (from ltc2978 data sheet).
> octal, digital power-supply monitor, supervisor, sequencer, and margin controller.
> ---
>   .../bindings/hwmon/lltc,ltc2972.yaml          | 94 +++++++++++++++++++
>   .../devicetree/bindings/hwmon/ltc2978.txt     | 62 ------------

I still fail to understand the rationale for renaming the file from ltc2978
to ltc2972. I can see that 2972 is currently the alphabetically first supported
chip, but that is, in my opinion, irrelevant, and it will change.

If/when support for LTC2971 is added to the file and to the driver, do you plan
to rename the file again ?

Thanks,
Guenter
Frank Li Aug. 28, 2024, 6:35 p.m. UTC | #2
On Wed, Aug 28, 2024 at 10:06:25AM -0700, Guenter Roeck wrote:
> On 8/28/24 09:41, Frank Li wrote:
> > Convert binding doc ltc2978.txt to yaml format.
> > Additional change:
> > - add i2c node.
> > - basic it is regulator according to example, move it under regulator.
> >
> > Fix below warning:
> > arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dtb: /soc/i2c@2000000/i2c-mux@77/i2c@2/regulator@5c:
> > 	failed to match any schema with compatible: ['lltc,ltc3882']
> >
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> > Change from v3 to v4
> > - keep under hwmon directory.
> > Change from v2 to v3
> > - put my name into maintainers.
> > change from v1 to v2
> > - maintainer change to Mark Brown <broonie@kernel.org> (regulator maintainer)
> > - update title to (from ltc2978 data sheet).
> > octal, digital power-supply monitor, supervisor, sequencer, and margin controller.
> > ---
> >   .../bindings/hwmon/lltc,ltc2972.yaml          | 94 +++++++++++++++++++
> >   .../devicetree/bindings/hwmon/ltc2978.txt     | 62 ------------
>
> I still fail to understand the rationale for renaming the file from ltc2978
> to ltc2972. I can see that 2972 is currently the alphabetically first supported
> chip, but that is, in my opinion, irrelevant, and it will change.

Conor suggest use one of compatbile string as filename. I random pick one.
I am not care about filename. If you like, I can use lltc,ltc2978.yaml
or other filename.

Frank
>
> If/when support for LTC2971 is added to the file and to the driver, do you plan
> to rename the file again ?
>
> Thanks,
> Guenter
>
Guenter Roeck Aug. 28, 2024, 7:40 p.m. UTC | #3
On 8/28/24 11:35, Frank Li wrote:
> On Wed, Aug 28, 2024 at 10:06:25AM -0700, Guenter Roeck wrote:
>> On 8/28/24 09:41, Frank Li wrote:
>>> Convert binding doc ltc2978.txt to yaml format.
>>> Additional change:
>>> - add i2c node.
>>> - basic it is regulator according to example, move it under regulator.
>>>
>>> Fix below warning:
>>> arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dtb: /soc/i2c@2000000/i2c-mux@77/i2c@2/regulator@5c:
>>> 	failed to match any schema with compatible: ['lltc,ltc3882']
>>>
>>> Signed-off-by: Frank Li <Frank.Li@nxp.com>
>>> ---
>>> Change from v3 to v4
>>> - keep under hwmon directory.
>>> Change from v2 to v3
>>> - put my name into maintainers.
>>> change from v1 to v2
>>> - maintainer change to Mark Brown <broonie@kernel.org> (regulator maintainer)
>>> - update title to (from ltc2978 data sheet).
>>> octal, digital power-supply monitor, supervisor, sequencer, and margin controller.
>>> ---
>>>    .../bindings/hwmon/lltc,ltc2972.yaml          | 94 +++++++++++++++++++
>>>    .../devicetree/bindings/hwmon/ltc2978.txt     | 62 ------------
>>
>> I still fail to understand the rationale for renaming the file from ltc2978
>> to ltc2972. I can see that 2972 is currently the alphabetically first supported
>> chip, but that is, in my opinion, irrelevant, and it will change.
> 
> Conor suggest use one of compatbile string as filename. I random pick one.
> I am not care about filename. If you like, I can use lltc,ltc2978.yaml
> or other filename.
> 

The rename results in a disconnect between driver name and the associated
devicetree file. I fail to see the point of introducing that disconnect.

Guenter
Frank Li Aug. 28, 2024, 7:50 p.m. UTC | #4
On Wed, Aug 28, 2024 at 12:40:59PM -0700, Guenter Roeck wrote:
> On 8/28/24 11:35, Frank Li wrote:
> > On Wed, Aug 28, 2024 at 10:06:25AM -0700, Guenter Roeck wrote:
> > > On 8/28/24 09:41, Frank Li wrote:
> > > > Convert binding doc ltc2978.txt to yaml format.
> > > > Additional change:
> > > > - add i2c node.
> > > > - basic it is regulator according to example, move it under regulator.
> > > >
> > > > Fix below warning:
> > > > arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dtb: /soc/i2c@2000000/i2c-mux@77/i2c@2/regulator@5c:
> > > > 	failed to match any schema with compatible: ['lltc,ltc3882']
> > > >
> > > > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > > > ---
> > > > Change from v3 to v4
> > > > - keep under hwmon directory.
> > > > Change from v2 to v3
> > > > - put my name into maintainers.
> > > > change from v1 to v2
> > > > - maintainer change to Mark Brown <broonie@kernel.org> (regulator maintainer)
> > > > - update title to (from ltc2978 data sheet).
> > > > octal, digital power-supply monitor, supervisor, sequencer, and margin controller.
> > > > ---
> > > >    .../bindings/hwmon/lltc,ltc2972.yaml          | 94 +++++++++++++++++++
> > > >    .../devicetree/bindings/hwmon/ltc2978.txt     | 62 ------------
> > >
> > > I still fail to understand the rationale for renaming the file from ltc2978
> > > to ltc2972. I can see that 2972 is currently the alphabetically first supported
> > > chip, but that is, in my opinion, irrelevant, and it will change.
> >
> > Conor suggest use one of compatbile string as filename. I random pick one.
> > I am not care about filename. If you like, I can use lltc,ltc2978.yaml
> > or other filename.
> >
>
> The rename results in a disconnect between driver name and the associated
> devicetree file. I fail to see the point of introducing that disconnect.

what's name do you prefered? lltc,ltc2978.yaml?

Frank

>
> Guenter
>
Guenter Roeck Aug. 28, 2024, 8:21 p.m. UTC | #5
On 8/28/24 12:50, Frank Li wrote:
> On Wed, Aug 28, 2024 at 12:40:59PM -0700, Guenter Roeck wrote:
>> On 8/28/24 11:35, Frank Li wrote:
>>> On Wed, Aug 28, 2024 at 10:06:25AM -0700, Guenter Roeck wrote:
>>>> On 8/28/24 09:41, Frank Li wrote:
>>>>> Convert binding doc ltc2978.txt to yaml format.
>>>>> Additional change:
>>>>> - add i2c node.
>>>>> - basic it is regulator according to example, move it under regulator.
>>>>>
>>>>> Fix below warning:
>>>>> arch/arm64/boot/dts/freescale/fsl-lx2160a-clearfog-cx.dtb: /soc/i2c@2000000/i2c-mux@77/i2c@2/regulator@5c:
>>>>> 	failed to match any schema with compatible: ['lltc,ltc3882']
>>>>>
>>>>> Signed-off-by: Frank Li <Frank.Li@nxp.com>
>>>>> ---
>>>>> Change from v3 to v4
>>>>> - keep under hwmon directory.
>>>>> Change from v2 to v3
>>>>> - put my name into maintainers.
>>>>> change from v1 to v2
>>>>> - maintainer change to Mark Brown <broonie@kernel.org> (regulator maintainer)
>>>>> - update title to (from ltc2978 data sheet).
>>>>> octal, digital power-supply monitor, supervisor, sequencer, and margin controller.
>>>>> ---
>>>>>     .../bindings/hwmon/lltc,ltc2972.yaml          | 94 +++++++++++++++++++
>>>>>     .../devicetree/bindings/hwmon/ltc2978.txt     | 62 ------------
>>>>
>>>> I still fail to understand the rationale for renaming the file from ltc2978
>>>> to ltc2972. I can see that 2972 is currently the alphabetically first supported
>>>> chip, but that is, in my opinion, irrelevant, and it will change.
>>>
>>> Conor suggest use one of compatbile string as filename. I random pick one.
>>> I am not care about filename. If you like, I can use lltc,ltc2978.yaml
>>> or other filename.
>>>
>>
>> The rename results in a disconnect between driver name and the associated
>> devicetree file. I fail to see the point of introducing that disconnect.
> 
> what's name do you prefered? lltc,ltc2978.yaml?
> 

Yes.

Guenter
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/hwmon/lltc,ltc2972.yaml b/Documentation/devicetree/bindings/hwmon/lltc,ltc2972.yaml
new file mode 100644
index 0000000000000..1b930400fbcf0
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/lltc,ltc2972.yaml
@@ -0,0 +1,94 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/lltc,ltc2972.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Octal Digital Power-supply monitor/supervisor/sequencer/margin controller.
+
+maintainers:
+  - Frank Li <Frank.Li@nxp.com>
+
+properties:
+  compatible:
+    enum:
+      - lltc,ltc2972
+      - lltc,ltc2974
+      - lltc,ltc2975
+      - lltc,ltc2977
+      - lltc,ltc2978
+      - lltc,ltc2979
+      - lltc,ltc2980
+      - lltc,ltc3880
+      - lltc,ltc3882
+      - lltc,ltc3883
+      - lltc,ltc3884
+      - lltc,ltc3886
+      - lltc,ltc3887
+      - lltc,ltc3889
+      - lltc,ltc7880
+      - lltc,ltm2987
+      - lltc,ltm4664
+      - lltc,ltm4675
+      - lltc,ltm4676
+      - lltc,ltm4677
+      - lltc,ltm4678
+      - lltc,ltm4680
+      - lltc,ltm4686
+      - lltc,ltm4700
+
+  reg:
+    maxItems: 1
+
+  regulators:
+    type: object
+    description: |
+      list of regulators provided by this controller.
+      Valid names of regulators depend on number of supplies supported per device:
+      * ltc2972 vout0 - vout1
+      * ltc2974, ltc2975 : vout0 - vout3
+      * ltc2977, ltc2979, ltc2980, ltm2987 : vout0 - vout7
+      * ltc2978 : vout0 - vout7
+      * ltc3880, ltc3882, ltc3884, ltc3886, ltc3887, ltc3889 : vout0 - vout1
+      * ltc7880 : vout0 - vout1
+      * ltc3883 : vout0
+      * ltm4664 : vout0 - vout1
+      * ltm4675, ltm4676, ltm4677, ltm4678 : vout0 - vout1
+      * ltm4680, ltm4686 : vout0 - vout1
+      * ltm4700 : vout0 - vout1
+
+    patternProperties:
+      "^vout[0-7]$":
+        $ref: /schemas/regulator/regulator.yaml#
+        type: object
+        unevaluatedProperties: false
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        regulator@5e {
+            compatible = "lltc,ltc2978";
+            reg = <0x5e>;
+
+            regulators {
+                vout0 {
+                     regulator-name = "FPGA-2.5V";
+                };
+                vout2 {
+                     regulator-name = "FPGA-1.5V";
+                };
+            };
+        };
+    };
+
diff --git a/Documentation/devicetree/bindings/hwmon/ltc2978.txt b/Documentation/devicetree/bindings/hwmon/ltc2978.txt
deleted file mode 100644
index 4e7f6215a4533..0000000000000
--- a/Documentation/devicetree/bindings/hwmon/ltc2978.txt
+++ /dev/null
@@ -1,62 +0,0 @@ 
-ltc2978
-
-Required properties:
-- compatible: should contain one of:
-  * "lltc,ltc2972"
-  * "lltc,ltc2974"
-  * "lltc,ltc2975"
-  * "lltc,ltc2977"
-  * "lltc,ltc2978"
-  * "lltc,ltc2979"
-  * "lltc,ltc2980"
-  * "lltc,ltc3880"
-  * "lltc,ltc3882"
-  * "lltc,ltc3883"
-  * "lltc,ltc3884"
-  * "lltc,ltc3886"
-  * "lltc,ltc3887"
-  * "lltc,ltc3889"
-  * "lltc,ltc7880"
-  * "lltc,ltm2987"
-  * "lltc,ltm4664"
-  * "lltc,ltm4675"
-  * "lltc,ltm4676"
-  * "lltc,ltm4677"
-  * "lltc,ltm4678"
-  * "lltc,ltm4680"
-  * "lltc,ltm4686"
-  * "lltc,ltm4700"
-- reg: I2C slave address
-
-Optional properties:
-- regulators: A node that houses a sub-node for each regulator controlled by
-  the device. Each sub-node is identified using the node's name, with valid
-  values listed below. The content of each sub-node is defined by the
-  standard binding for regulators; see regulator.txt.
-
-Valid names of regulators depend on number of supplies supported per device:
-  * ltc2972 vout0 - vout1
-  * ltc2974, ltc2975 : vout0 - vout3
-  * ltc2977, ltc2979, ltc2980, ltm2987 : vout0 - vout7
-  * ltc2978 : vout0 - vout7
-  * ltc3880, ltc3882, ltc3884, ltc3886, ltc3887, ltc3889 : vout0 - vout1
-  * ltc7880 : vout0 - vout1
-  * ltc3883 : vout0
-  * ltm4664 : vout0 - vout1
-  * ltm4675, ltm4676, ltm4677, ltm4678 : vout0 - vout1
-  * ltm4680, ltm4686 : vout0 - vout1
-  * ltm4700 : vout0 - vout1
-
-Example:
-ltc2978@5e {
-	compatible = "lltc,ltc2978";
-	reg = <0x5e>;
-	regulators {
-		vout0 {
-			regulator-name = "FPGA-2.5V";
-		};
-		vout2 {
-			regulator-name = "FPGA-1.5V";
-		};
-	};
-};