2024-03-21 18:44:07

by Javier Carrasco

[permalink] [raw]
Subject: [PATCH 0/5] dt-bindings: hwmon: convert multiple devices to dtschema

This series converts the following existing bindings to dtschema:

- as370
- ibmpowernv
- stts751
- ibm,p8-occ-hwmon (moved to trivial-devices.yaml)

Additionally, pwm-fan.txt has been dropped because it was converted a
year ago, and it is not mentioned anywhere in the tree.
I could not find the rationale, but its current state does not seem to
provide any valuable information.

The binding of the as370 looks very simple, but given that the reg
property is not a single address, I have written a dedicated file for
it. If reg = <address range> is valid in trivial-devices.yaml, I have
nothing against moving this device as well.

Signed-off-by: Javier Carrasco <[email protected]>
---
Javier Carrasco (5):
dt-bindings: hwmon: as370: convert to dtschema
dt-bindings: hwmon: ibmpowernv: convert to dtschema
dt-bindings: hwmon: pwm-fan: drop text file
dt-bindings: hwmon: stts751: convert to dtschema
dt-bindings: hwmon: ibm,p8-occ-hwmon: move to trivial devices

Documentation/devicetree/bindings/hwmon/as370.txt | 11 ------
.../devicetree/bindings/hwmon/ibm,p8-occ-hwmon.txt | 25 -------------
.../devicetree/bindings/hwmon/ibm,powernv.yaml | 37 +++++++++++++++++++
.../devicetree/bindings/hwmon/ibmpowernv.txt | 23 ------------
.../devicetree/bindings/hwmon/pwm-fan.txt | 1 -
.../devicetree/bindings/hwmon/st,stts751.yaml | 41 ++++++++++++++++++++++
.../devicetree/bindings/hwmon/stts751.txt | 15 --------
.../devicetree/bindings/hwmon/syna,as370.yaml | 32 +++++++++++++++++
.../devicetree/bindings/trivial-devices.yaml | 2 ++
9 files changed, 112 insertions(+), 75 deletions(-)
---
base-commit: ebc9bee8814d12ec247de117aa2f7fd39ff11127
change-id: 20240320-hwmon_dtschema-7f58f49118aa

Best regards,
--
Javier Carrasco <[email protected]>



2024-03-21 18:44:16

by Javier Carrasco

[permalink] [raw]
Subject: [PATCH 1/5] dt-bindings: hwmon: as370: convert to dtschema

Convert existing binding to support validation.

This is a straightforward conversion with now new properties.

Signed-off-by: Javier Carrasco <[email protected]>
---
Documentation/devicetree/bindings/hwmon/as370.txt | 11 --------
.../devicetree/bindings/hwmon/syna,as370.yaml | 32 ++++++++++++++++++++++
2 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/Documentation/devicetree/bindings/hwmon/as370.txt b/Documentation/devicetree/bindings/hwmon/as370.txt
deleted file mode 100644
index d102fe765124..000000000000
--- a/Documentation/devicetree/bindings/hwmon/as370.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Bindings for Synaptics AS370 PVT sensors
-
-Required properties:
-- compatible : "syna,as370-hwmon"
-- reg : address and length of the register set.
-
-Example:
- hwmon@ea0810 {
- compatible = "syna,as370-hwmon";
- reg = <0xea0810 0xc>;
- };
diff --git a/Documentation/devicetree/bindings/hwmon/syna,as370.yaml b/Documentation/devicetree/bindings/hwmon/syna,as370.yaml
new file mode 100644
index 000000000000..1f7005f55247
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/syna,as370.yaml
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/syna,as370.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Synaptics AS370 PVT sensors
+
+maintainers:
+ - Javier Carrasco <[email protected]>
+
+properties:
+ compatible:
+ const: syna,as370-hwmon
+
+ reg:
+ description:
+ Address and length of the register set.
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ sensor@ea0810 {
+ compatible = "syna,as370-hwmon";
+ reg = <0xea0810 0xc>;
+ };

--
2.40.1


2024-03-21 18:44:31

by Javier Carrasco

[permalink] [raw]
Subject: [PATCH 2/5] dt-bindings: hwmon: ibmpowernv: convert to dtschema

Convert existing binding to support validation.

