From: Daniel Semkowicz <dse@thaumatec.com>
To: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Heiko Stuebner <heiko@sntech.de>
Cc: Daniel Semkowicz <dse@thaumatec.com>,
Dragan Simic <dsimic@manjaro.org>,
Farouk Bouabid <farouk.bouabid@theobroma-systems.com>,
Iskander Amara <iskander.amara@theobroma-systems.com>,
Quentin Schulz <quentin.schulz@theobroma-systems.com>,
Vahe Grigoryan <vahe.grigoryan@theobroma-systems.com>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org
Subject: [PATCH] arm64: dts: rockchip: Add power button for RK3399 Puma
Date: Wed, 25 Sep 2024 09:28:52 +0200 [thread overview]
Message-ID: <20240925072945.18757-1-dse@thaumatec.com> (raw)
There is a PWRBTN# input pin exposed on a Q7 connector. The pin
is routed to a GPIO0_A1 through a diode. Q7 specification describes
the PWRBTN# pin as a Power Button signal.
Configure the pin as KEY_POWER, so it can function as power button and
trigger device shutdown.
Add the pin definition to RK3399 Puma dts, so it can be reused
by derived platforms, but keep it disabled by default.
Enable the power button input on Haikou development board.
Signed-off-by: Daniel Semkowicz <dse@thaumatec.com>
---
.../boot/dts/rockchip/rk3399-puma-haikou.dts | 4 ++++
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi | 22 +++++++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
index f6f15946579e..0999026b16d0 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
@@ -143,6 +143,10 @@ vddd_codec: vddd-codec {
};
};
+&gpio_key_power {
+ status = "okay";
+};
+
&hdmi {
ddc-i2c-bus = <&i2c3>;
status = "okay";
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index 650b1ba9c192..389ffe604e74 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -3,6 +3,7 @@
* Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
*/
+#include <dt-bindings/input/input.h>
#include <dt-bindings/pwm/pwm.h>
#include "rk3399.dtsi"
@@ -39,6 +40,19 @@ clkin_gmac: external-gmac-clock {
#clock-cells = <0>;
};
+ gpio_key_power: gpio-key-power {
+ compatible = "gpio-keys";
+ pinctrl-0 = <&pwrbtn_pin>;
+ pinctrl-names = "default";
+ status = "disabled";
+
+ button-pwrbtn-n {
+ gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_LOW>;
+ label = "PWRBTN#";
+ linux,code = <KEY_POWER>;
+ };
+ };
+
vcc1v2_phy: vcc1v2-phy {
compatible = "regulator-fixed";
regulator-name = "vcc1v2_phy";
@@ -475,6 +489,14 @@ &pinctrl {
pinctrl-names = "default";
pinctrl-0 = <&q7_thermal_pin &bios_disable_override_hog_pin>;
+ buttons {
+ pwrbtn_pin: pwrbtn-pin {
+ rockchip,pins =
+ /* PWRBTN# */
+ <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+ };
+
gpios {
bios_disable_override_hog_pin: bios-disable-override-hog-pin {
rockchip,pins =
--
2.46.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next reply other threads:[~2024-09-25 7:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 7:28 Daniel Semkowicz [this message]
2024-09-26 12:34 ` [PATCH] arm64: dts: rockchip: Add power button for RK3399 Puma Quentin Schulz
2024-09-30 8:49 ` Heiko Stübner
2024-09-30 9:11 ` Quentin Schulz
2024-09-30 9:21 ` Heiko Stübner
2024-09-30 12:21 ` Daniel Semkowicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240925072945.18757-1-dse@thaumatec.com \
--to=dse@thaumatec.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dsimic@manjaro.org \
--cc=farouk.bouabid@theobroma-systems.com \
--cc=heiko@sntech.de \
--cc=iskander.amara@theobroma-systems.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=quentin.schulz@theobroma-systems.com \
--cc=robh@kernel.org \
--cc=vahe.grigoryan@theobroma-systems.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox