[v3,3/5] arm64: dts: allwinner: a100: Add LRADC node

Message ID 20260517234134.2737320-4-alexander.sverdlin@gmail.com (mailing list archive)
State New
Headers
Series Add support for Baijie Helper A133 board |

Commit Message

Alexander Sverdlin May 17, 2026, 11:41 p.m. UTC
A100/A133 SoCs feature a Low Rate ADC (LRADC) for Key application.

Specs:
- Power supply voltage: 1.8 V
- Reference voltage: 1.35 V
- Interrupt support
- Support Hold Key and General Key
- Support normal, continue and single work mode
- 6-bits resolution, sample rate up to 2 kHz
- Voltage input range between 0 and 1.35 V

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

sashiko-bot@kernel.org May 18, 2026, 12:02 a.m. UTC | #1
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Missing SoC-specific compatible string for the LRADC device tree node.
- [Low] Non-standard device tree node name 'lradc'.
--

commit 2888476527aa17fae679cf9ed23a85ccc8db7463
Author: Alexander Sverdlin <alexander.sverdlin@gmail.com>

arm64: dts: allwinner: a100: Add LRADC node

This commit adds the Low Rate ADC (LRADC) device tree node for the Allwinner
A100/A133 SoCs. The IP block is primarily used for key applications and
supports various operating modes.

> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
> index b3fb1e0ee796b..2bba13c5d25cd 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
> @@ -466,6 +466,15 @@ ths: thermal-sensor@5070400 {
>  			#thermal-sensor-cells = <1>;
>  		};
>  
> +		lradc: lradc@5070800 {

Could this node use a more generic name like adc@5070800 or keys@5070800?

Other device nodes in this file adhere to the generic naming convention
recommended by the Devicetree Specification.

> +			compatible = "allwinner,sun50i-r329-lradc";

Is the A100-specific compatible string missing from this node?

Other recent Allwinner SoCs utilizing this IP define their own specific
compatible alongside the fallback.

Would including an A100-specific string like "allwinner,sun50i-a100-lradc"
allow handling potential quirks without breaking backward compatibility?

> +			reg = <0x05070800 0x400>;
[ ... ]
  
Chen-Yu Tsai May 24, 2026, 7:23 p.m. UTC | #2
Hi Alexander,

On Mon, May 18, 2026 at 2:02 AM <sashiko-bot@kernel.org> wrote:
>
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> - [Medium] Missing SoC-specific compatible string for the LRADC device tree node.
> - [Low] Non-standard device tree node name 'lradc'.
> --
>
> commit 2888476527aa17fae679cf9ed23a85ccc8db7463
> Author: Alexander Sverdlin <alexander.sverdlin@gmail.com>
>
> arm64: dts: allwinner: a100: Add LRADC node
>
> This commit adds the Low Rate ADC (LRADC) device tree node for the Allwinner
> A100/A133 SoCs. The IP block is primarily used for key applications and
> supports various operating modes.
>
> > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
> > index b3fb1e0ee796b..2bba13c5d25cd 100644
> > --- a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
> > +++ b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
> > @@ -466,6 +466,15 @@ ths: thermal-sensor@5070400 {
> >                       #thermal-sensor-cells = <1>;
> >               };
> >
> > +             lradc: lradc@5070800 {
>
> Could this node use a more generic name like adc@5070800 or keys@5070800?
>
> Other device nodes in this file adhere to the generic naming convention
> recommended by the Devicetree Specification.

Please ignore this comment.

> > +                     compatible = "allwinner,sun50i-r329-lradc";
>
> Is the A100-specific compatible string missing from this node?
>
> Other recent Allwinner SoCs utilizing this IP define their own specific
> compatible alongside the fallback.
>
> Would including an A100-specific string like "allwinner,sun50i-a100-lradc"
> allow handling potential quirks without breaking backward compatibility?

Yes, we always add SoC-specific compatibles, unless they are just the same
die in different packages. Please add another patch to add the compatible,
then use it in this patch. See this series for the H616 [1] as an example.


Thanks
ChenYu

[1] https://lore.kernel.org/all/20240426092924.15489-1-jamcgregor@protonmail.com/


> > +                     reg = <0x05070800 0x400>;
> [ ... ]
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260517234134.2737320-1-alexander.sverdlin@gmail.com?part=3
>
  

Patch

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
index b3fb1e0ee796..2bba13c5d25c 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a100.dtsi
@@ -466,6 +466,15 @@  ths: thermal-sensor@5070400 {
 			#thermal-sensor-cells = <1>;
 		};
 
+		lradc: lradc@5070800 {
+			compatible = "allwinner,sun50i-r329-lradc";
+			reg = <0x05070800 0x400>;
+			interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_LRADC>;
+			resets = <&ccu RST_BUS_LRADC>;
+			status = "disabled";
+		};
+
 		usb_otg: usb@5100000 {
 			compatible = "allwinner,sun50i-a100-musb",
 				     "allwinner,sun8i-a33-musb";