All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: msm8916-samsung-a2015: add tactile buttons and hall sensor
@ 2019-10-07  6:45 michael.srba
  2019-10-07  9:30 ` Stephan Gerhold
  2019-10-10  4:04 ` Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: michael.srba @ 2019-10-07  6:45 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: linux-arm-msm, devicetree, Stephan Gerhold, Michael Srba

From: Michael Srba <Michael.Srba@seznam.cz>

Add nodes for basic GPIO connected hardware to the Samsung A3/A5 common dtsi. 
This includes the Volume UP button, the Home button, and the hall sensor used 
to sense "smart cover" open state. Related to that, add a node for the Volume 
DOWN button, which is handled by the pm8916 as is common with msm8916 devices.

Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>
---
 .../qcom/msm8916-samsung-a2015-common.dtsi    | 76 +++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
index 6fc0b80d1f90..bd1eb3eeca53 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
@@ -3,6 +3,7 @@
 #include "msm8916.dtsi"
 #include "pm8916.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 
 / {
@@ -91,6 +92,44 @@
 		etm@85f000 { status = "disabled"; };
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&gpio_keys_default>;
+
+		label = "GPIO Buttons";
+
+		volume-up {
+			label = "Volume Up";
+			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_VOLUMEUP>;
+		};
+
+		home {
+			label = "Home";
+			gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_HOMEPAGE>;
+		};
+	};
+
+	gpio-hall-sensor {
+		compatible = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&gpio_hall_sensor_default>;
+
+		label = "GPIO Hall Effect Sensor";
+
+		hall-sensor {
+			label = "Hall Effect Sensor";
+			gpios = <&msmgpio 52 GPIO_ACTIVE_LOW>;
+			linux,input-type = <EV_SW>;
+			linux,code = <SW_LID>;
+			linux,can-disable;
+		};
+	};
+
 	i2c-muic {
 		compatible = "i2c-gpio";
 		sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
@@ -113,6 +152,30 @@
 };
 
 &msmgpio {
+	gpio_keys_default: gpio_keys_default {
+		pinmux {
+			function = "gpio";
+			pins = "gpio107", "gpio109";
+		};
+		pinconf {
+			pins = "gpio107", "gpio109";
+			drive-strength = <2>;
+			bias-pull-up;
+		};
+	};
+
+	gpio_hall_sensor_default: gpio_hall_sensor_default {
+		pinmux {
+			function = "gpio";
+			pins = "gpio52";
+		};
+		pinconf {
+			pins = "gpio52";
+			drive-strength = <2>;
+			bias-disable;
+		};
+	};
+
 	muic_int_default: muic_int_default {
 		pinmux {
 			function = "gpio";
@@ -238,3 +301,16 @@
 		regulator-max-microvolt = <2700000>;
 	};
 };
+
+&spmi_bus {
+	pm8916@0 {
+		pon@800 {
+			volume-down {
+				compatible = "qcom,pm8941-resin";
+				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+				bias-pull-up;
+				linux,code = <KEY_VOLUMEDOWN>;
+			};
+		};
+	};
+};
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: dts: msm8916-samsung-a2015: add tactile buttons and hall sensor
  2019-10-07  6:45 [PATCH] arm64: dts: msm8916-samsung-a2015: add tactile buttons and hall sensor michael.srba
@ 2019-10-07  9:30 ` Stephan Gerhold
  2019-10-10  4:04 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Stephan Gerhold @ 2019-10-07  9:30 UTC (permalink / raw)
  To: michael.srba; +Cc: Andy Gross, Bjorn Andersson, linux-arm-msm, devicetree

On Mon, Oct 07, 2019 at 08:45:28AM +0200, michael.srba@seznam.cz wrote:
> From: Michael Srba <Michael.Srba@seznam.cz>
> 
> Add nodes for basic GPIO connected hardware to the Samsung A3/A5 common dtsi. 
> This includes the Volume UP button, the Home button, and the hall sensor used 
> to sense "smart cover" open state. Related to that, add a node for the Volume 
> DOWN button, which is handled by the pm8916 as is common with msm8916 devices.
> 
> Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>

Reviewed-by: Stephan Gerhold <stephan@gerhold.net>
Tested-by: Stephan Gerhold <stephan@gerhold.net> # a5u

> ---
>  .../qcom/msm8916-samsung-a2015-common.dtsi    | 76 +++++++++++++++++++
>  1 file changed, 76 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> index 6fc0b80d1f90..bd1eb3eeca53 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> @@ -3,6 +3,7 @@
>  #include "msm8916.dtsi"
>  #include "pm8916.dtsi"
>  #include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
>  #include <dt-bindings/interrupt-controller/irq.h>
>  
>  / {
> @@ -91,6 +92,44 @@
>  		etm@85f000 { status = "disabled"; };
>  	};
>  
> +	gpio-keys {
> +		compatible = "gpio-keys";
> +
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&gpio_keys_default>;
> +
> +		label = "GPIO Buttons";
> +
> +		volume-up {
> +			label = "Volume Up";
> +			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_VOLUMEUP>;
> +		};
> +
> +		home {
> +			label = "Home";
> +			gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_HOMEPAGE>;
> +		};
> +	};
> +
> +	gpio-hall-sensor {
> +		compatible = "gpio-keys";
> +
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&gpio_hall_sensor_default>;
> +
> +		label = "GPIO Hall Effect Sensor";
> +
> +		hall-sensor {
> +			label = "Hall Effect Sensor";
> +			gpios = <&msmgpio 52 GPIO_ACTIVE_LOW>;
> +			linux,input-type = <EV_SW>;
> +			linux,code = <SW_LID>;
> +			linux,can-disable;
> +		};
> +	};
> +
>  	i2c-muic {
>  		compatible = "i2c-gpio";
>  		sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
> @@ -113,6 +152,30 @@
>  };
>  
>  &msmgpio {
> +	gpio_keys_default: gpio_keys_default {
> +		pinmux {
> +			function = "gpio";
> +			pins = "gpio107", "gpio109";
> +		};
> +		pinconf {
> +			pins = "gpio107", "gpio109";
> +			drive-strength = <2>;
> +			bias-pull-up;
> +		};
> +	};
> +
> +	gpio_hall_sensor_default: gpio_hall_sensor_default {
> +		pinmux {
> +			function = "gpio";
> +			pins = "gpio52";
> +		};
> +		pinconf {
> +			pins = "gpio52";
> +			drive-strength = <2>;
> +			bias-disable;
> +		};
> +	};
> +
>  	muic_int_default: muic_int_default {
>  		pinmux {
>  			function = "gpio";
> @@ -238,3 +301,16 @@
>  		regulator-max-microvolt = <2700000>;
>  	};
>  };
> +
> +&spmi_bus {
> +	pm8916@0 {
> +		pon@800 {
> +			volume-down {
> +				compatible = "qcom,pm8941-resin";
> +				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
> +				bias-pull-up;
> +				linux,code = <KEY_VOLUMEDOWN>;
> +			};
> +		};
> +	};
> +};
> -- 
> 2.23.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: dts: msm8916-samsung-a2015: add tactile buttons and hall sensor
  2019-10-07  6:45 [PATCH] arm64: dts: msm8916-samsung-a2015: add tactile buttons and hall sensor michael.srba
  2019-10-07  9:30 ` Stephan Gerhold
@ 2019-10-10  4:04 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2019-10-10  4:04 UTC (permalink / raw)
  To: michael.srba; +Cc: Andy Gross, linux-arm-msm, devicetree, Stephan Gerhold

On Sun 06 Oct 23:45 PDT 2019, michael.srba@seznam.cz wrote:

> From: Michael Srba <Michael.Srba@seznam.cz>
> 
> Add nodes for basic GPIO connected hardware to the Samsung A3/A5 common dtsi. 
> This includes the Volume UP button, the Home button, and the hall sensor used 
> to sense "smart cover" open state. Related to that, add a node for the Volume 
> DOWN button, which is handled by the pm8916 as is common with msm8916 devices.
> 
> Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>

Applied with Stephan's acks

Thanks,
Bjorn

> ---
>  .../qcom/msm8916-samsung-a2015-common.dtsi    | 76 +++++++++++++++++++
>  1 file changed, 76 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> index 6fc0b80d1f90..bd1eb3eeca53 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> @@ -3,6 +3,7 @@
>  #include "msm8916.dtsi"
>  #include "pm8916.dtsi"
>  #include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
>  #include <dt-bindings/interrupt-controller/irq.h>
>  
>  / {
> @@ -91,6 +92,44 @@
>  		etm@85f000 { status = "disabled"; };
>  	};
>  
> +	gpio-keys {
> +		compatible = "gpio-keys";
> +
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&gpio_keys_default>;
> +
> +		label = "GPIO Buttons";
> +
> +		volume-up {
> +			label = "Volume Up";
> +			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_VOLUMEUP>;
> +		};
> +
> +		home {
> +			label = "Home";
> +			gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_HOMEPAGE>;
> +		};
> +	};
> +
> +	gpio-hall-sensor {
> +		compatible = "gpio-keys";
> +
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&gpio_hall_sensor_default>;
> +
> +		label = "GPIO Hall Effect Sensor";
> +
> +		hall-sensor {
> +			label = "Hall Effect Sensor";
> +			gpios = <&msmgpio 52 GPIO_ACTIVE_LOW>;
> +			linux,input-type = <EV_SW>;
> +			linux,code = <SW_LID>;
> +			linux,can-disable;
> +		};
> +	};
> +
>  	i2c-muic {
>  		compatible = "i2c-gpio";
>  		sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
> @@ -113,6 +152,30 @@
>  };
>  
>  &msmgpio {
> +	gpio_keys_default: gpio_keys_default {
> +		pinmux {
> +			function = "gpio";
> +			pins = "gpio107", "gpio109";
> +		};
> +		pinconf {
> +			pins = "gpio107", "gpio109";
> +			drive-strength = <2>;
> +			bias-pull-up;
> +		};
> +	};
> +
> +	gpio_hall_sensor_default: gpio_hall_sensor_default {
> +		pinmux {
> +			function = "gpio";
> +			pins = "gpio52";
> +		};
> +		pinconf {
> +			pins = "gpio52";
> +			drive-strength = <2>;
> +			bias-disable;
> +		};
> +	};
> +
>  	muic_int_default: muic_int_default {
>  		pinmux {
>  			function = "gpio";
> @@ -238,3 +301,16 @@
>  		regulator-max-microvolt = <2700000>;
>  	};
>  };
> +
> +&spmi_bus {
> +	pm8916@0 {
> +		pon@800 {
> +			volume-down {
> +				compatible = "qcom,pm8941-resin";
> +				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
> +				bias-pull-up;
> +				linux,code = <KEY_VOLUMEDOWN>;
> +			};
> +		};
> +	};
> +};
> -- 
> 2.23.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-10  4:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07  6:45 [PATCH] arm64: dts: msm8916-samsung-a2015: add tactile buttons and hall sensor michael.srba
2019-10-07  9:30 ` Stephan Gerhold
2019-10-10  4:04 ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.