phone-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@somainline.org>
To: phone-devel@vger.kernel.org
Cc: ~postmarketos/upstreaming@lists.sr.ht,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Gustave Monce <gustave.monce@outlook.com>
Subject: [PATCH 07/18] arm64: dts: qcom: msm8994-octagon: Add gpio-keys and Hall sensor
Date: Sun, 31 Jan 2021 02:38:38 +0100	[thread overview]
Message-ID: <20210131013853.55810-8-konrad.dybcio@somainline.org> (raw)
In-Reply-To: <20210131013853.55810-1-konrad.dybcio@somainline.org>

From: Gustave Monce <gustave.monce@outlook.com>

This enables tje hardware keys as well as the Hall sensor.

Signed-off-by: Gustave Monce <gustave.monce@outlook.com>
Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
 .../dts/qcom/msm8994-msft-lumia-octagon.dtsi  | 77 +++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi b/arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi
index ff06b2161b10..69016d769d90 100644
--- a/arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi
@@ -9,6 +9,9 @@
 
 #include "pm8994.dtsi"
 #include "pmi8994.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 
 /*
  * Delete all generic (msm8994.dtsi) reserved
@@ -42,6 +45,64 @@ chosen {
 		ranges;
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+		input-name = "gpio-keys";
+		autorepeat;
+
+		volupkey {
+			label = "Volume Up";
+			gpios = <&pm8994_gpios 3 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			linux,code = <KEY_VOLUMEUP>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
+
+		camsnapkey {
+			label = "Camera Snapshot";
+			gpios = <&pm8994_gpios 4 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			linux,code = <KEY_CAMERA>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
+
+		camfocuskey {
+			label = "Camera Focus";
+			gpios = <&pm8994_gpios 5 GPIO_ACTIVE_LOW>;
+			linux,input-type = <1>;
+			linux,code = <KEY_VOLUMEUP>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
+	};
+
+	gpio-hall-sensor {
+		compatible = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&hall_front_default &hall_back_default>;
+
+		label = "GPIO Hall Effect Sensor";
+
+		hall-front-sensor {
+			label = "Hall Effect Front Sensor";
+			gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>;
+			linux,input-type = <EV_SW>;
+			linux,code = <SW_LID>;
+			linux,can-disable;
+		};
+
+		hall-back-sensor {
+			label = "Hall Effect Back Sensor";
+			gpios = <&tlmm 75 GPIO_ACTIVE_HIGH>;
+			linux,input-type = <EV_SW>;
+			linux,code = <SW_MACHINE_COVER>;
+			linux,can-disable;
+		};
+	};
+
 	reserved-memory {
 		/*
 		 * This device being a WP platform has a very different
@@ -235,3 +296,19 @@ &blsp2_uart2 {
 &sdhc1 {
 	status = "okay";
 };
+
+&tlmm {
+	hall_front_default: hall-front-default {
+		pins = "gpio42";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	hall_back_default: hall-back-default {
+		pins = "gpio75";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+};
-- 
2.30.0


  parent reply	other threads:[~2021-01-31  1:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-31  1:38 [PATCH 00/18] 8992/4/Lumia 950/XL DTS updates Konrad Dybcio
2021-01-31  1:38 ` [PATCH 01/18] arm64: dts: qcom: msm8994: Add SMP2P nodes Konrad Dybcio
2021-01-31  1:38 ` [PATCH 02/18] arm64: dts: qcom: msm8994: Fix remaining BLSP errors/mistakes Konrad Dybcio
2021-01-31  1:38 ` [PATCH 03/18] arm64: dts: qcom: msm8994: Sort hwlock properly Konrad Dybcio
2021-01-31  1:38 ` [PATCH 04/18] arm64: dts: qcom: msm8992: Make the DT an overlay on top of 8994 Konrad Dybcio
2021-01-31  1:38 ` [PATCH 05/18] arm64: dts: qcom: msm8992/4-lumia*: Create a common DTS Konrad Dybcio
2021-01-31  1:38 ` [PATCH 06/18] arm64: dts: qcom: msm8994-octagon: Fix up the memory map Konrad Dybcio
2021-01-31  1:38 ` Konrad Dybcio [this message]
2021-01-31  1:38 ` [PATCH 08/18] arm64: dts: qcom: msm8994-octagon: Configure regulators Konrad Dybcio
2021-01-31  1:38 ` [PATCH 09/18] arm64: dts: qcom: msm8994-octagon: Add QCA6174 bluetooth Konrad Dybcio
2021-01-31  1:38 ` [PATCH 10/18] arm64: dts: qcom: msm8994-octagon: Configure HD3SS460 Type-C mux pins Konrad Dybcio
2021-01-31  1:38 ` [PATCH 11/18] arm64: dts: qcom: msm8994-octagon: Add uSD card and disable HS400 on eMMC Konrad Dybcio
2021-02-18 13:41   ` Pavel Machek
2021-01-31  1:38 ` [PATCH 12/18] arm64: dts: qcom: msm8994-octagon: Configure Lattice iCE40 FPGA Konrad Dybcio
2021-02-18 13:43   ` Pavel Machek
2021-01-31  1:38 ` [PATCH 13/18] arm64: dts: qcom: msm8994-octagon: Configure PON keys Konrad Dybcio
2021-01-31  1:38 ` [PATCH 14/18] arm64: dts: qcom: msm8994-octagon: Add FM Radio and DDR regulator nodes Konrad Dybcio
2021-01-31  1:38 ` [PATCH 15/18] arm64: dts: qcom: msm8994-octagon: Add NXP NFC node Konrad Dybcio
2021-01-31  1:38 ` [PATCH 16/18] arm64: dts: qcom: msm8994-octagon: Add sensors on blsp1_i2c5 Konrad Dybcio
2021-01-31  1:38 ` [PATCH 17/18] arm64: dts: qcom: msm8994-octagon: Add TAS2553 codec Konrad Dybcio
2021-01-31  1:38 ` [PATCH 18/18] arm64: dts: qcom: msm8994-octagon: Add AD7147 and APDS9930 sensors Konrad Dybcio

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=20210131013853.55810-8-konrad.dybcio@somainline.org \
    --to=konrad.dybcio@somainline.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gustave.monce@outlook.com \
    --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).