diff mbox series

[04/29] dt-bindings:iio:humidity:dht11 yaml conversion

Message ID 20201011170749.243680-5-jic23@kernel.org (mailing list archive)
State New
Headers show
Series dt-bindings:iio: Another set of yaml conversions. | expand

Commit Message

Jonathan Cameron Oct. 11, 2020, 5:07 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

The conversion is straight forward, but leaves an open question.
The compatible for this device has never had a vendor. I suspect
this because it is non-obvious who actually makes the module. It is
resold by numerous vendors and it may be that there is no single vendor
of the parts they are using.  If anyone has any more info on the
vendor, please let me know and we can add a more informative
compatible.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Harald Geyer <harald@ccbib.org>
---
 .../bindings/iio/humidity/dht11.txt           | 14 -------
 .../bindings/iio/humidity/dht11.yaml          | 41 +++++++++++++++++++
 2 files changed, 41 insertions(+), 14 deletions(-)

Comments

Harald Geyer Oct. 11, 2020, 5:52 p.m. UTC | #1
On 11.10.2020 18:07, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> The conversion is straight forward, but leaves an open question.
> The compatible for this device has never had a vendor. I suspect
> this because it is non-obvious who actually makes the module. It is
> resold by numerous vendors and it may be that there is no single 
> vendor
> of the parts they are using.  If anyone has any more info on the
> vendor, please let me know and we can add a more informative
> compatible.

I think these parts come from Aosong: http://www.aosong.com/en/

The DHT11 uses a custom protocol, so I don't think other vendors
would be using this. Even Aosong started using i2c by now.

On the other hand DHT11 seems to be more of a trade name then a
part identifier. The latter probably would be something like
aosong,am2302 (trade name DHT22).

However the matching between identifiers and trade names is
confusing for the older products. I'm not sure if it is worth
digging into this. Probably only the people at aosong could
clear this up.

Anyway, you have my:
Acked-By: Harald Geyer <harald@ccbib.org>

Thanks,
Harald

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Harald Geyer <harald@ccbib.org>
> ---
>  .../bindings/iio/humidity/dht11.txt           | 14 -------
>  .../bindings/iio/humidity/dht11.yaml          | 41 
> +++++++++++++++++++
>  2 files changed, 41 insertions(+), 14 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/humidity/dht11.txt
> b/Documentation/devicetree/bindings/iio/humidity/dht11.txt
> deleted file mode 100644
> index ecc24c199fd6..000000000000
> --- a/Documentation/devicetree/bindings/iio/humidity/dht11.txt
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -* DHT11 humidity/temperature sensor (and compatibles like DHT22)
> -
> -Required properties:
> -  - compatible: Should be "dht11"
> -  - gpios: Should specify the GPIO connected to the sensor's data
> -    line, see "gpios property" in
> -    Documentation/devicetree/bindings/gpio/gpio.txt.
> -
> -Example:
> -
> -humidity_sensor {
> -	compatible = "dht11";
> -	gpios = <&gpio0 6 0>;
> -}
> diff --git
> a/Documentation/devicetree/bindings/iio/humidity/dht11.yaml
> b/Documentation/devicetree/bindings/iio/humidity/dht11.yaml
> new file mode 100644
> index 000000000000..38ec4c302760
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/humidity/dht11.yaml
> @@ -0,0 +1,41 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/humidity/dht11.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: DHT11 humidity + temperature sensor
> +
> +maintainers:
> +  - Harald Geyer <harald@ccbib.org>
> +
> +description: |
> +   A simple and low cost module providing a non standard single GPIO 
> based
> +   interface.  Whilst commonly available it is not easy to establish
> if there
> +   is a single manufacturer for this part.
> +
> +properties:
> +  compatible:
> +    const: dht11
> +
> +  reg:
> +    maxItems: 1
> +
> +  gpios:
> +    maxItems: 1
> +    description:
> +      Single, interrupt capable, GPIO used to communicate with the 
> device.
> +
> +required:
> +  - compatible
> +  - gpios
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    humidity_sensor {
> +        compatible = "dht11";
> +        gpios = <&gpio0 6 0>;
> +    };
> +...
Jonathan Cameron Oct. 12, 2020, 2:29 p.m. UTC | #2
On Sun, 11 Oct 2020 18:52:48 +0100
Harald Geyer <harald@ccbib.org> wrote:

> On 11.10.2020 18:07, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > The conversion is straight forward, but leaves an open question.
> > The compatible for this device has never had a vendor. I suspect
> > this because it is non-obvious who actually makes the module. It is
> > resold by numerous vendors and it may be that there is no single 
> > vendor
> > of the parts they are using.  If anyone has any more info on the
> > vendor, please let me know and we can add a more informative
> > compatible.  
> 
> I think these parts come from Aosong: http://www.aosong.com/en/
> 
> The DHT11 uses a custom protocol, so I don't think other vendors
> would be using this. Even Aosong started using i2c by now.
> 
> On the other hand DHT11 seems to be more of a trade name then a
> part identifier. The latter probably would be something like
> aosong,am2302 (trade name DHT22).
> 
> However the matching between identifiers and trade names is
> confusing for the older products. I'm not sure if it is worth
> digging into this. Probably only the people at aosong could
> clear this up.

