[1/2] dt-bindings: iio: temperature: Add AMS AS6200

Message ID 7e108db19cd9ad19b6413f65099280c010325a91.1699740057.git.alkuor@gmail.com
State New
Headers
Series [1/2] dt-bindings: iio: temperature: Add AMS AS6200 |

Commit Message

Abdel Alkuor Nov. 11, 2023, 10:05 p.m. UTC
  as6200 is high accuracy temperature sensor of -/+ 0.4C degree
with a range between -40C to 125C degrees

Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
---
 .../bindings/iio/temperature/ams,as6200.yaml  | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml
  

Comments

Krzysztof Kozlowski Nov. 12, 2023, 7:43 a.m. UTC | #1
On 11/11/2023 23:05, Abdel Alkuor wrote:
> as6200 is high accuracy temperature sensor of -/+ 0.4C degree
> with a range between -40C to 125C degrees
> 
> Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
> ---
>  .../bindings/iio/temperature/ams,as6200.yaml  | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)

I did not receive the driver, so I hope you actually implement the
binding accurately.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
  
Abdel Alkuor Nov. 12, 2023, 2:12 p.m. UTC | #2
On Sun, Nov 12, 2023 at 08:43:53AM +0100, Krzysztof Kozlowski wrote:
> On 11/11/2023 23:05, Abdel Alkuor wrote:
> > as6200 is high accuracy temperature sensor of -/+ 0.4C degree
> > with a range between -40C to 125C degrees
> > 
> > Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
> > ---
> >  .../bindings/iio/temperature/ams,as6200.yaml  | 45 +++++++++++++++++++
> >  1 file changed, 45 insertions(+)
> 
> I did not receive the driver, so I hope you actually implement the
> binding accurately.
>
Sorry about not including you in the driver patch as I was
experimenting with adding tocmd and cccmd in my .gitconfig and it
looks like the commands ran for each patch individually and only
included the required recipents for each patch instead of amalgamating
them.

Here is the driver: https://lkml.org/lkml/2023/11/11/208
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> Best regards,
> Krzysztof
>
Thanks,
Abdel
  
Jonathan Cameron Nov. 26, 2023, 5:30 p.m. UTC | #3
On Sat, 11 Nov 2023 17:05:01 -0500
Abdel Alkuor <alkuor@gmail.com> wrote:

> as6200 is high accuracy temperature sensor of -/+ 0.4C degree
> with a range between -40C to 125C degrees
> 
Hi Abdel,

Welcome to IIO.  Just one comment on specifying power supplies below.

Jonathan


> Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
> ---
>  .../bindings/iio/temperature/ams,as6200.yaml  | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml
> 
> diff --git a/Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml b/Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml
> new file mode 100644
> index 000000000000..97a73b92a789
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/temperature/ams,as6200.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: AMS AS6200 Temperature Sensor
> +
> +maintainers:
> +  - Abdel Alkuor <alkuor@gmail.com>
> +
> +description: |
> +  https://ams.com/documents/20143/36005/AS6200_DS000449_4-00.pdf
> +
> +properties:
> +  compatible:
> +    const: ams,as6200
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1

I'd like to see
vdd-supply: true
and it added to teh required list.

The device needs power. Note there is
a devm_regulator_get_enable() function that can then be used in the driver to turn
on any regulator specified in DT which will provide a stub regulator if there isn't
one (not unusual if a fixed power supply is used that is always on).

> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        temperature-sensor@48 {
> +            compatible = "ams,as6200";
> +            reg = <0x48>;
> +            interrupt-parent = <&gpio1>;
> +            interrupts = <17 IRQ_TYPE_EDGE_BOTH>;
> +        };
> +    };
> +...
  
Abdel Alkuor Nov. 30, 2023, 12:39 a.m. UTC | #4
On Sun, Nov 26, 2023 at 05:30:02PM +0000, Jonathan Cameron wrote:
> On Sat, 11 Nov 2023 17:05:01 -0500
> Abdel Alkuor <alkuor@gmail.com> wrote:
> 
> > as6200 is high accuracy temperature sensor of -/+ 0.4C degree
> > with a range between -40C to 125C degrees
> > 
> Hi Abdel,
> 
> Welcome to IIO.  Just one comment on specifying power supplies below.
>
Hi Jonathan,

Thank you for the warm welcome :D

> Jonathan
> 
> 
> > Signed-off-by: Abdel Alkuor <alkuor@gmail.com>
> > ---
> >  .../bindings/iio/temperature/ams,as6200.yaml  | 45 +++++++++++++++++++
> >  1 file changed, 45 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml b/Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml
> > new file mode 100644
> > index 000000000000..97a73b92a789
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml
> > @@ -0,0 +1,45 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/temperature/ams,as6200.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: AMS AS6200 Temperature Sensor
> > +
> > +maintainers:
> > +  - Abdel Alkuor <alkuor@gmail.com>
> > +
> > +description: |
> > +  https://ams.com/documents/20143/36005/AS6200_DS000449_4-00.pdf
> > +
> > +properties:
> > +  compatible:
> > +    const: ams,as6200
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> 
> I'd like to see
> vdd-supply: true
> and it added to teh required list.
> 
> The device needs power. Note there is
> a devm_regulator_get_enable() function that can then be used in the driver to turn
> on any regulator specified in DT which will provide a stub regulator if there isn't
> one (not unusual if a fixed power supply is used that is always on).
>
Sounds good. I'll add it.
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        temperature-sensor@48 {
> > +            compatible = "ams,as6200";
> > +            reg = <0x48>;
> > +            interrupt-parent = <&gpio1>;
> > +            interrupts = <17 IRQ_TYPE_EDGE_BOTH>;
> > +        };
> > +    };
> > +...
>
  

Patch

diff --git a/Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml b/Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml
new file mode 100644
index 000000000000..97a73b92a789
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/temperature/ams,as6200.yaml
@@ -0,0 +1,45 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/temperature/ams,as6200.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AMS AS6200 Temperature Sensor
+
+maintainers:
+  - Abdel Alkuor <alkuor@gmail.com>
+
+description: |
+  https://ams.com/documents/20143/36005/AS6200_DS000449_4-00.pdf
+
+properties:
+  compatible:
+    const: ams,as6200
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        temperature-sensor@48 {
+            compatible = "ams,as6200";
+            reg = <0x48>;
+            interrupt-parent = <&gpio1>;
+            interrupts = <17 IRQ_TYPE_EDGE_BOTH>;
+        };
+    };
+...