* [PATCH 1/3] dt-bindings: iio: adc: Add GPADC for Allwinner A523
2026-05-10 12:57 [PATCH 0/3] Add GPADC support for A523 Michal Piekos
@ 2026-05-10 12:57 ` Michal Piekos
2026-05-10 14:29 ` Rob Herring (Arm)
2026-05-10 14:40 ` Jernej Škrabec
2026-05-10 12:57 ` [PATCH 2/3] iio: adc: sun20i-gpadc: add A523 gpadc support Michal Piekos
2026-05-10 12:57 ` [PATCH 3/3] arm64: dts: allwinner: a523: add gpadc node Michal Piekos
2 siblings, 2 replies; 8+ messages in thread
From: Michal Piekos @ 2026-05-10 12:57 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, Maksim Kiselev
Cc: linux-iio, devicetree, linux-arm-kernel, linux-sunxi,
linux-kernel, Michal Piekos
Add support for the GPADC for the Allwinner A523. It differs from the
D1/T113s/R329/T507 by having two clocks.
Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl>
---
.../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 37 +++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml
index da605a051b94..89da96cd705f 100644
--- a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml
@@ -17,6 +17,7 @@ properties:
- items:
- enum:
- allwinner,sun50i-h616-gpadc
+ - allwinner,sun55i-a523-gpadc
- const: allwinner,sun20i-d1-gpadc
"#io-channel-cells":
@@ -29,7 +30,12 @@ properties:
const: 0
clocks:
- maxItems: 1
+ minItems: 1
+ maxItems: 2
+
+ clock-names:
+ minItems: 1
+ maxItems: 2
interrupts:
maxItems: 1
@@ -40,6 +46,35 @@ properties:
resets:
maxItems: 1
+allOf:
+ - if:
+ properties:
+ compatible:
+ items:
+ - const: allwinner,sun55i-a523-gpadc
+ - const: allwinner,sun20i-d1-gpadc
+ then:
+ properties:
+ clocks:
+ minItems: 2
+ maxItems: 2
+ items:
+ - description: Bus clock
+ - description: Module clock
+ clock-names:
+ minItems: 2
+ maxItems: 2
+ items:
+ - const: bus
+ - const: mod
+ required:
+ - clock-names
+ else:
+ properties:
+ clocks:
+ maxItems: 1
+ clock-names: false
+
patternProperties:
"^channel@[0-9a-f]+$":
$ref: adc.yaml
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 1/3] dt-bindings: iio: adc: Add GPADC for Allwinner A523
2026-05-10 12:57 ` [PATCH 1/3] dt-bindings: iio: adc: Add GPADC for Allwinner A523 Michal Piekos
@ 2026-05-10 14:29 ` Rob Herring (Arm)
2026-05-10 14:40 ` Jernej Škrabec
1 sibling, 0 replies; 8+ messages in thread
From: Rob Herring (Arm) @ 2026-05-10 14:29 UTC (permalink / raw)
To: Michal Piekos
Cc: linux-arm-kernel, Samuel Holland, Chen-Yu Tsai, linux-kernel,
Conor Dooley, Jonathan Cameron, Maksim Kiselev, Andy Shevchenko,
David Lechner, Jernej Skrabec, Krzysztof Kozlowski, linux-iio,
linux-sunxi, Nuno Sá, devicetree
On Sun, 10 May 2026 14:57:22 +0200, Michal Piekos wrote:
> Add support for the GPADC for the Allwinner A523. It differs from the
> D1/T113s/R329/T507 by having two clocks.
>
> Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl>
> ---
> .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 37 +++++++++++++++++++++-
> 1 file changed, 36 insertions(+), 1 deletion(-)
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml: allOf:0:then:properties:clocks: {'minItems': 2, 'maxItems': 2, 'items': [{'description': 'Bus clock'}, {'description': 'Module clock'}]} should not be valid under {'required': ['maxItems']}
hint: "maxItems" is not needed with an "items" list
from schema $id: http://devicetree.org/meta-schemas/items.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml: allOf:0:then:properties:clocks: 'oneOf' conditional failed, one must be fixed:
False schema does not allow 2
[{'description': 'Bus clock'}, {'description': 'Module clock'}] is too long
[{'description': 'Bus clock'}, {'description': 'Module clock'}] is too short
1 was expected
hint: "minItems" is only needed if less than the "items" list length
from schema $id: http://devicetree.org/meta-schemas/items.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml: allOf:0:then:properties:clock-names: {'minItems': 2, 'maxItems': 2, 'items': [{'const': 'bus'}, {'const': 'mod'}]} should not be valid under {'required': ['maxItems']}
hint: "maxItems" is not needed with an "items" list
from schema $id: http://devicetree.org/meta-schemas/items.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml: allOf:0:then:properties:clock-names: 'oneOf' conditional failed, one must be fixed:
False schema does not allow 2
[{'const': 'bus'}, {'const': 'mod'}] is too long
[{'const': 'bus'}, {'const': 'mod'}] is too short
1 was expected
hint: "minItems" is only needed if less than the "items" list length
from schema $id: http://devicetree.org/meta-schemas/items.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.kernel.org/project/devicetree/patch/20260510-sunxi-a523-gpadc-v1-1-4f6b0f4000fb@mmpsystems.pl
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.
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 1/3] dt-bindings: iio: adc: Add GPADC for Allwinner A523
2026-05-10 12:57 ` [PATCH 1/3] dt-bindings: iio: adc: Add GPADC for Allwinner A523 Michal Piekos
2026-05-10 14:29 ` Rob Herring (Arm)
@ 2026-05-10 14:40 ` Jernej Škrabec
1 sibling, 0 replies; 8+ messages in thread
From: Jernej Škrabec @ 2026-05-10 14:40 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
Samuel Holland, Maksim Kiselev, Michal Piekos
Cc: linux-iio, devicetree, linux-arm-kernel, linux-sunxi,
linux-kernel, Michal Piekos
Dne nedelja, 10. maj 2026 ob 14:57:22 Srednjeevropski poletni čas je Michal Piekos napisal(a):
> Add support for the GPADC for the Allwinner A523. It differs from the
> D1/T113s/R329/T507 by having two clocks.
>
> Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl>
> ---
> .../iio/adc/allwinner,sun20i-d1-gpadc.yaml | 37 +++++++++++++++++++++-
> 1 file changed, 36 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml
> index da605a051b94..89da96cd705f 100644
> --- a/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/allwinner,sun20i-d1-gpadc.yaml
> @@ -17,6 +17,7 @@ properties:
> - items:
> - enum:
> - allwinner,sun50i-h616-gpadc
> + - allwinner,sun55i-a523-gpadc
It shouldn't be combined if it has different number of clocks.
Best regards,
Jernej
> - const: allwinner,sun20i-d1-gpadc
>
> "#io-channel-cells":
> @@ -29,7 +30,12 @@ properties:
> const: 0
>
> clocks:
> - maxItems: 1
> + minItems: 1
> + maxItems: 2
> +
> + clock-names:
> + minItems: 1
> + maxItems: 2
>
> interrupts:
> maxItems: 1
> @@ -40,6 +46,35 @@ properties:
> resets:
> maxItems: 1
>
> +allOf:
> + - if:
> + properties:
> + compatible:
> + items:
> + - const: allwinner,sun55i-a523-gpadc
> + - const: allwinner,sun20i-d1-gpadc
> + then:
> + properties:
> + clocks:
> + minItems: 2
> + maxItems: 2
> + items:
> + - description: Bus clock
> + - description: Module clock
> + clock-names:
> + minItems: 2
> + maxItems: 2
> + items:
> + - const: bus
> + - const: mod
> + required:
> + - clock-names
> + else:
> + properties:
> + clocks:
> + maxItems: 1
> + clock-names: false
> +
> patternProperties:
> "^channel@[0-9a-f]+$":
> $ref: adc.yaml
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/3] iio: adc: sun20i-gpadc: add A523 gpadc support
2026-05-10 12:57 [PATCH 0/3] Add GPADC support for A523 Michal Piekos
2026-05-10 12:57 ` [PATCH 1/3] dt-bindings: iio: adc: Add GPADC for Allwinner A523 Michal Piekos
@ 2026-05-10 12:57 ` Michal Piekos
2026-05-10 12:57 ` [PATCH 3/3] arm64: dts: allwinner: a523: add gpadc node Michal Piekos
2 siblings, 0 replies; 8+ messages in thread
From: Michal Piekos @ 2026-05-10 12:57 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, Maksim Kiselev
Cc: linux-iio, devicetree, linux-arm-kernel, linux-sunxi,
linux-kernel, Michal Piekos
A523 differs from existing sun20i-gpadc-iio by having two clocks; bus
clock and module clock.
Change driver to enable all clocks.
Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl>
---
drivers/iio/adc/sun20i-gpadc-iio.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/adc/sun20i-gpadc-iio.c b/drivers/iio/adc/sun20i-gpadc-iio.c
index 861c14da75ad..dd4c7e6e3d76 100644
--- a/drivers/iio/adc/sun20i-gpadc-iio.c
+++ b/drivers/iio/adc/sun20i-gpadc-iio.c
@@ -180,7 +180,7 @@ static int sun20i_gpadc_probe(struct platform_device *pdev)
struct iio_dev *indio_dev;
struct sun20i_gpadc_iio *info;
struct reset_control *rst;
- struct clk *clk;
+ struct clk_bulk_data *clks;
int irq;
int ret;
@@ -205,9 +205,9 @@ static int sun20i_gpadc_probe(struct platform_device *pdev)
if (IS_ERR(info->regs))
return PTR_ERR(info->regs);
- clk = devm_clk_get_enabled(dev, NULL);
- if (IS_ERR(clk))
- return dev_err_probe(dev, PTR_ERR(clk), "failed to enable bus clock\n");
+ ret = devm_clk_bulk_get_all_enabled(dev, &clks);
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "failed to enable clocks\n");
rst = devm_reset_control_get_exclusive(dev, NULL);
if (IS_ERR(rst))
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] arm64: dts: allwinner: a523: add gpadc node
2026-05-10 12:57 [PATCH 0/3] Add GPADC support for A523 Michal Piekos
2026-05-10 12:57 ` [PATCH 1/3] dt-bindings: iio: adc: Add GPADC for Allwinner A523 Michal Piekos
2026-05-10 12:57 ` [PATCH 2/3] iio: adc: sun20i-gpadc: add A523 gpadc support Michal Piekos
@ 2026-05-10 12:57 ` Michal Piekos
2026-05-10 14:39 ` Jernej Škrabec
2026-05-10 18:34 ` Chen-Yu Tsai
2 siblings, 2 replies; 8+ messages in thread
From: Michal Piekos @ 2026-05-10 12:57 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland, Maksim Kiselev
Cc: linux-iio, devicetree, linux-arm-kernel, linux-sunxi,
linux-kernel, Michal Piekos
Describe high speed timer block on Allwinner D1S-T113.
Tested on Radxa Cubie A5E:
- 2 connected channels are showing voltages in agreement with
schematics.
BOOT-SEL-ADC ~500mV
BOM-ADC ~1800mV
- 3rd channel exposed on 40pin header is showing correct voltages when
connected to known voltage source.
Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl>
---
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
index 5afa8d92acbf..f6c5cae5b23a 100644
--- a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
@@ -340,6 +340,18 @@ ledc: led-controller@2008000 {
status = "disabled";
};
+ gpadc: adc@2009000 {
+ compatible = "allwinner,sun55i-a523-gpadc",
+ "allwinner,sun20i-d1-gpadc";
+ reg = <0x2009000 0x400>;
+ clocks = <&ccu CLK_BUS_GPADC0>, <&ccu CLK_GPADC0>;
+ clock-names = "bus", "mod";
+ resets = <&ccu RST_BUS_GPADC0>;
+ interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
+ status = "disabled";
+ #io-channel-cells = <1>;
+ };
+
wdt: watchdog@2050000 {
compatible = "allwinner,sun55i-a523-wdt";
reg = <0x2050000 0x20>;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 3/3] arm64: dts: allwinner: a523: add gpadc node
2026-05-10 12:57 ` [PATCH 3/3] arm64: dts: allwinner: a523: add gpadc node Michal Piekos
@ 2026-05-10 14:39 ` Jernej Škrabec
2026-05-10 18:34 ` Chen-Yu Tsai
1 sibling, 0 replies; 8+ messages in thread
From: Jernej Škrabec @ 2026-05-10 14:39 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Chen-Yu Tsai,
Samuel Holland, Maksim Kiselev, Michal Piekos
Cc: linux-iio, devicetree, linux-arm-kernel, linux-sunxi,
linux-kernel, Michal Piekos
Dne nedelja, 10. maj 2026 ob 14:57:24 Srednjeevropski poletni čas je Michal Piekos napisal(a):
> Describe high speed timer block on Allwinner D1S-T113.
Above line doesn't make much sense.
Best regards,
Jernej
>
> Tested on Radxa Cubie A5E:
> - 2 connected channels are showing voltages in agreement with
> schematics.
> BOOT-SEL-ADC ~500mV
> BOM-ADC ~1800mV
> - 3rd channel exposed on 40pin header is showing correct voltages when
> connected to known voltage source.
>
> Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl>
> ---
> arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
> index 5afa8d92acbf..f6c5cae5b23a 100644
> --- a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
> @@ -340,6 +340,18 @@ ledc: led-controller@2008000 {
> status = "disabled";
> };
>
> + gpadc: adc@2009000 {
> + compatible = "allwinner,sun55i-a523-gpadc",
> + "allwinner,sun20i-d1-gpadc";
> + reg = <0x2009000 0x400>;
> + clocks = <&ccu CLK_BUS_GPADC0>, <&ccu CLK_GPADC0>;
> + clock-names = "bus", "mod";
> + resets = <&ccu RST_BUS_GPADC0>;
> + interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
> + status = "disabled";
> + #io-channel-cells = <1>;
> + };
> +
> wdt: watchdog@2050000 {
> compatible = "allwinner,sun55i-a523-wdt";
> reg = <0x2050000 0x20>;
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 3/3] arm64: dts: allwinner: a523: add gpadc node
2026-05-10 12:57 ` [PATCH 3/3] arm64: dts: allwinner: a523: add gpadc node Michal Piekos
2026-05-10 14:39 ` Jernej Škrabec
@ 2026-05-10 18:34 ` Chen-Yu Tsai
1 sibling, 0 replies; 8+ messages in thread
From: Chen-Yu Tsai @ 2026-05-10 18:34 UTC (permalink / raw)
To: Michal Piekos
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jernej Skrabec,
Samuel Holland, Maksim Kiselev, linux-iio, devicetree,
linux-arm-kernel, linux-sunxi, linux-kernel
On Sun, May 10, 2026 at 9:02 PM Michal Piekos
<michal.piekos@mmpsystems.pl> wrote:
>
> Describe high speed timer block on Allwinner D1S-T113.
>
> Tested on Radxa Cubie A5E:
> - 2 connected channels are showing voltages in agreement with
> schematics.
> BOOT-SEL-ADC ~500mV
> BOM-ADC ~1800mV
> - 3rd channel exposed on 40pin header is showing correct voltages when
> connected to known voltage source.
>
> Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl>
> ---
> arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
> index 5afa8d92acbf..f6c5cae5b23a 100644
> --- a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
> @@ -340,6 +340,18 @@ ledc: led-controller@2008000 {
> status = "disabled";
> };
>
> + gpadc: adc@2009000 {
> + compatible = "allwinner,sun55i-a523-gpadc",
> + "allwinner,sun20i-d1-gpadc";
> + reg = <0x2009000 0x400>;
> + clocks = <&ccu CLK_BUS_GPADC0>, <&ccu CLK_GPADC0>;
> + clock-names = "bus", "mod";
> + resets = <&ccu RST_BUS_GPADC0>;
> + interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
> + status = "disabled";
> + #io-channel-cells = <1>;
status should always be the last property.
> + };
> +
> wdt: watchdog@2050000 {
> compatible = "allwinner,sun55i-a523-wdt";
> reg = <0x2050000 0x20>;
>
> --
> 2.43.0
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread