[PATCH 6/6] arm64: dts: qcom: msm8953-flipkart-rimob: Enable Hall sensor

Cristian Cozzolino via B4 Relay posted 6 patches 1 month ago
There is a newer version of this series
[PATCH 6/6] arm64: dts: qcom: msm8953-flipkart-rimob: Enable Hall sensor
Posted by Cristian Cozzolino via B4 Relay 1 month ago
From: Cristian Cozzolino <cristian_ci@protonmail.com>

Enable the Hall effect sensor (flip cover) for Billion Capture+.
The GPIO is mapped to SW_LID events as in other qcom devices.

Signed-off-by: Cristian Cozzolino <cristian_ci@protonmail.com>
---
 .../arm64/boot/dts/qcom/msm8953-flipkart-rimob.dts | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8953-flipkart-rimob.dts b/arch/arm64/boot/dts/qcom/msm8953-flipkart-rimob.dts
index 709ea6fc9fbb..83812050a0a3 100644
--- a/arch/arm64/boot/dts/qcom/msm8953-flipkart-rimob.dts
+++ b/arch/arm64/boot/dts/qcom/msm8953-flipkart-rimob.dts
@@ -44,6 +44,24 @@ framebuffer@90001000 {
 		};
 	};
 
+	gpio-hall-sensor {
+		compatible = "gpio-keys";
+
+		pinctrl-0 = <&hall_sensor_default>;
+		pinctrl-names = "default";
+
+		label = "GPIO Hall Effect Sensor";
+
+		event-hall-sensor {
+			label = "Hall Effect Sensor";
+			gpios = <&tlmm 46 GPIO_ACTIVE_LOW>;
+			linux,input-type = <EV_SW>;
+			linux,code = <SW_LID>;
+			linux,can-disable;
+			wakeup-source;
+		};
+	};
+
 	gpio-keys {
 		compatible = "gpio-keys";
 
@@ -335,6 +353,13 @@ gpio_key_default: gpio-key-default-state {
 		bias-pull-up;
 	};
 
+	hall_sensor_default: hall-sensor-default-state {
+		pins = "gpio46";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
 	mdss_default: mdss-default-state {
 		pins = "gpio61";
 		function = "gpio";

-- 
2.52.0
Re: [PATCH 6/6] arm64: dts: qcom: msm8953-flipkart-rimob: Enable Hall sensor
Posted by Dmitry Baryshkov 1 month ago
On Sun, Mar 08, 2026 at 04:52:46PM +0100, Cristian Cozzolino via B4 Relay wrote:
> From: Cristian Cozzolino <cristian_ci@protonmail.com>
> 
> Enable the Hall effect sensor (flip cover) for Billion Capture+.
> The GPIO is mapped to SW_LID events as in other qcom devices.
> 
> Signed-off-by: Cristian Cozzolino <cristian_ci@protonmail.com>
> ---
>  .../arm64/boot/dts/qcom/msm8953-flipkart-rimob.dts | 25 ++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8953-flipkart-rimob.dts b/arch/arm64/boot/dts/qcom/msm8953-flipkart-rimob.dts
> index 709ea6fc9fbb..83812050a0a3 100644
> --- a/arch/arm64/boot/dts/qcom/msm8953-flipkart-rimob.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8953-flipkart-rimob.dts
> @@ -44,6 +44,24 @@ framebuffer@90001000 {
>  		};
>  	};
>  
> +	gpio-hall-sensor {
> +		compatible = "gpio-keys";

Is there a reason to have a separate device for it? It can be squashed
into the following gpio-keys.

> +
> +		pinctrl-0 = <&hall_sensor_default>;
> +		pinctrl-names = "default";
> +
> +		label = "GPIO Hall Effect Sensor";
> +
> +		event-hall-sensor {
> +			label = "Hall Effect Sensor";
> +			gpios = <&tlmm 46 GPIO_ACTIVE_LOW>;
> +			linux,input-type = <EV_SW>;
> +			linux,code = <SW_LID>;
> +			linux,can-disable;
> +			wakeup-source;
> +		};
> +	};
> +
>  	gpio-keys {
>  		compatible = "gpio-keys";
>  
> @@ -335,6 +353,13 @@ gpio_key_default: gpio-key-default-state {
>  		bias-pull-up;
>  	};
>  
> +	hall_sensor_default: hall-sensor-default-state {
> +		pins = "gpio46";
> +		function = "gpio";
> +		drive-strength = <2>;
> +		bias-disable;
> +	};
> +
>  	mdss_default: mdss-default-state {
>  		pins = "gpio61";
>  		function = "gpio";
> 
> -- 
> 2.52.0
> 
> 

-- 
With best wishes
Dmitry