diff mbox series

[3/3] dt-bindings: <hwmon>: add sht3x devicetree binding

Message ID DB4PR10MB626179DE1C511B10ECA74D209220A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.COM (mailing list archive)
State Changes Requested
Headers show
Series [1/3] hwmon: (sht3x) convert some of sysfs interface to hwmon | expand

Commit Message

JuenKit Yip June 24, 2023, 4:01 p.m. UTC
From: JuenKit Yip <JuenKit_Yip@hotmail.com>

add sht3x devicetree binding files

Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com>
---
 .../devicetree/bindings/hwmon/sht3x.yaml      | 31 +++++++++++++++++++
 .../devicetree/bindings/trivial-devices.yaml  |  4 +++
 2 files changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/sht3x.yaml

Comments

Guenter Roeck June 24, 2023, 4:36 p.m. UTC | #1
On 6/24/23 09:01, JuenKit_Yip@hotmail.com wrote:
> From: JuenKit Yip <JuenKit_Yip@hotmail.com>
> 
> add sht3x devicetree binding files
> 
> Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com>
> ---
>   .../devicetree/bindings/hwmon/sht3x.yaml      | 31 +++++++++++++++++++

This isn't needed if the compatibles are added to trivial-devices.yaml
(and it really only makes sense if there are additional properties
besides compatible).

Guenter

>   .../devicetree/bindings/trivial-devices.yaml  |  4 +++
>   2 files changed, 35 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/hwmon/sht3x.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/sht3x.yaml b/Documentation/devicetree/bindings/hwmon/sht3x.yaml
> new file mode 100644
> index 000000000000..8ff0b8d41f91
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/sht3x.yaml
> @@ -0,0 +1,31 @@
> +# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
> +% YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/hwmon/sensirion,sht3x.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Sensirion SHT3x-DIS humidity and temperature sensor
> +
> +maintainers:
> +  - JuenKit Yip <JuenKit_Yip@hotmail.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - sensirion,sht3x
> +      - sensirion,sts3x
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +addtionalProperties: false
> +
> +examples:
> +  - |
> +    sensor@4a {
> +      compatible = "sensirion,sht3x";
> +      reg = <0x4a>;
> +    };
> diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
> index ba2bfb547909..b2369d1fad68 100644
> --- a/Documentation/devicetree/bindings/trivial-devices.yaml
> +++ b/Documentation/devicetree/bindings/trivial-devices.yaml
> @@ -331,6 +331,10 @@ properties:
>             - sensirion,sgp30
>               # Sensirion gas sensor with I2C interface
>             - sensirion,sgp40
> +            # Sensirion SHT3x-DIS humidity and temperature sensor
> +          - sensirion,sht3x
> +            # Sensirion STS3x humidity sensor
> +          - sensirion,sts3x
>               # Sensirion temperature & humidity sensor with I2C interface
>             - sensirion,sht4x
>               # Sensortek 3 axis accelerometer
Rob Herring (Arm) June 24, 2023, 5:25 p.m. UTC | #2
On Sun, 25 Jun 2023 00:01:48 +0800, JuenKit_Yip@hotmail.com wrote:
> From: JuenKit Yip <JuenKit_Yip@hotmail.com>
> 
> add sht3x devicetree binding files
> 
> Signed-off-by: JuenKit Yip <JuenKit_Yip@hotmail.com>
> ---
>  .../devicetree/bindings/hwmon/sht3x.yaml      | 31 +++++++++++++++++++
>  .../devicetree/bindings/trivial-devices.yaml  |  4 +++
>  2 files changed, 35 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/sht3x.yaml
> 

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:
./Documentation/devicetree/bindings/hwmon/sht3x.yaml:2:2: [error] syntax error: expected alphabetic or numeric character, but found ' ' (syntax)

dtschema/dtc warnings/errors:
make[1]: *** Deleting file 'Documentation/devicetree/bindings/hwmon/sht3x.example.dts'
Documentation/devicetree/bindings/hwmon/sht3x.yaml:2:2: could not find expected directive name
make[1]: *** [Documentation/devicetree/bindings/Makefile:26: Documentation/devicetree/bindings/hwmon/sht3x.example.dts] Error 1
make[1]: *** Waiting for unfinished jobs....
./Documentation/devicetree/bindings/hwmon/sht3x.yaml:2:2: could not find expected directive name
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/hwmon/sht3x.yaml: ignoring, error parsing file
make: *** [Makefile:1512: dt_binding_check] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/DB4PR10MB626179DE1C511B10ECA74D209220A@DB4PR10MB6261.EURPRD10.PROD.OUTLOOK.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.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/hwmon/sht3x.yaml b/Documentation/devicetree/bindings/hwmon/sht3x.yaml
new file mode 100644
index 000000000000..8ff0b8d41f91
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/sht3x.yaml
@@ -0,0 +1,31 @@ 
+# SPDX-License-Identifier: GPL-2.0-only or BSD-2-Clause
+% YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/sensirion,sht3x.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sensirion SHT3x-DIS humidity and temperature sensor
+
+maintainers:
+  - JuenKit Yip <JuenKit_Yip@hotmail.com>
+
+properties:
+  compatible:
+    enum:
+      - sensirion,sht3x
+      - sensirion,sts3x
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+addtionalProperties: false
+
+examples:
+  - |
+    sensor@4a {
+      compatible = "sensirion,sht3x";
+      reg = <0x4a>;
+    };
diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml
index ba2bfb547909..b2369d1fad68 100644
--- a/Documentation/devicetree/bindings/trivial-devices.yaml
+++ b/Documentation/devicetree/bindings/trivial-devices.yaml
@@ -331,6 +331,10 @@  properties:
           - sensirion,sgp30
             # Sensirion gas sensor with I2C interface
           - sensirion,sgp40
+            # Sensirion SHT3x-DIS humidity and temperature sensor
+          - sensirion,sht3x
+            # Sensirion STS3x humidity sensor
+          - sensirion,sts3x
             # Sensirion temperature & humidity sensor with I2C interface
           - sensirion,sht4x
             # Sensortek 3 axis accelerometer