This is a straightforward conversion with now new properties.

Signed-off-by: Javier Carrasco <[email protected]>
---
.../devicetree/bindings/hwmon/ibm,powernv.yaml | 37 ++++++++++++++++++++++
.../devicetree/bindings/hwmon/ibmpowernv.txt | 23 --------------
2 files changed, 37 insertions(+), 23 deletions(-)

diff --git a/Documentation/devicetree/bindings/hwmon/ibm,powernv.yaml b/Documentation/devicetree/bindings/hwmon/ibm,powernv.yaml
new file mode 100644
index 000000000000..27c949b94c7b
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/ibm,powernv.yaml
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/ibm,powernv.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: IBM POWERNV platform sensors
+
+maintainers:
+ - Javier Carrasco <[email protected]>
+
+properties:
+ compatible:
+ enum:
+ - ibm,opal-sensor-cooling-fan
+ - ibm,opal-sensor-amb-temp
+ - ibm,opal-sensor-power-supply
+ - ibm,opal-sensor-power
+
+ sensor-id:
+ description:
+ An opaque id provided by the firmware to the kernel, identifies a
+ given sensor and its attribute data.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+required:
+ - compatible
+ - sensor-id
+
+additionalProperties: false
+
+examples:
+ - |
+ sensor {
+ compatible = "st,stts751";
+ sensor-id = <0x7052107>;
+ };
diff --git a/Documentation/devicetree/bindings/hwmon/ibmpowernv.txt b/Documentation/devicetree/bindings/hwmon/ibmpowernv.txt
deleted file mode 100644
index f93242be60a1..000000000000
--- a/Documentation/devicetree/bindings/hwmon/ibmpowernv.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-IBM POWERNV platform sensors
-----------------------------
-
-Required node properties:
-- compatible: must be one of
- "ibm,opal-sensor-cooling-fan"
- "ibm,opal-sensor-amb-temp"
- "ibm,opal-sensor-power-supply"
- "ibm,opal-sensor-power"
-- sensor-id: an opaque id provided by the firmware to the kernel, identifies a
- given sensor and its attribute data
-
-Example sensors node:
-
-cooling-fan#8-data {
- sensor-id = <0x7052107>;
- compatible = "ibm,opal-sensor-cooling-fan";
-};
-
-amb-temp#1-thrs {
- sensor-id = <0x5096000>;
- compatible = "ibm,opal-sensor-amb-temp";
-};

--
2.40.1


2024-03-21 18:44:44

by Javier Carrasco

[permalink] [raw]
Subject: [PATCH 3/5] dt-bindings: hwmon: pwm-fan: drop text file

This binding was converted to dtschema a year ago.

Signed-off-by: Javier Carrasco <[email protected]>
---
Documentation/devicetree/bindings/hwmon/pwm-fan.txt | 1 -
1 file changed, 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/hwmon/pwm-fan.txt b/Documentation/devicetree/bindings/hwmon/pwm-fan.txt
deleted file mode 100644
index 48886f0ce415..000000000000
--- a/Documentation/devicetree/bindings/hwmon/pwm-fan.txt
+++ /dev/null
@@ -1 +0,0 @@
-This file has moved to pwm-fan.yaml.

--
2.40.1


2024-03-21 18:45:01

by Javier Carrasco

[permalink] [raw]
Subject: [PATCH 4/5] dt-bindings: hwmon: stts751: convert to dtschema

Convert existing binding to support validation.

This is a straightforward conversion with no new properties.

Signed-off-by: Javier Carrasco <[email protected]>
---
.../devicetree/bindings/hwmon/st,stts751.yaml | 41 ++++++++++++++++++++++
.../devicetree/bindings/hwmon/stts751.txt | 15 --------
2 files changed, 41 insertions(+), 15 deletions(-)