Probably worth adding a note to the binding doc so I'll do that
whilst applying or for a v2 if needed.  Thanks for the info!

> 
> Anyway, you have my:
> Acked-By: Harald Geyer <harald@ccbib.org>
> 
> Thanks,
> Harald
> 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Harald Geyer <harald@ccbib.org>
> > ---
> >  .../bindings/iio/humidity/dht11.txt           | 14 -------
> >  .../bindings/iio/humidity/dht11.yaml          | 41 
> > +++++++++++++++++++
> >  2 files changed, 41 insertions(+), 14 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/humidity/dht11.txt
> > b/Documentation/devicetree/bindings/iio/humidity/dht11.txt
> > deleted file mode 100644
> > index ecc24c199fd6..000000000000
> > --- a/Documentation/devicetree/bindings/iio/humidity/dht11.txt
> > +++ /dev/null
> > @@ -1,14 +0,0 @@
> > -* DHT11 humidity/temperature sensor (and compatibles like DHT22)
> > -
> > -Required properties:
> > -  - compatible: Should be "dht11"
> > -  - gpios: Should specify the GPIO connected to the sensor's data
> > -    line, see "gpios property" in
> > -    Documentation/devicetree/bindings/gpio/gpio.txt.
> > -
> > -Example:
> > -
> > -humidity_sensor {
> > -	compatible = "dht11";
> > -	gpios = <&gpio0 6 0>;
> > -}
> > diff --git
> > a/Documentation/devicetree/bindings/iio/humidity/dht11.yaml
> > b/Documentation/devicetree/bindings/iio/humidity/dht11.yaml
> > new file mode 100644
> > index 000000000000..38ec4c302760
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/humidity/dht11.yaml
> > @@ -0,0 +1,41 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/humidity/dht11.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: DHT11 humidity + temperature sensor
> > +
> > +maintainers:
> > +  - Harald Geyer <harald@ccbib.org>
> > +
> > +description: |
> > +   A simple and low cost module providing a non standard single GPIO 
> > based
> > +   interface.  Whilst commonly available it is not easy to establish
> > if there
> > +   is a single manufacturer for this part.
> > +
> > +properties:
> > +  compatible:
> > +    const: dht11
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  gpios:
> > +    maxItems: 1
> > +    description:
> > +      Single, interrupt capable, GPIO used to communicate with the 
> > device.
> > +
> > +required:
> > +  - compatible
> > +  - gpios
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    humidity_sensor {
> > +        compatible = "dht11";
> > +        gpios = <&gpio0 6 0>;
> > +    };
> > +...  
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/humidity/dht11.txt b/Documentation/devicetree/bindings/iio/humidity/dht11.txt
deleted file mode 100644
index ecc24c199fd6..000000000000
--- a/Documentation/devicetree/bindings/iio/humidity/dht11.txt
+++ /dev/null
@@ -1,14 +0,0 @@ 
-* DHT11 humidity/temperature sensor (and compatibles like DHT22)
-
-Required properties:
-  - compatible: Should be "dht11"
-  - gpios: Should specify the GPIO connected to the sensor's data
-    line, see "gpios property" in
-    Documentation/devicetree/bindings/gpio/gpio.txt.
-
-Example:
-
-humidity_sensor {
-	compatible = "dht11";
-	gpios = <&gpio0 6 0>;
-}
diff --git a/Documentation/devicetree/bindings/iio/humidity/dht11.yaml b/Documentation/devicetree/bindings/iio/humidity/dht11.yaml
new file mode 100644
index 000000000000..38ec4c302760
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/humidity/dht11.yaml
@@ -0,0 +1,41 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/humidity/dht11.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: DHT11 humidity + temperature sensor
+
+maintainers:
+  - Harald Geyer <harald@ccbib.org>
+
+description: |
+   A simple and low cost module providing a non standard single GPIO based
+   interface.  Whilst commonly available it is not easy to establish if there
+   is a single manufacturer for this part.
+
+properties:
+  compatible:
+    const: dht11
+
+  reg:
+    maxItems: 1
+
+  gpios:
+    maxItems: 1
+    description:
+      Single, interrupt capable, GPIO used to communicate with the device.
+
+required:
+  - compatible
+  - gpios
+
+additionalProperties: false
+
+examples:
+  - |
+    humidity_sensor {
+        compatible = "dht11";
+        gpios = <&gpio0 6 0>;
+    };
+...