[PATCH 01/12] arm64: dts: qcom: sm6115-pro1x: Add Hall Switch and Camera Button

Dang Huynh posted 12 patches 1 year, 4 months ago
There is a newer version of this series
[PATCH 01/12] arm64: dts: qcom: sm6115-pro1x: Add Hall Switch and Camera Button
Posted by Dang Huynh 1 year, 4 months ago
The Pro1X has a flip keyboard and a single-state camera button.

Signed-off-by: Dang Huynh <danct12@riseup.net>
---
 arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts | 33 +++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts b/arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts
index 4a30024aa48f..5b7dd54be6b6 100644
--- a/arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts
+++ b/arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts
@@ -34,9 +34,24 @@ framebuffer0: framebuffer@5c000000 {
 
 	gpio-keys {
 		compatible = "gpio-keys";
-
-		pinctrl-0 = <&vol_up_n>;
 		pinctrl-names = "default";
+		pinctrl-0 = <&hall_sensor_n>, <&key_camera_n>, <&vol_up_n>;
+
+		hall-switch {
+			label = "Hall Switch";
+			linux,input-type = <EV_SW>;
+			linux,code = <SW_KEYPAD_SLIDE>;
+			gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
+			debounce-interval = <90>;
+			wakeup-source;
+		};
+
+		key-camera {
+			label = "Camera Button";
+			linux,code = <KEY_CAMERA>;
+			gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+		};
 
 		key-volume-up {
 			label = "Volume Up";
@@ -212,6 +227,20 @@ &sleep_clk {
 
 &tlmm {
 	gpio-reserved-ranges = <0 4>, <14 4>;
+
+	hall_sensor_n: hall-sensor-n {
+		pins = "gpio96";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	key_camera_n: key-camera-n {
+		pins = "gpio18";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
 };
 
 &ufs_mem_hc {

-- 
2.45.2
Re: [PATCH 01/12] arm64: dts: qcom: sm6115-pro1x: Add Hall Switch and Camera Button
Posted by Konrad Dybcio 1 year, 4 months ago
On 22.07.2024 9:10 AM, Dang Huynh wrote:
> The Pro1X has a flip keyboard and a single-state camera button.
> 
> Signed-off-by: Dang Huynh <danct12@riseup.net>
> ---
>  arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts | 33 +++++++++++++++++++++++--
>  1 file changed, 31 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts b/arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts
> index 4a30024aa48f..5b7dd54be6b6 100644
> --- a/arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts
> +++ b/arch/arm64/boot/dts/qcom/sm6115-fxtec-pro1x.dts
> @@ -34,9 +34,24 @@ framebuffer0: framebuffer@5c000000 {
>  
>  	gpio-keys {
>  		compatible = "gpio-keys";
> -
> -		pinctrl-0 = <&vol_up_n>;
>  		pinctrl-names = "default";
> +		pinctrl-0 = <&hall_sensor_n>, <&key_camera_n>, <&vol_up_n>;

Please don't reorder these

looks good otherwise

Konrad