diff --git a/Documentation/devicetree/bindings/hwmon/st,stts751.yaml b/Documentation/devicetree/bindings/hwmon/st,stts751.yaml
new file mode 100644
index 000000000000..9c825adbed58
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/st,stts751.yaml
@@ -0,0 +1,41 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/st,stts751.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: STTS751 Thermometer
+
+maintainers:
+ - Javier Carrasco <[email protected]>
+
+properties:
+ compatible:
+ const: st,stts751
+
+ reg:
+ maxItems: 1
+
+ smbus-timeout-disable:
+ description:
+ When set, the smbus timeout function will be disabled.
+ $ref: /schemas/types.yaml#/definitions/flag
+
+required:
+ - compatible
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ thermometer@48 {
+ compatible = "st,stts751";
+ reg = <0x48>;
+ smbus-timeout-disable;
+ };
+ };
diff --git a/Documentation/devicetree/bindings/hwmon/stts751.txt b/Documentation/devicetree/bindings/hwmon/stts751.txt
deleted file mode 100644
index 3ee1dc30e72f..000000000000
--- a/Documentation/devicetree/bindings/hwmon/stts751.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-* STTS751 thermometer.
-
-Required node properties:
-- compatible: "stts751"
-- reg: I2C bus address of the device
-
-Optional properties:
-- smbus-timeout-disable: when set, the smbus timeout function will be disabled
-
-Example stts751 node:
-
-temp-sensor {
- compatible = "stts751";
- reg = <0x48>;
-}

--
2.40.1


2024-03-21 18:45:13

by Javier Carrasco

[permalink] [raw]
Subject: [PATCH 5/5] dt-bindings: hwmon: ibm,p8-occ-hwmon: move to trivial devices

This binding meets the requirements to be converted to dtschema
via trivial-devices.yaml.

Signed-off-by: Javier Carrasco <[email protected]>
---
.../devicetree/bindings/hwmon/ibm,p8-occ-hwmon.txt | 25 ----------------------
.../devicetree/bindings/trivial-devices.yaml | 2 ++
2 files changed, 2 insertions(+), 25 deletions(-)

diff --git a/Documentation/devicetree/bindings/hwmon/ibm,p8-occ-hwmon.txt b/Documentation/devicetree/bindings/hwmon/ibm,p8-occ-hwmon.txt
deleted file mode 100644
index 5dc5d2e2573d..000000000000
--- a/Documentation/devicetree/bindings/hwmon/ibm,p8-occ-hwmon.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-Device-tree bindings for I2C-based On-Chip Controller hwmon device
-------------------------------------------------------------------
-
-Required properties:
- - compatible = "ibm,p8-occ-hwmon";
- - reg = <I2C address>; : I2C bus address
-
-Examples:
-
- i2c-bus@100 {
- #address-cells = <1>;
- #size-cells = <0>;
- clock-frequency = <100000>;
- < more properties >
-
- occ-hwmon@1 {
- compatible = "ibm,p8-occ-hwmon";
- reg = <0x50>;
- };
-
- occ-hwmon@2 {
- compatible = "ibm,p8-occ-hwmon";
- reg = <0x51>;
- };
- };
diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
index e07be7bf8395..87b0dd9b0734 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -126,6 +126,8 @@ properties:
- ibm,cffps1
# IBM Common Form Factor Power Supply Versions 2
- ibm,cffps2
+ # IBM On-Chip Controller hwmon device
+ - ibm,p8-occ-hwmon
# Infineon barometric pressure and temperature sensor
- infineon,dps310
# Infineon IR36021 digital POL buck controller

--
2.40.1


2024-03-21 20:50:20

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 2/5] dt-bindings: hwmon: ibmpowernv: convert to dtschema


On Thu, 21 Mar 2024 19:43:43 +0100, Javier Carrasco wrote:
> Convert existing binding to support validation.
>
> This is a straightforward conversion with now new properties.
>
> Signed-off-by: Javier Carrasco <[email protected]>
> ---
> .../devicetree/bindings/hwmon/ibm,powernv.yaml | 37 ++++++++++++++++++++++
> .../devicetree/bindings/hwmon/ibmpowernv.txt | 23 --------------
> 2 files changed, 37 insertions(+), 23 deletions(-)
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/hwmon/ibm,powernv.example.dtb: /example-0/sensor: failed to match any schema with compatible: ['st,stts751']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


2024-03-21 20:50:44

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 4/5] dt-bindings: hwmon: stts751: convert to dtschema


