devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] arm64: dts: allwinner: H616: Add LRADC
@ 2024-04-26  9:29 James McGregor
  2024-04-26  9:29 ` [PATCH v2 1/2] dt-bindings: input: sun4i-lradc-keys: Add H616 compatible James McGregor
  2024-04-26  9:29 ` [PATCH v2 2/2] ARM: dts: sun50i: Add LRADC node James McGregor
  0 siblings, 2 replies; 5+ messages in thread
From: James McGregor @ 2024-04-26  9:29 UTC (permalink / raw)
  To: Hans de Goede, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Andre Przywara
  Cc: linux-input, devicetree, linux-arm-kernel, linux-sunxi

Version 2 moves the LRADC DT node to the right place. It was out of
order before.

The Allwinner H616 series of SoCs have a low-rate ADC (LRADC) with
6-bit resolution and one input channel. They're compatible with the
existing drivers, so it only needs to be enabled in the DT.

Add an LRADC node to the H616 .dtsi, so board DTs can use them by
adding 'status = "okay";'.

This was tested on an OrangePi Zero 2W by attaching an expansion board
with two key buttons connected to the LRADC, and adding them to the DT.
/dev/input/event0 then properly reported the button presses. The patches
are based off sunxi/for-next.

James McGregor (2):
  dt-bindings: input: sun4i-lradc-keys: Add H616 compatible
  ARM: dts: sun50i: Add LRADC node

 .../bindings/input/allwinner,sun4i-a10-lradc-keys.yaml |  4 +++-
 arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi         | 10 ++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] dt-bindings: input: sun4i-lradc-keys: Add H616 compatible
  2024-04-26  9:29 [PATCH v2 0/2] arm64: dts: allwinner: H616: Add LRADC James McGregor
@ 2024-04-26  9:29 ` James McGregor
  2024-04-26 15:36   ` Rob Herring
  2024-04-26  9:29 ` [PATCH v2 2/2] ARM: dts: sun50i: Add LRADC node James McGregor
  1 sibling, 1 reply; 5+ messages in thread
From: James McGregor @ 2024-04-26  9:29 UTC (permalink / raw)
  To: Hans de Goede, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Andre Przywara
  Cc: linux-input, devicetree, linux-arm-kernel, linux-sunxi

The Allwinner H616 SoC has an LRADC which is compatible with the
versions in existing SoCs.
Add a compatible string for H616, with the R329 fallback. This is the
same as the D1, so put them into an enum.

Signed-off-by: James McGregor <jamcgregor@protonmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
---
 .../bindings/input/allwinner,sun4i-a10-lradc-keys.yaml        | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
index c384bf0bb25d..6bdb8040be65 100644
--- a/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
+++ b/Documentation/devicetree/bindings/input/allwinner,sun4i-a10-lradc-keys.yaml
@@ -22,7 +22,9 @@ properties:
           - const: allwinner,sun8i-a83t-r-lradc
       - const: allwinner,sun50i-r329-lradc
       - items:
-          - const: allwinner,sun20i-d1-lradc
+          - enum:
+              - allwinner,sun50i-h616-lradc
+              - allwinner,sun20i-d1-lradc
           - const: allwinner,sun50i-r329-lradc
 
   reg:
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] ARM: dts: sun50i: Add LRADC node
  2024-04-26  9:29 [PATCH v2 0/2] arm64: dts: allwinner: H616: Add LRADC James McGregor
  2024-04-26  9:29 ` [PATCH v2 1/2] dt-bindings: input: sun4i-lradc-keys: Add H616 compatible James McGregor
@ 2024-04-26  9:29 ` James McGregor
  2024-04-26 14:20   ` Jernej Škrabec
  1 sibling, 1 reply; 5+ messages in thread
From: James McGregor @ 2024-04-26  9:29 UTC (permalink / raw)
  To: Hans de Goede, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Andre Przywara
  Cc: linux-input, devicetree, linux-arm-kernel, linux-sunxi

Add a DT node for the Allwinner H616 LRADC describing the base address,
interrupt, reset and clock gates.

Signed-off-by: James McGregor <jamcgregor@protonmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
---
V1 -> V2: Moved DT node to correct place in tree order

 arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
index a061b69c07c2..1e8538ca7db0 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
@@ -594,6 +594,16 @@ ths: thermal-sensor@5070400 {
 			#thermal-sensor-cells = <1>;
 		};
 
