2024-02-07 07:48:14

by Dimitri Fedrau

[permalink] [raw]
Subject: [PATCH v3 0/3] iio: humidity: hdc3020: add threshold events support

Based on Fix:
a69eeaad093d "iio: humidity: hdc3020: fix temperature offset" in branch
fixes-togreg

Changes in V2:
- Fix alphabetical order of includes(Christophe)
- Fix typo: change varibale name "HDC3020_R_R_RH_THRESH_LOW_CLR" to
HDC3020_R_T_RH_THRESH_LOW_CLR to match variable name pattern(Christophe)
- Add constants HDC3020_MIN_TEMP and HDC3020_MAX_TEMP for min/max threshold
inputs (Christophe)
- Change HDC3020_MIN_TEMP to -40, as stated in the datasheet(Javier)

Changes in V3:
- drop u8 register pairs and switch to 16bit defines(Jonathan)
- create helper functions to avoid code duplication(Jonathan)
- Add interrupt bindings in example
- use the decimal part for setting thresholds(Javier)
- use return in switch cases hdc3020_read_thresh(Jonathan)
- fix interrupt handler:(Jonathan)
- return IRQ_HANDLED when we get a read back failure
- take the timestamp into a local variable
- fix multiline comments(Jonathan)
- use fixed value "hdc3020" instead of dev_id in probe
- clear interrupt after registering the interrupt handler
- remove interrupt polarity

Dimitri Fedrau (3):
iio: humidity: hdc3020: drop u8 register pairs
dt-bindings: iio: humidity: hdc3020: add interrupt bindings in example
iio: humidity: hdc3020: add threshold events support

.../bindings/iio/humidity/ti,hdc3020.yaml | 2 +
drivers/iio/humidity/hdc3020.c | 443 ++++++++++++------
2 files changed, 309 insertions(+), 136 deletions(-)

--
2.39.2



2024-02-07 07:48:41

by Dimitri Fedrau

[permalink] [raw]
Subject: [PATCH v3 2/3] dt-bindings: iio: humidity: hdc3020: add interrupt bindings in example

Add interrupt bindings in example.

Signed-off-by: Dimitri Fedrau <[email protected]>
---
Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml b/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml
index 7f6d0f9edc75..5b3f9670fa52 100644
--- a/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml
+++ b/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml
@@ -51,5 +51,7 @@ examples:
compatible = "ti,hdc3021", "ti,hdc3020";
reg = <0x47>;
vdd-supply = <&vcc_3v3>;
+ interrupt-parent = <&gpio3>;
+ interrupts = <23 IRQ_TYPE_EDGE_RISING>;
};
};
--
2.39.2


2024-02-07 07:56:07

by Javier Carrasco

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] dt-bindings: iio: humidity: hdc3020: add interrupt bindings in example

Hi Dimitri,

On 07.02.24 08:47, Dimitri Fedrau wrote:
> Add interrupt bindings in example.
>
> Signed-off-by: Dimitri Fedrau <[email protected]>
> ---
> Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml b/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml
> index 7f6d0f9edc75..5b3f9670fa52 100644
> --- a/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml
> +++ b/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml
> @@ -51,5 +51,7 @@ examples:
> compatible = "ti,hdc3021", "ti,hdc3020";
> reg = <0x47>;
> vdd-supply = <&vcc_3v3>;
> + interrupt-parent = <&gpio3>;
> + interrupts = <23 IRQ_TYPE_EDGE_RISING>;
> };
> };

Did you compile the example? I think this will fail because you don't
have the include for IRQ_TYPE_EDGE_RISING.

Best regards,
Javier Carrasco

2024-02-07 08:27:42

by Dimitri Fedrau

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] dt-bindings: iio: humidity: hdc3020: add interrupt bindings in example

Am Wed, Feb 07, 2024 at 08:54:57AM +0100 schrieb Javier Carrasco:
> Hi Dimitri,
>
> On 07.02.24 08:47, Dimitri Fedrau wrote:
> > Add interrupt bindings in example.
> >
> > Signed-off-by: Dimitri Fedrau <[email protected]>
> > ---
> > Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml b/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml
> > index 7f6d0f9edc75..5b3f9670fa52 100644
> > --- a/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml
> > +++ b/Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml
> > @@ -51,5 +51,7 @@ examples:
> > compatible = "ti,hdc3021", "ti,hdc3020";
> > reg = <0x47>;
> > vdd-supply = <&vcc_3v3>;
> > + interrupt-parent = <&gpio3>;
> > + interrupts = <23 IRQ_TYPE_EDGE_RISING>;
> > };
> > };
>
> Did you compile the example? I think this will fail because you don't
> have the include for IRQ_TYPE_EDGE_RISING.
>
Missed that one, thanks. No didn't build the documentation yet. Will do
that.

Best regards,
Dimitri Fedrau

2024-02-07 21:52:21

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v3 2/3] dt-bindings: iio: humidity: hdc3020: add interrupt bindings in example


On Wed, 07 Feb 2024 08:47:52 +0100, Dimitri Fedrau wrote:
> Add interrupt bindings in example.
>
> Signed-off-by: Dimitri Fedrau <[email protected]>
> ---
> Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>

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:
Error: Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.example.dts:33.34-35 syntax error
FATAL ERROR: Unable to parse input tree
make[2]: *** [scripts/Makefile.lib:419: Documentation/devicetree/bindings/iio/humidity/ti,hdc3020.example.dtb] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1428: dt_binding_check] Error 2
make: *** [Makefile:240: __sub-make] Error 2

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.