On Thu, 21 Mar 2024 19:43:45 +0100, Javier Carrasco wrote:
> Convert existing binding to support validation.
>
> This is a straightforward conversion with no new properties.
>
> Signed-off-by: Javier Carrasco <[email protected]>
> ---
> .../devicetree/bindings/hwmon/st,stts751.yaml | 41 ++++++++++++++++++++++
> .../devicetree/bindings/hwmon/stts751.txt | 15 --------
> 2 files changed, 41 insertions(+), 15 deletions(-)
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/hwmon/ibm,powernv.example.dtb: sensor: 'reg' is a required property
from schema $id: http://devicetree.org/schemas/hwmon/st,stts751.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/hwmon/ibm,powernv.example.dtb: sensor: 'sensor-id' does not match any of the regexes: 'pinctrl-[0-9]+'
from schema $id: http://devicetree.org/schemas/hwmon/st,stts751.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


2024-03-21 20:54:41

by Javier Carrasco

[permalink] [raw]
Subject: Re: [PATCH 2/5] dt-bindings: hwmon: ibmpowernv: convert to dtschema

On 3/21/24 21:45, Rob Herring wrote:
>
> On Thu, 21 Mar 2024 19:43:43 +0100, Javier Carrasco wrote:
>> Convert existing binding to support validation.
>>
>> This is a straightforward conversion with now new properties.
>>
>> Signed-off-by: Javier Carrasco <[email protected]>
>> ---
>> .../devicetree/bindings/hwmon/ibm,powernv.yaml | 37 ++++++++++++++++++++++
>> .../devicetree/bindings/hwmon/ibmpowernv.txt | 23 --------------
>> 2 files changed, 37 insertions(+), 23 deletions(-)
>>
>
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
>
> yamllint warnings/errors:
>
> dtschema/dtc warnings/errors:
> Documentation/devicetree/bindings/hwmon/ibm,powernv.example.dtb: /example-0/sensor: failed to match any schema with compatible: ['st,stts751']
>

Obvious mistake, this compatible belongs to another patch of the series.

Will be fixed for v2.

> doc reference errors (make refcheckdocs):
>
> See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
>
> The base for the series is generally the latest rc1. A different dependency
> should be noted in *this* patch.
>
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
>
> pip3 install dtschema --upgrade
>
> Please check and re-submit after running the above command yourself. Note
> that DT_SCHEMA_FILES can be set to your schema file to speed up checking
> your schema. However, it must be unset to test all examples with your schema.
>

Best regards,
Javier Carrasco

2024-03-22 02:11:28

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 1/5] dt-bindings: hwmon: as370: convert to dtschema


On Thu, 21 Mar 2024 19:43:42 +0100, Javier Carrasco wrote:
> Convert existing binding to support validation.
>
> This is a straightforward conversion with now new properties.
>
> Signed-off-by: Javier Carrasco <[email protected]>
> ---
> Documentation/devicetree/bindings/hwmon/as370.txt | 11 --------
> .../devicetree/bindings/hwmon/syna,as370.yaml | 32 ++++++++++++++++++++++
> 2 files changed, 32 insertions(+), 11 deletions(-)
>

Reviewed-by: Rob Herring <[email protected]>


2024-03-22 02:12:10

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 5/5] dt-bindings: hwmon: ibm,p8-occ-hwmon: move to trivial devices


On Thu, 21 Mar 2024 19:43:46 +0100, Javier Carrasco wrote:
> This binding meets the requirements to be converted to dtschema
> via trivial-devices.yaml.
>
> Signed-off-by: Javier Carrasco <[email protected]>
> ---
> .../devicetree/bindings/hwmon/ibm,p8-occ-hwmon.txt | 25 ----------------------
> .../devicetree/bindings/trivial-devices.yaml | 2 ++
> 2 files changed, 2 insertions(+), 25 deletions(-)
>

Reviewed-by: Rob Herring <[email protected]>


2024-03-22 02:14:53

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 3/5] dt-bindings: hwmon: pwm-fan: drop text file


On Thu, 21 Mar 2024 19:43:44 +0100, Javier Carrasco wrote:
> This binding was converted to dtschema a year ago.
>
> Signed-off-by: Javier Carrasco <[email protected]>
> ---
> Documentation/devicetree/bindings/hwmon/pwm-fan.txt | 1 -
> 1 file changed, 1 deletion(-)
>

Acked-by: Rob Herring <[email protected]>