linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: rockchip: add adc-keys node to rk3066a-mk808.dts
@ 2021-08-28  9:27 Johan Jonker
  2021-09-20 14:28 ` Heiko Stuebner
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Jonker @ 2021-08-28  9:27 UTC (permalink / raw)
  To: heiko; +Cc: robh+dt, linux-arm-kernel, linux-rockchip, devicetree, linux-kernel

The MK808 has a button inside the cover for the boot loader to do
some action. Add the adc-keys node to the rk3066a-mk808.dts file.
The rk3066 has a higher maximum DC supply voltage for the analog part of
SAR-ADC VDDA_SARADC of 2.75V then other Rockchip SoCs.
For the "rockchip,saradc" node is a vref-supply property required,
so add a regulator for it as well.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 arch/arm/boot/dts/rk3066a-mk808.dts | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm/boot/dts/rk3066a-mk808.dts b/arch/arm/boot/dts/rk3066a-mk808.dts
index 9790bc63b..667d57a4f 100644
--- a/arch/arm/boot/dts/rk3066a-mk808.dts
+++ b/arch/arm/boot/dts/rk3066a-mk808.dts
@@ -4,6 +4,7 @@
  */
 
 /dts-v1/;
+#include <dt-bindings/input/input.h>
 #include "rk3066a.dtsi"
 
 / {
@@ -24,6 +25,20 @@
 		device_type = "memory";
 	};
 
+	adc-keys {
+		compatible = "adc-keys";
+		io-channels = <&saradc 1>;
+		io-channel-names = "buttons";
+		keyup-threshold-microvolt = <2500000>;
+		poll-interval = <100>;
+
+		recovery {
+			label = "recovery";
+			linux,code = <KEY_VENDOR>;
+			press-threshold-microvolt = <0>;
+		};
+	};
+
 	gpio-leds {
 		compatible = "gpio-leds";
 
@@ -46,6 +61,13 @@
 		};
 	};
 
+	vcc_2v5: vcc-2v5 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_2v5";
+		regulator-min-microvolt = <2500000>;
+		regulator-max-microvolt = <2500000>;
+	};
+
 	vcc_io: vcc-io {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc_io";
@@ -164,6 +186,11 @@
 	};
 };
 
+&saradc {
+	vref-supply = <&vcc_2v5>;
+	status = "okay";
+};
+
 &uart2 {
 	status = "okay";
 };
-- 
2.20.1


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

* Re: [PATCH] ARM: dts: rockchip: add adc-keys node to rk3066a-mk808.dts
  2021-08-28  9:27 [PATCH] ARM: dts: rockchip: add adc-keys node to rk3066a-mk808.dts Johan Jonker
@ 2021-09-20 14:28 ` Heiko Stuebner
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Stuebner @ 2021-09-20 14:28 UTC (permalink / raw)
  To: Johan Jonker
  Cc: Heiko Stuebner, robh+dt, linux-rockchip, linux-arm-kernel,
	devicetree, linux-kernel

On Sat, 28 Aug 2021 11:27:55 +0200, Johan Jonker wrote:
> The MK808 has a button inside the cover for the boot loader to do
> some action. Add the adc-keys node to the rk3066a-mk808.dts file.
> The rk3066 has a higher maximum DC supply voltage for the analog part of
> SAR-ADC VDDA_SARADC of 2.75V then other Rockchip SoCs.
> For the "rockchip,saradc" node is a vref-supply property required,
> so add a regulator for it as well.

Applied, thanks!

[1/1] ARM: dts: rockchip: add adc-keys node to rk3066a-mk808.dts
      commit: d7197d56c9cf3620ec086550386df3be2c90ae4d

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

end of thread, other threads:[~2021-09-20 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  9:27 [PATCH] ARM: dts: rockchip: add adc-keys node to rk3066a-mk808.dts Johan Jonker
2021-09-20 14:28 ` Heiko Stuebner

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).