+		lradc: lradc@5070800 {
+			compatible = "allwinner,sun50i-h616-lradc",
+				     "allwinner,sun50i-r329-lradc";
+			reg = <0x05070800 0x400>;
+			interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_KEYADC>;
+			resets = <&ccu RST_BUS_KEYADC>;
+			status = "disabled";
+		};
+
 		usbotg: usb@5100000 {
 			compatible = "allwinner,sun50i-h616-musb",
 				     "allwinner,sun8i-h3-musb";
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] ARM: dts: sun50i: Add LRADC node
  2024-04-26  9:29 ` [PATCH v2 2/2] ARM: dts: sun50i: Add LRADC node James McGregor
@ 2024-04-26 14:20   ` Jernej Škrabec
  0 siblings, 0 replies; 5+ messages in thread
From: Jernej Škrabec @ 2024-04-26 14:20 UTC (permalink / raw)
  To: Hans de Goede, Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Chen-Yu Tsai, Samuel Holland, Andre Przywara,
	James McGregor
  Cc: linux-input, devicetree, linux-arm-kernel, linux-sunxi

Dne petek, 26. april 2024 ob 11:29:48 GMT +2 je James McGregor napisal(a):
> Add a DT node for the Allwinner H616 LRADC describing the base address,
> interrupt, reset and clock gates.
> 
> Signed-off-by: James McGregor <jamcgregor@protonmail.com>
> Reviewed-by: Andre Przywara <andre.przywara@arm.com>

Reviewed-by: Jernej Škrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
> V1 -> V2: Moved DT node to correct place in tree order
> 
>  arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
> index a061b69c07c2..1e8538ca7db0 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
> @@ -594,6 +594,16 @@ ths: thermal-sensor@5070400 {
>  			#thermal-sensor-cells = <1>;
>  		};
>  
> +		lradc: lradc@5070800 {
> +			compatible = "allwinner,sun50i-h616-lradc",
> +				     "allwinner,sun50i-r329-lradc";
> +			reg = <0x05070800 0x400>;
> +			interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&ccu CLK_BUS_KEYADC>;
> +			resets = <&ccu RST_BUS_KEYADC>;
> +			status = "disabled";
> +		};
> +
>  		usbotg: usb@5100000 {
>  			compatible = "allwinner,sun50i-h616-musb",
>  				     "allwinner,sun8i-h3-musb";
> 





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: input: sun4i-lradc-keys: Add H616 compatible
  2024-04-26  9:29 ` [PATCH v2 1/2] dt-bindings: input: sun4i-lradc-keys: Add H616 compatible James McGregor
@ 2024-04-26 15:36   ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2024-04-26 15:36 UTC (permalink / raw)
  To: James McGregor
  Cc: linux-input, Hans de Goede, Krzysztof Kozlowski, linux-sunxi,
	devicetree, linux-arm-kernel, Jernej Skrabec, Conor Dooley,
	Samuel Holland, Andre Przywara, Chen-Yu Tsai, Dmitry Torokhov


On Fri, 26 Apr 2024 09:29:41 +0000, James McGregor wrote:
> The Allwinner H616 SoC has an LRADC which is compatible with the
> versions in existing SoCs.
> Add a compatible string for H616, with the R329 fallback. This is the
> same as the D1, so put them into an enum.
> 
> Signed-off-by: James McGregor <jamcgregor@protonmail.com>
> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  .../bindings/input/allwinner,sun4i-a10-lradc-keys.yaml        | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 


Please add Acked-by/Reviewed-by tags when posting new versions. However,
there's no need to repost patches *only* to add the tags. The upstream
maintainer will do that for acks received on the version they apply.

If a tag was not added on purpose, please state why and what changed.

Missing tags:

Acked-by: Rob Herring (Arm) <robh@kernel.org>




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-26 15:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26  9:29 [PATCH v2 0/2] arm64: dts: allwinner: H616: Add LRADC James McGregor
2024-04-26  9:29 ` [PATCH v2 1/2] dt-bindings: input: sun4i-lradc-keys: Add H616 compatible James McGregor
2024-04-26 15:36   ` Rob Herring
2024-04-26  9:29 ` [PATCH v2 2/2] ARM: dts: sun50i: Add LRADC node James McGregor
2024-04-26 14:20   ` Jernej Škrabec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).