linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Weiss <luca@z3ntu.xyz>
To: ~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Luca Weiss <luca@z3ntu.xyz>
Subject: [PATCH 3/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add volume keys and hall sensor
Date: Sun, 22 Jan 2023 17:48:34 +0100	[thread overview]
Message-ID: <20230122-msm8974-bacon-features-v1-3-4049f565c24c@z3ntu.xyz> (raw)
In-Reply-To: <20230122-msm8974-bacon-features-v1-0-4049f565c24c@z3ntu.xyz>

Add nodes for the volume buttons and the hall sensor that are found on
the device.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
---
 .../arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts | 50 ++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
index 63180fe1d292..10ba3c94e26d 100644
--- a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
+++ b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts
@@ -19,6 +19,38 @@ aliases {
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&gpio_keys_default>, <&gpio_hall_sensor_default>;
+
+		key-volume-down {
+			label = "Volume Down";
+			gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_VOLUMEDOWN>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
+
+		key-volume-up {
+			label = "Volume Up";
+			gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_VOLUMEUP>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
+
+		event-hall-sensor {
+			label = "Hall Effect Sensor";
+			gpios = <&tlmm 68 GPIO_ACTIVE_LOW>;
+			linux,input-type = <EV_SW>;
+			linux,code = <SW_LID>;
+			linux,can-disable;
+			debounce-interval = <150>;
+		};
+	};
 };
 
 &blsp1_i2c1 {
@@ -95,6 +127,17 @@ &pm8941_coincell {
 	status = "okay";
 };
 
+&pm8941_gpios {
+	gpio_keys_default: gpio-keys-active-state {
+		pins = "gpio2", "gpio5";
+		function = "normal";
+
+		input-enable;
+		bias-disable;
+		power-source = <PM8941_GPIO_S3>;
+	};
+};
+
 &pm8941_vib {
 	status = "okay";
 };
@@ -349,6 +392,13 @@ &sdhc_1 {
 };
 
 &tlmm {
+	gpio_hall_sensor_default: gpio-hall-sensor-default-state {
+		pins = "gpio68";
+		function = "gpio";
+		drive-strength = <8>;
+		bias-pull-up;
+	};
+
 	sdc1_on: sdc1-on-state {
 		clk-pins {
 			pins = "sdc1_clk";

-- 
2.39.1

  parent reply	other threads:[~2023-01-22 16:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-22 16:48 [PATCH 0/5] Add support for some features on OnePlus One Luca Weiss
2023-01-22 16:48 ` [PATCH 1/5] ARM: dts: qcom: pm8941: Add vibrator node Luca Weiss
2023-01-23 16:39   ` Konrad Dybcio
2023-01-22 16:48 ` [PATCH 2/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add vibrator Luca Weiss
2023-01-23 16:39   ` Konrad Dybcio
2023-01-22 16:48 ` Luca Weiss [this message]
2023-01-23 16:42   ` [PATCH 3/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add volume keys and hall sensor Konrad Dybcio
2023-01-22 16:48 ` [PATCH 4/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add backlight Luca Weiss
2023-01-23 16:43   ` Konrad Dybcio
2023-01-22 16:48 ` [PATCH 5/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED Luca Weiss
2023-01-23 16:44   ` Konrad Dybcio
2023-01-23 17:18   ` Krzysztof Kozlowski
2023-01-25 20:51     ` Luca Weiss
2023-01-26  9:41       ` Krzysztof Kozlowski
2023-01-26 20:41         ` Luca Weiss
2023-01-27  8:27           ` Krzysztof Kozlowski
2023-02-11 16:22     ` Pavel Machek

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=20230122-msm8974-bacon-features-v1-3-4049f565c24c@z3ntu.xyz \
    --to=luca@z3ntu.xyz \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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;
as well as URLs for NNTP newsgroup(s).