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

2024-03-21 Thread Javier Carrasco
Convert existing binding to support validation.

This is a straightforward conversion with no new properties.

Signed-off-by: Javier Carrasco 
---
 .../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 ..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 
+
+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..
--- 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



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

2024-03-21 Thread Rob Herring


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 
> ---
>  .../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/20240321-hwmon_dtschema-v1-4-96c3810c3...@gmail.com

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.