Message ID | 20200422141135.86419-6-tomasz.duszynski@octakon.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add support for SCD30 sensor | expand |
On Wed, 22 Apr 2020 16:11:34 +0200 Tomasz Duszynski <tomasz.duszynski@octakon.com> wrote: > Add SCD30 sensor binding file. > > Signed-off-by: Tomasz Duszynski <tomasz.duszynski@octakon.com> > --- > .../iio/chemical/sensirion,scd30.yaml | 71 +++++++++++++++++++ > 1 file changed, 71 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml > > diff --git a/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml b/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml > new file mode 100644 > index 000000000000..b092b2530c76 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml > @@ -0,0 +1,71 @@ > +# SPDX-License-Identifier: GPL-2.0 Dual license preferred with BSD for bindings. > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/chemical/sensirion,scd30.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Sensirion SCD30 carbon dioxide sensor > + > +maintainers: > + - Tomasz Duszynski <tomasz.duszynski@octakon.com> > + > +description: | > + Air quality sensor capable of measuring co2 concentration, temperature > + and relative humidity. > + > +properties: > + compatible: > + enum: > + - sensirion,scd30 > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + vdd-supply: true > + > + sensirion,sel-gpios: > + description: GPIO connected to the SEL line > + maxItems: 1 > + > + sensirion,pwm-gpios: > + description: GPIO connected to the PWM line > + maxItems: 1 > + > +required: > + - compatible > + - vdd-supply Only enable it I think in the driver. Should be fine with a stub regulator as provided if we don't specify one in the dt binding because it's not controllable and we are lazy. > + > +additionalProperties: false > + > +examples: > + - | > + # include <dt-bindings/gpio/gpio.h> > + # include <dt-bindings/interrupt-controller/irq.h> > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + scd30@61 { > + compatible = "sensirion,scd30"; > + reg = <0x61>; > + vdd-supply = <&vdd>; > + interrupt-parrent = <&gpio0>; > + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; > + }; > + }; > + - | > + # include <dt-bindings/gpio/gpio.h> Why gpio? > + # include <dt-bindings/interrupt-controller/irq.h> > + serial { > + scd30 { > + compatible = "sensirion,scd30"; > + vdd-supply = <&vdd>; > + interrupt-parrent = <&gpio0>; > + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; > + }; > + }; > + > +...
On Sat, Apr 25, 2020 at 08:23:41PM +0100, Jonathan Cameron wrote: > On Wed, 22 Apr 2020 16:11:34 +0200 > Tomasz Duszynski <tomasz.duszynski@octakon.com> wrote: > > > Add SCD30 sensor binding file. > > > > Signed-off-by: Tomasz Duszynski <tomasz.duszynski@octakon.com> > > --- > > .../iio/chemical/sensirion,scd30.yaml | 71 +++++++++++++++++++ > > 1 file changed, 71 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml > > > > diff --git a/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml b/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml > > new file mode 100644 > > index 000000000000..b092b2530c76 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml > > @@ -0,0 +1,71 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > Dual license preferred with BSD for bindings. > Okay. > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/iio/chemical/sensirion,scd30.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Sensirion SCD30 carbon dioxide sensor > > + > > +maintainers: > > + - Tomasz Duszynski <tomasz.duszynski@octakon.com> > > + > > +description: | > > + Air quality sensor capable of measuring co2 concentration, temperature > > + and relative humidity. > > + > > +properties: > > + compatible: > > + enum: > > + - sensirion,scd30 > > + > > + reg: > > + maxItems: 1 > > + > > + interrupts: > > + maxItems: 1 > > + > > + vdd-supply: true > > + > > + sensirion,sel-gpios: > > + description: GPIO connected to the SEL line > > + maxItems: 1 > > + > > + sensirion,pwm-gpios: > > + description: GPIO connected to the PWM line > > + maxItems: 1 > > + > > +required: > > + - compatible > > + - vdd-supply > > Only enable it I think in the driver. Should be fine with a stub regulator > as provided if we don't specify one in the dt binding because it's not > controllable and we are lazy. > > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + # include <dt-bindings/gpio/gpio.h> > > + # include <dt-bindings/interrupt-controller/irq.h> > > + i2c { > > + #address-cells = <1>; > > + #size-cells = <0>; > > + > > + scd30@61 { > > + compatible = "sensirion,scd30"; > > + reg = <0x61>; > > + vdd-supply = <&vdd>; > > + interrupt-parrent = <&gpio0>; > > + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; > > + }; > > + }; > > + - | > > + # include <dt-bindings/gpio/gpio.h> > > Why gpio? > That shouldn't be here. I have some local changes where I use sel-gpios hence this include. > > + # include <dt-bindings/interrupt-controller/irq.h> > > + serial { > > + scd30 { > > + compatible = "sensirion,scd30"; > > + vdd-supply = <&vdd>; > > + interrupt-parrent = <&gpio0>; > > + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; > > + }; > > + }; > > + > > +... >
On Wed, 22 Apr 2020 16:11:34 +0200, Tomasz Duszynski wrote: > Add SCD30 sensor binding file. > > Signed-off-by: Tomasz Duszynski <tomasz.duszynski@octakon.com> > --- > .../iio/chemical/sensirion,scd30.yaml | 71 +++++++++++++++++++ > 1 file changed, 71 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml > My bot found errors running 'make dt_binding_check' on your patch: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.example.dt.yaml: scd30@61: 'interrupt-parrent' does not match any of the regexes: 'pinctrl-[0-9]+' /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.example.dt.yaml: scd30: 'interrupt-parrent' does not match any of the regexes: 'pinctrl-[0-9]+' See https://patchwork.ozlabs.org/patch/1275131 If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure dt-schema is up to date: pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade Please check and re-submit.
On Mon, Apr 27, 2020 at 04:28:26PM -0500, Rob Herring wrote: > On Wed, 22 Apr 2020 16:11:34 +0200, Tomasz Duszynski wrote: > > Add SCD30 sensor binding file. > > > > Signed-off-by: Tomasz Duszynski <tomasz.duszynski@octakon.com> > > --- > > .../iio/chemical/sensirion,scd30.yaml | 71 +++++++++++++++++++ > > 1 file changed, 71 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml > > > > My bot found errors running 'make dt_binding_check' on your patch: > > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.example.dt.yaml: scd30@61: 'interrupt-parrent' does not match any of the regexes: 'pinctrl-[0-9]+' > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.example.dt.yaml: scd30: 'interrupt-parrent' does not match any of the regexes: 'pinctrl-[0-9]+' Well, a typo here. > > See https://patchwork.ozlabs.org/patch/1275131 > > If you already ran 'make dt_binding_check' and didn't see the above > error(s), then make sure dt-schema is up to date: > > pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade > > Please check and re-submit.
diff --git a/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml b/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml new file mode 100644 index 000000000000..b092b2530c76 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/chemical/sensirion,scd30.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sensirion SCD30 carbon dioxide sensor + +maintainers: + - Tomasz Duszynski <tomasz.duszynski@octakon.com> + +description: | + Air quality sensor capable of measuring co2 concentration, temperature + and relative humidity. + +properties: + compatible: + enum: + - sensirion,scd30 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: true + + sensirion,sel-gpios: + description: GPIO connected to the SEL line + maxItems: 1 + + sensirion,pwm-gpios: + description: GPIO connected to the PWM line + maxItems: 1 + +required: + - compatible + - vdd-supply + +additionalProperties: false + +examples: + - | + # include <dt-bindings/gpio/gpio.h> + # include <dt-bindings/interrupt-controller/irq.h> + i2c { + #address-cells = <1>; + #size-cells = <0>; + + scd30@61 { + compatible = "sensirion,scd30"; + reg = <0x61>; + vdd-supply = <&vdd>; + interrupt-parrent = <&gpio0>; + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; + }; + }; + - | + # include <dt-bindings/gpio/gpio.h> + # include <dt-bindings/interrupt-controller/irq.h> + serial { + scd30 { + compatible = "sensirion,scd30"; + vdd-supply = <&vdd>; + interrupt-parrent = <&gpio0>; + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; + }; + }; + +...
Add SCD30 sensor binding file. Signed-off-by: Tomasz Duszynski <tomasz.duszynski@octakon.com> --- .../iio/chemical/sensirion,scd30.yaml | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/chemical/sensirion,scd30.yaml