diff mbox series

[6/6] dt-bindings: iio/adc: ingenic: add the JZ4760(B) socs to the sadc Documentation

Message ID 20210721105317.36742-7-cbranchereau@gmail.com (mailing list archive)
State Superseded
Headers show
Series [1/6] iio/adc: ingenic: rename has_aux2 to has_aux_md | expand

Commit Message

Christophe Branchereau July 21, 2021, 10:53 a.m. UTC
Signed-off-by: citral23 <cbranchereau@gmail.com>
---
 .../devicetree/bindings/iio/adc/ingenic,adc.yaml         | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Paul Cercueil July 21, 2021, 7:17 p.m. UTC | #1
Hi Christophe,

Please always add a short description in your patches, even if all you 
do is repeat the patch title.


Le mer., juil. 21 2021 at 12:53:17 +0200, citral23 
<cbranchereau@gmail.com> a écrit :
> Signed-off-by: citral23 <cbranchereau@gmail.com>
> ---
>  .../devicetree/bindings/iio/adc/ingenic,adc.yaml         | 9 
> +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git 
> a/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml 
> b/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml
> index 433a3fb55a2e..1b423adba61d 100644
> --- a/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml
> @@ -23,6 +23,8 @@ properties:
>      enum:
>        - ingenic,jz4725b-adc
>        - ingenic,jz4740-adc
> +      - ingenic,jz4760-adc
> +      - ingenic,jz4760b-adc
>        - ingenic,jz4770-adc
> 
>    '#io-channel-cells':
> @@ -43,6 +45,12 @@ properties:
>    interrupts:
>      maxItems: 1
> 
> +  ingenic,use-internal-divider:
> +    description:
> +      This property can be used to set VBAT_SEL in the JZ4760B CFG 
> register
> +      to sample the battery voltage from the internal divider. If 
> absent, it
> +      will sample the external divider.

Please remove trailing spaces. And you don't need to describe internal 
behaviour; you only need to explain the functionality in a user-facing 
perspective. Something like:

"If present, battery voltage is read from the VBAT_IR pin, which has an 
internal /4 divider. If absent, it is read through the VBAT_ER pin, 
which does not have such divider."

You also don't specify the type of the property, please add "type: 
boolean" before the description.

There should also be a way to make sure that this property can only be 
used with the JZ4760B SoC. So a dependency for this vendor property on 
the "ingenic,jz4760b-adc" compatible string. But I'm honestly not sure 
how to express that... Maybe Rob can help.

> +
>  required:
>    - compatible
>    - '#io-channel-cells'
> @@ -53,6 +61,7 @@ required:
> 
>  additionalProperties: false
> 
> +

Remove the extra newline.

Cheers,
-Paul

>  examples:
>    - |
>      #include <dt-bindings/clock/jz4740-cgu.h>
> --
> 2.30.2
>
Rob Herring (Arm) July 22, 2021, 2:09 a.m. UTC | #2
On Wed, 21 Jul 2021 12:53:17 +0200, citral23 wrote:
> Signed-off-by: citral23 <cbranchereau@gmail.com>
> ---
>  .../devicetree/bindings/iio/adc/ingenic,adc.yaml         | 9 +++++++++
>  1 file changed, 9 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:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml: properties:ingenic,use-internal-divider: 'oneOf' conditional failed, one must be fixed:
	'type' is a required property
		hint: A vendor boolean property can use "type: boolean"
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml: properties:ingenic,use-internal-divider: 'oneOf' conditional failed, one must be fixed:
		'enum' is a required property
		'const' is a required property
		hint: A vendor string property with exact values has an implicit type
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml: properties:ingenic,use-internal-divider: 'oneOf' conditional failed, one must be fixed:
		'$ref' is a required property
		'allOf' is a required property
		hint: A vendor property needs a $ref to types.yaml
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
	from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml: ignoring, error in schema: properties: ingenic,use-internal-divider
warning: no schema found in file: ./Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml
Documentation/devicetree/bindings/iio/adc/ingenic,adc.example.dt.yaml:0:0: /example-0/adc@10070000: failed to match any schema with compatible: ['ingenic,jz4740-adc']
\ndoc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1508137

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

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.
Jonathan Cameron July 23, 2021, 4:10 p.m. UTC | #3
On Wed, 21 Jul 2021 20:17:45 +0100
Paul Cercueil <paul@crapouillou.net> wrote:

> Hi Christophe,
> 
> Please always add a short description in your patches, even if all you 
> do is repeat the patch title.
> 
> 
> Le mer., juil. 21 2021 at 12:53:17 +0200, citral23 
> <cbranchereau@gmail.com> a écrit :
> > Signed-off-by: citral23 <cbranchereau@gmail.com>
> > ---
> >  .../devicetree/bindings/iio/adc/ingenic,adc.yaml         | 9 
> > +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git 
> > a/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml 
> > b/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml
> > index 433a3fb55a2e..1b423adba61d 100644
> > --- a/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml
> > +++ b/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml
> > @@ -23,6 +23,8 @@ properties:
> >      enum:
> >        - ingenic,jz4725b-adc
> >        - ingenic,jz4740-adc
> > +      - ingenic,jz4760-adc
> > +      - ingenic,jz4760b-adc
> >        - ingenic,jz4770-adc
> > 
> >    '#io-channel-cells':
> > @@ -43,6 +45,12 @@ properties:
> >    interrupts:
> >      maxItems: 1
> > 
> > +  ingenic,use-internal-divider:
> > +    description:
> > +      This property can be used to set VBAT_SEL in the JZ4760B CFG 
> > register
> > +      to sample the battery voltage from the internal divider. If 
> > absent, it
> > +      will sample the external divider.  
> 
> Please remove trailing spaces. And you don't need to describe internal 
> behaviour; you only need to explain the functionality in a user-facing 
> perspective. Something like:
> 
> "If present, battery voltage is read from the VBAT_IR pin, which has an 
> internal /4 divider. If absent, it is read through the VBAT_ER pin, 
> which does not have such divider."
> 
> You also don't specify the type of the property, please add "type: 
> boolean" before the description.
> 
> There should also be a way to make sure that this property can only be 
> used with the JZ4760B SoC. So a dependency for this vendor property on 
> the "ingenic,jz4760b-adc" compatible string. But I'm honestly not sure 
> how to express that... Maybe Rob can help.

Lots of examples in tree.
e.g.
https://elixir.bootlin.com/linux/v5.14-rc2/source/Documentation/devicetree/bindings/iio/st,st-sensors.yaml#L153

Basically you have an if block matching the compatible and for non matches
set it to false.  That combined with additionaProperties: false enforces
the property can't exist for those other devices.

> 
> > +
> >  required:
> >    - compatible
> >    - '#io-channel-cells'
> > @@ -53,6 +61,7 @@ required:
> > 
> >  additionalProperties: false
> > 
> > +  
> 
> Remove the extra newline.
> 
> Cheers,
> -Paul
> 
> >  examples:
> >    - |
> >      #include <dt-bindings/clock/jz4740-cgu.h>
> > --
> > 2.30.2
> >   
> 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml b/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml
index 433a3fb55a2e..1b423adba61d 100644
--- a/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/ingenic,adc.yaml
@@ -23,6 +23,8 @@  properties:
     enum:
       - ingenic,jz4725b-adc
       - ingenic,jz4740-adc
+      - ingenic,jz4760-adc
+      - ingenic,jz4760b-adc
       - ingenic,jz4770-adc
 
   '#io-channel-cells':
@@ -43,6 +45,12 @@  properties:
   interrupts:
     maxItems: 1
 
+  ingenic,use-internal-divider: 
+    description:
+      This property can be used to set VBAT_SEL in the JZ4760B CFG register
+      to sample the battery voltage from the internal divider. If absent, it
+      will sample the external divider.  
+
 required:
   - compatible
   - '#io-channel-cells'
@@ -53,6 +61,7 @@  required:
 
 additionalProperties: false
 
+
 examples:
   - |
     #include <dt-bindings/clock/jz4740-cgu.h>