[v4,2/3] dt-bindings: iio: adc: Add Allwinner D1/T113s/R329/T507 SoCs GPADC
Commit Message
From: Maxim Kiselev <bigunclemax@gmail.com>
Allwinner's D1/T113s/R329/T507 SoCs have a new general purpose ADC.
This ADC is the same for all of this SoCs. The only difference is
the number of available channels.
Signed-off-by: Maxim Kiselev <bigunclemax@gmail.com>
---
.../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 91 +++++++++++++++++++
1 file changed, 91 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml
Comments
Hey,
On Sat, Jun 10, 2023 at 03:29:08PM +0300, Maksim Kiselev wrote:
> From: Maxim Kiselev <bigunclemax@gmail.com>
>
> Allwinner's D1/T113s/R329/T507 SoCs have a new general purpose ADC.
> This ADC is the same for all of this SoCs. The only difference is
> the number of available channels.
>
> Signed-off-by: Maxim Kiselev <bigunclemax@gmail.com>
> ---
> .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 91 +++++++++++++++++++
> 1 file changed, 91 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml
> new file mode 100644
> index 000000000000..2b59844b7c07
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml
> @@ -0,0 +1,91 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/allwinner,sun20i-d1-gpadc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Allwinner D1 General Purpose ADC
> +
> +maintainers:
> + - Maksim Kiselev <bigunclemax@gmail.com>
> +
> +properties:
> + compatible:
> + enum:
> + - allwinner,sun20i-d1-gpadc
> +
> + "#io-channel-cells":
> + const: 1
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 0
> +
> + clocks:
> + maxItems: 1
> +
> + interrupts:
> + maxItems: 1
> +
> + reg:
> + maxItems: 1
> +
> + resets:
> + maxItems: 1
> +
> +patternProperties:
> + "^channel@([0-15])$":
> + $ref: adc.yaml
> + type: object
> + description:
> + Represents the internal channels of the ADC.
> +
> + properties:
> + reg:
> + items:
> + minimum: 0
> + maximum: 15
> +
> + required:
> + - reg
> +
> + additionalProperties: false
> +
> +required:
> + - "#io-channel-cells"
> + - clocks
> + - compatible
> + - interrupts
> + - reg
> + - resets
> +
> +unevaluatedProperties: false
How come this one changed to unevaluatedProperties: false?
Wasn't it for the ADC that we previously discussed whether
additionalProperties: false was correct or not?
Cheers,
Conor.
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/sun20i-d1-ccu.h>
> + #include <dt-bindings/reset/sun20i-d1-ccu.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> +
> + gpadc: adc@2009000 {
> + compatible = "allwinner,sun20i-d1-gpadc";
> + reg = <0x2009000 0x1000>;
> + clocks = <&ccu CLK_BUS_GPADC>;
> + resets = <&ccu RST_BUS_GPADC>;
> + interrupts = <73 IRQ_TYPE_LEVEL_HIGH>;
> + #io-channel-cells = <1>;
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + channel@0 {
> + reg = <0>;
> + };
> +
> + channel@1 {
> + reg = <1>;
> + };
> + };
> +...
> --
> 2.39.2
>
Hey,
сб, 10 июн. 2023 г. в 18:06, Conor Dooley <conor@kernel.org>:
...
> >+
> >+ required:
> >+ - reg
> >+
> >+ additionalProperties: false
> >+
> >+required:
> >+ - "#io-channel-cells"
> >+ - clocks
> >+ - compatible
> >+ - interrupts
> >+ - reg
> >+ - resets
> >+
> >+unevaluatedProperties: false
>
> How come this one changed to unevaluatedProperties: false?
> Wasn't it for the ADC that we previously discussed whether
> additionalProperties: false was correct or not?
Hmm, I changed it to `unevaluatedProperties: false` as you suggested
in this message
https://lore.kernel.org/lkml/20230604-afternoon-frighten-42222010557b@spud/
On Sat, Jun 10, 2023 at 06:48:08PM +0300, Maxim Kiselev wrote:
> Hey,
>
> сб, 10 июн. 2023 г. в 18:06, Conor Dooley <conor@kernel.org>:
>
> ...
>
> > >+
> > >+ required:
> > >+ - reg
> > >+
> > >+ additionalProperties: false
[1]
> > >+
> > >+required:
> > >+ - "#io-channel-cells"
> > >+ - clocks
> > >+ - compatible
> > >+ - interrupts
> > >+ - reg
> > >+ - resets
> > >+
> > >+unevaluatedProperties: false
> >
> > How come this one changed to unevaluatedProperties: false?
> > Wasn't it for the ADC that we previously discussed whether
> > additionalProperties: false was correct or not?
>
> Hmm, I changed it to `unevaluatedProperties: false` as you suggested
> in this message
> https://lore.kernel.org/lkml/20230604-afternoon-frighten-42222010557b@spud/
That was about the adc child nodes [1], not at the top level, no?
Cheers,
Conor.
сб, 10 июн. 2023 г. в 18:53, Conor Dooley <conor@kernel.org>:
>
> On Sat, Jun 10, 2023 at 06:48:08PM +0300, Maxim Kiselev wrote:
> > Hey,
> >
> > сб, 10 июн. 2023 г. в 18:06, Conor Dooley <conor@kernel.org>:
> >
> > ...
> >
> > > >+
> > > >+ required:
> > > >+ - reg
> > > >+
> > > >+ additionalProperties: false
>
> [1]
>
> > > >+
> > > >+required:
> > > >+ - "#io-channel-cells"
> > > >+ - clocks
> > > >+ - compatible
> > > >+ - interrupts
> > > >+ - reg
> > > >+ - resets
> > > >+
> > > >+unevaluatedProperties: false
> > >
> > > How come this one changed to unevaluatedProperties: false?
> > > Wasn't it for the ADC that we previously discussed whether
> > > additionalProperties: false was correct or not?
> >
> > Hmm, I changed it to `unevaluatedProperties: false` as you suggested
> > in this message
> > https://lore.kernel.org/lkml/20230604-afternoon-frighten-42222010557b@spud/
>
> That was about the adc child nodes [1], not at the top level, no?
Indeed, I confused it, sorry.
new file mode 100644
@@ -0,0 +1,91 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/allwinner,sun20i-d1-gpadc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Allwinner D1 General Purpose ADC
+
+maintainers:
+ - Maksim Kiselev <bigunclemax@gmail.com>
+
+properties:
+ compatible:
+ enum:
+ - allwinner,sun20i-d1-gpadc
+
+ "#io-channel-cells":
+ const: 1
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+ clocks:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ reg:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+patternProperties:
+ "^channel@([0-15])$":
+ $ref: adc.yaml
+ type: object
+ description:
+ Represents the internal channels of the ADC.
+
+ properties:
+ reg:
+ items:
+ minimum: 0
+ maximum: 15
+
+ required:
+ - reg
+
+ additionalProperties: false
+
+required:
+ - "#io-channel-cells"
+ - clocks
+ - compatible
+ - interrupts
+ - reg
+ - resets
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/sun20i-d1-ccu.h>
+ #include <dt-bindings/reset/sun20i-d1-ccu.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ gpadc: adc@2009000 {
+ compatible = "allwinner,sun20i-d1-gpadc";
+ reg = <0x2009000 0x1000>;
+ clocks = <&ccu CLK_BUS_GPADC>;
+ resets = <&ccu RST_BUS_GPADC>;
+ interrupts = <73 IRQ_TYPE_LEVEL_HIGH>;
+ #io-channel-cells = <1>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ channel@0 {
+ reg = <0>;
+ };
+
+ channel@1 {
+ reg = <1>;
+ };
+ };
+...