diff mbox series

[2/5] dt-bindings: hwmon: Document adt7475 bypass-attenuator property

Message ID 20200217234657.9413-3-chris.packham@alliedtelesis.co.nz (mailing list archive)
State Superseded
Headers show
Series hwmon: (adt7475) attenuator bypass and pwm invert | expand

Commit Message

Chris Packham Feb. 17, 2020, 11:46 p.m. UTC
From: Logan Shaw <logan.shaw@alliedtelesis.co.nz>

Add documentation for the bypass-attenuator-in[0-4] property.

Signed-off-by: Logan Shaw <logan.shaw@alliedtelesis.co.nz>
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
 .../devicetree/bindings/hwmon/adt7475.yaml          | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Rob Herring (Arm) Feb. 18, 2020, 8:24 p.m. UTC | #1
On Tue, 18 Feb 2020 12:46:54 +1300, Chris Packham wrote:
> 
> From: Logan Shaw <logan.shaw@alliedtelesis.co.nz>
> 
> Add documentation for the bypass-attenuator-in[0-4] property.
> 
> Signed-off-by: Logan Shaw <logan.shaw@alliedtelesis.co.nz>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
>  .../devicetree/bindings/hwmon/adt7475.yaml          | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 

My bot found errors running 'make dt_binding_check' on your patch:

/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/adt7475.yaml: patternProperties:^bypass-attenuator-in[0-4]$:maximum: False schema does not allow 1
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/adt7475.yaml: patternProperties:^bypass-attenuator-in[0-4]$:minimum: False schema does not allow 0
Documentation/devicetree/bindings/Makefile:12: recipe for target 'Documentation/devicetree/bindings/hwmon/adt7475.example.dts' failed
make[1]: *** [Documentation/devicetree/bindings/hwmon/adt7475.example.dts] Error 1
Makefile:1263: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2

See https://patchwork.ozlabs.org/patch/1239694
Please check and re-submit.
Chris Packham Feb. 18, 2020, 8:52 p.m. UTC | #2
On Tue, 2020-02-18 at 14:24 -0600, Rob Herring wrote:
> On Tue, 18 Feb 2020 12:46:54 +1300, Chris Packham wrote:
> > 
> > From: Logan Shaw <logan.shaw@alliedtelesis.co.nz>
> > 
> > Add documentation for the bypass-attenuator-in[0-4] property.
> > 
> > Signed-off-by: Logan Shaw <logan.shaw@alliedtelesis.co.nz>
> > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> > ---
> >  .../devicetree/bindings/hwmon/adt7475.yaml          | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> 
> My bot found errors running 'make dt_binding_check' on your patch:
> 
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/adt7475.yaml: patternProperties:^bypass-attenuator-in[0-4]$:maximum: False schema does not allow 1
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/adt7475.yaml: patternProperties:^bypass-attenuator-in[0-4]$:minimum: False schema does not allow 0
> Documentation/devicetree/bindings/Makefile:12: recipe for target 'Documentation/devicetree/bindings/hwmon/adt7475.example.dts' failed
> make[1]: *** [Documentation/devicetree/bindings/hwmon/adt7475.example.dts] Error 1
> Makefile:1263: recipe for target 'dt_binding_check' failed
> make: *** [dt_binding_check] Error 2
> 

I still must be doing something wrong. I did run 

  make mrproper
  make ARCH=arm defconfig
  make ARCH=arm dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/hwmon/adt7475.yaml

which passes without error.

When I run 

  make mrproper
  make ARCH=arm defconfig
  make ARCH=arm dt_binding_check

I get errors in unrelated files

e.g.

  /home/chrisp/src/linux/Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-apb1-clk.yaml: Additional properties are not allowed ('deprecated' was unexpected)
  Documentation/devicetree/bindings/Makefile:12: recipe for target 'Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-apb1-clk.example.dts' failed
  make[1]: *** [Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-apb1-clk.example.dts] Error 1
  Makefile:1262: recipe for target 'dt_binding_check' failed

