[v2,3/3] arm64: dts: allwinner: a523: add gpadc node

Message ID 20260513-sunxi-a523-gpadc-v2-3-d5efde151dac@mmpsystems.pl (mailing list archive)
State New
Headers
Series Add GPADC support for A523 |

Commit Message

Michal Piekos May 13, 2026, 4:59 a.m. UTC
Describe GPADC block on Allwinner A523.

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 | 11 +++++++++++
 1 file changed, 11 insertions(+)
  

Comments

sashiko-bot@kernel.org May 14, 2026, 2:42 a.m. UTC | #1
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The GPADC node lacks the `#address-cells` and `#size-cells` properties, which are structurally necessary for its required child nodes.
--

commit df07d88a5b17a24a46e46a7d0f2fce1a78cc0218
Author: Michal Piekos <michal.piekos@mmpsystems.pl>

arm64: dts: allwinner: a523: add gpadc node

This commit adds the GPADC block description for the Allwinner A523 SoC to
the base device tree include file.

> diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
> --- a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi

[ ... ]

> +		gpadc: adc@2009000 {
> +			compatible = "allwinner,sun55i-a523-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>;
> +			#io-channel-cells = <1>;

Should this node also include #address-cells = <1>; and #size-cells = <0>;?

The driver for this hardware requires channel@X child nodes to probe
successfully. Since these child nodes use reg properties to specify the
channel, omitting the cell properties from the base dtsi forces every board
file to redundantly declare them.

Including them here would prevent DTC warnings or probe failures if a board
author forgets to add them when enabling the device.

> +			status = "disabled";
> +		};
  

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
index 5afa8d92acbf..4e793aeccf89 100644
--- a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
@@ -340,6 +340,17 @@  ledc: led-controller@2008000 {
 			status = "disabled";
 		};
 
+		gpadc: adc@2009000 {
+			compatible = "allwinner,sun55i-a523-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>;
+			#io-channel-cells = <1>;
+			status = "disabled";
+		};
+
 		wdt: watchdog@2050000 {
 			compatible = "allwinner,sun55i-a523-wdt";
 			reg = <0x2050000 0x20>;