My local branch is based on commit 0a679e13ea30 ("Merge branch 'for-
5.6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup")
do I need to be running against something else?

> See https://patchwork.ozlabs.org/patch/1239694
> Please check and re-submit.
Chris Packham Feb. 18, 2020, 11:24 p.m. UTC | #3
On Wed, 2020-02-19 at 09:52 +1300, Chris Packham wrote:
> On Tue, 2020-02-18 at 14:24 -0600, Rob Herring wrote:
> > On Tue, 18 Feb 2020 12:46:54 +1300, Chris Packham wrote:
> > > 
> > > From: Logan Shaw <logan.shaw@alliedtelesis.co.nz>
> > > 
> > > Add documentation for the bypass-attenuator-in[0-4] property.
> > > 
> > > Signed-off-by: Logan Shaw <logan.shaw@alliedtelesis.co.nz>
> > > Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> > > ---
> > >  .../devicetree/bindings/hwmon/adt7475.yaml          | 13 +++++++++++++
> > >  1 file changed, 13 insertions(+)
> > > 
> > 
> > My bot found errors running 'make dt_binding_check' on your patch:
> > 
> > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/adt7475.yaml: patternProperties:^bypass-attenuator-in[0-4]$:maximum: False schema does not allow 1
> > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/adt7475.yaml: patternProperties:^bypass-attenuator-in[0-4]$:minimum: False schema does not allow 0
> > Documentation/devicetree/bindings/Makefile:12: recipe for target 'Documentation/devicetree/bindings/hwmon/adt7475.example.dts' failed
> > make[1]: *** [Documentation/devicetree/bindings/hwmon/adt7475.example.dts] Error 1
> > Makefile:1263: recipe for target 'dt_binding_check' failed
> > make: *** [dt_binding_check] Error 2
> > 
> 
> I still must be doing something wrong. I did run 
> 
>   make mrproper
>   make ARCH=arm defconfig
>   make ARCH=arm dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/hwmon/adt7475.yaml
> 
> which passes without error.
> 
> When I run 
> 
>   make mrproper
>   make ARCH=arm defconfig
>   make ARCH=arm dt_binding_check
> 
> I get errors in unrelated files
> 
> e.g.
> 
>   /home/chrisp/src/linux/Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-apb1-clk.yaml: Additional properties are not allowed ('deprecated' was unexpected)
>   Documentation/devicetree/bindings/Makefile:12: recipe for target 'Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-apb1-clk.example.dts' failed
>   make[1]: *** [Documentation/devicetree/bindings/clock/allwinner,sun4i-a10-apb1-clk.example.dts] Error 1
>   Makefile:1262: recipe for target 'dt_binding_check' failed
> 
> My local branch is based on commit 0a679e13ea30 ("Merge branch 'for-
> 5.6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup")
> do I need to be running against something else?
> 

Ah I think I've got it

pip3 install --user git+https://github.com/devicetree-org/dt-schema.git@master

Let's me see the errors. Now I just need to understand them :).

> > See https://patchwork.ozlabs.org/patch/1239694
> > Please check and re-submit.
Rob Herring Feb. 20, 2020, 8:01 p.m. UTC | #4
On Mon, Feb 17, 2020 at 5:47 PM Chris Packham
<chris.packham@alliedtelesis.co.nz> wrote:
>
> From: Logan Shaw <logan.shaw@alliedtelesis.co.nz>
>
> Add documentation for the bypass-attenuator-in[0-4] property.
>
> Signed-off-by: Logan Shaw <logan.shaw@alliedtelesis.co.nz>
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
>  .../devicetree/bindings/hwmon/adt7475.yaml          | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/hwmon/adt7475.yaml b/Documentation/devicetree/bindings/hwmon/adt7475.yaml
> index 2252499ea201..61da90c82649 100644
> --- a/Documentation/devicetree/bindings/hwmon/adt7475.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/adt7475.yaml
> @@ -39,6 +39,17 @@ properties:
>    reg:
>      maxItems: 1
>
> +patternProperties:
> +  "^bypass-attenuator-in[0-4]$":
> +    maxItems: 1
> +    minimum: 0
> +    maximum: 1

The errors here are because you are mixing array and scalar constraints.

You also need a vendor prefix and a type $ref.

> +    description: |
> +      Configures bypassing the individual voltage input attenuator. If
> +      set to 1 the attenuator is bypassed if set to 0 the attenuator is
> +      not bypassed. If the property is absent then the attenuator
> +      retains it's configuration from the bios/bootloader.
> +
>  required:
>    - compatible
>    - reg
> @@ -52,6 +63,8 @@ examples:
>        hwmon@2e {
>          compatible = "adi,adt7476";
>          reg = <0x2e>;
> +        bypass-attenuator-in0 = <1>;
> +        bypass-attenuator-in1 = <0>;
>        };
>      };
>
> --
> 2.25.0
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/hwmon/adt7475.yaml b/Documentation/devicetree/bindings/hwmon/adt7475.yaml
index 2252499ea201..61da90c82649 100644
--- a/Documentation/devicetree/bindings/hwmon/adt7475.yaml
+++ b/Documentation/devicetree/bindings/hwmon/adt7475.yaml
@@ -39,6 +39,17 @@  properties:
   reg:
     maxItems: 1
 
+patternProperties:
+  "^bypass-attenuator-in[0-4]$":
+    maxItems: 1
+    minimum: 0
+    maximum: 1
+    description: |
+      Configures bypassing the individual voltage input attenuator. If
+      set to 1 the attenuator is bypassed if set to 0 the attenuator is
+      not bypassed. If the property is absent then the attenuator
+      retains it's configuration from the bios/bootloader.
+
 required:
   - compatible
   - reg
@@ -52,6 +63,8 @@  examples:
       hwmon@2e {
         compatible = "adi,adt7476";
         reg = <0x2e>;
+        bypass-attenuator-in0 = <1>;
+        bypass-attenuator-in1 = <0>;
       };
     };