devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: tegra210-smaug: Add gpio-key nodes
@ 2016-03-03 19:54 Rhyland Klein
       [not found] ` <1457034865-17826-1-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Rhyland Klein @ 2016-03-03 19:54 UTC (permalink / raw)
  To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Stephen Warren, Thierry Reding, Alexandre Courbot
  Cc: Olof Johansson, Andrew Bresticker,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Rhyland Klein

Add gpio-key nodes for the volumn controls, lid switch,
tablet mode and power button.

Signed-off-by: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 43 +++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
index 750e85c45135..9c0ec3031e98 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
@@ -1,5 +1,7 @@
 /dts-v1/;
 
+#include <dt-bindings/input/input.h>
+
 #include "tegra210.dtsi"
 
 / {
@@ -76,6 +78,47 @@
 		};
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys";
+		gpio-keys,name = "gpio-keys";
+
+		power {
+			label = "Power";
+			gpios = <&gpio TEGRA_GPIO(X, 5) GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_POWER>;
+			debounce-interval = <30>;
+			gpio-key,wakeup;
+		};
+
+		lid {
+			label = "Lid";
+			gpios = <&gpio TEGRA_GPIO(B, 4) GPIO_ACTIVE_LOW>;
+			linux,input-type = <5>; /* EV_SW */
+			linux,code = <0>; /* SW_LID */
+			gpio-key,wakeup;
+		};
+
+		tablet_mode {
+			label = "Tablet Mode";
+			gpios = <&gpio TEGRA_GPIO(Z, 2) GPIO_ACTIVE_HIGH>;
+			linux,input-type = <5>; /* EV_SW */
+			linux,code = <1>; /* SW_TABLET_MODE */
+			gpio-key,wakeup;
+		};
+
+		volume_down {
+			label = "Volume Down";
+			gpios = <&gpio TEGRA_GPIO(X, 7) GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_VOLUMEDOWN>;
+		};
+
+		volume_up {
+			label = "Volume Up";
+			gpios = <&gpio TEGRA_GPIO(M, 4) GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_VOLUMEUP>;
+		};
+	};
+
 	psci {
 		compatible = "arm,psci-1.0";
 		method = "smc";
-- 
1.9.1

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

* Re: [PATCH] arm64: tegra210-smaug: Add gpio-key nodes
       [not found] ` <1457034865-17826-1-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2016-03-03 22:00   ` Andrew Bresticker
  2016-03-04  8:30   ` Thierry Reding
  2016-03-04  8:47   ` Thierry Reding
  2 siblings, 0 replies; 5+ messages in thread
From: Andrew Bresticker @ 2016-03-03 22:00 UTC (permalink / raw)
  To: Rhyland Klein
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Stephen Warren, Thierry Reding, Alexandre Courbot, Olof Johansson,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Rhyland,

On Thu, Mar 3, 2016 at 11:54 AM, Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> wrote:
> Add gpio-key nodes for the volumn controls, lid switch,
> tablet mode and power button.
>
> Signed-off-by: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Reviewed-by: Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

> ---
>  arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 43 +++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> index 750e85c45135..9c0ec3031e98 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> +++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> @@ -1,5 +1,7 @@
>  /dts-v1/;
>
> +#include <dt-bindings/input/input.h>
> +
>  #include "tegra210.dtsi"
>
>  / {
> @@ -76,6 +78,47 @@
>                 };
>         };
>
> +       gpio-keys {
> +               compatible = "gpio-keys";
> +               gpio-keys,name = "gpio-keys";
> +
> +               power {
> +                       label = "Power";
> +                       gpios = <&gpio TEGRA_GPIO(X, 5) GPIO_ACTIVE_LOW>;
> +                       linux,code = <KEY_POWER>;
> +                       debounce-interval = <30>;
> +                       gpio-key,wakeup;
> +               };
> +
> +               lid {
> +                       label = "Lid";
> +                       gpios = <&gpio TEGRA_GPIO(B, 4) GPIO_ACTIVE_LOW>;
> +                       linux,input-type = <5>; /* EV_SW */
> +                       linux,code = <0>; /* SW_LID */
> +                       gpio-key,wakeup;
> +               };
> +
> +               tablet_mode {
> +                       label = "Tablet Mode";
> +                       gpios = <&gpio TEGRA_GPIO(Z, 2) GPIO_ACTIVE_HIGH>;
> +                       linux,input-type = <5>; /* EV_SW */
> +                       linux,code = <1>; /* SW_TABLET_MODE */
> +                       gpio-key,wakeup;
> +               };
> +
> +               volume_down {
> +                       label = "Volume Down";
> +                       gpios = <&gpio TEGRA_GPIO(X, 7) GPIO_ACTIVE_LOW>;
> +                       linux,code = <KEY_VOLUMEDOWN>;
> +               };
> +
> +               volume_up {
> +                       label = "Volume Up";
> +                       gpios = <&gpio TEGRA_GPIO(M, 4) GPIO_ACTIVE_LOW>;
> +                       linux,code = <KEY_VOLUMEUP>;
> +               };
> +       };
> +
>         psci {
>                 compatible = "arm,psci-1.0";
>                 method = "smc";
> --
> 1.9.1
>

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

* Re: [PATCH] arm64: tegra210-smaug: Add gpio-key nodes
       [not found] ` <1457034865-17826-1-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  2016-03-03 22:00   ` Andrew Bresticker
@ 2016-03-04  8:30   ` Thierry Reding
  2016-03-04  8:47   ` Thierry Reding
  2 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2016-03-04  8:30 UTC (permalink / raw)
  To: Rhyland Klein
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Stephen Warren, Alexandre Courbot, Olof Johansson,
	Andrew Bresticker, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1822 bytes --]

On Thu, Mar 03, 2016 at 02:54:25PM -0500, Rhyland Klein wrote:
> Add gpio-key nodes for the volumn controls, lid switch,
> tablet mode and power button.
> 
> Signed-off-by: Rhyland Klein <rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
>  arch/arm64/boot/dts/nvidia/tegra210-smaug.dts | 43 +++++++++++++++++++++++++++
>  1 file changed, 43 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> index 750e85c45135..9c0ec3031e98 100644
> --- a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> +++ b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> @@ -1,5 +1,7 @@
>  /dts-v1/;
>  
> +#include <dt-bindings/input/input.h>
> +
>  #include "tegra210.dtsi"
>  
>  / {
> @@ -76,6 +78,47 @@
>  		};
>  	};
>  
> +	gpio-keys {
> +		compatible = "gpio-keys";
> +		gpio-keys,name = "gpio-keys";
> +
> +		power {
> +			label = "Power";
> +			gpios = <&gpio TEGRA_GPIO(X, 5) GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_POWER>;
> +			debounce-interval = <30>;
> +			gpio-key,wakeup;

This property was recently deprecated in favour of the standard generic
wakeup-source property.

> +		};
> +
> +		lid {
> +			label = "Lid";
> +			gpios = <&gpio TEGRA_GPIO(B, 4) GPIO_ACTIVE_LOW>;
> +			linux,input-type = <5>; /* EV_SW */
> +			linux,code = <0>; /* SW_LID */

The dt-bindings/input/input.h header defines the symbolic names for
these in upstream versions of the Linux kernel.

> +			gpio-key,wakeup;
> +		};
> +
> +		tablet_mode {
> +			label = "Tablet Mode";
> +			gpios = <&gpio TEGRA_GPIO(Z, 2) GPIO_ACTIVE_HIGH>;
> +			linux,input-type = <5>; /* EV_SW */
> +			linux,code = <1>; /* SW_TABLET_MODE */

Same here.

I've made all the above changes when applying, so no need to resend.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] arm64: tegra210-smaug: Add gpio-key nodes
       [not found] ` <1457034865-17826-1-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  2016-03-03 22:00   ` Andrew Bresticker
  2016-03-04  8:30   ` Thierry Reding
@ 2016-03-04  8:47   ` Thierry Reding
  2016-03-04 16:51     ` Rhyland Klein
  2 siblings, 1 reply; 5+ messages in thread
From: Thierry Reding @ 2016-03-04  8:47 UTC (permalink / raw)
  To: Rhyland Klein
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Stephen Warren, Alexandre Courbot, Olof Johansson,
	Andrew Bresticker, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 744 bytes --]

On Thu, Mar 03, 2016 at 02:54:25PM -0500, Rhyland Klein wrote:
> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
[...]
> +		lid {
> +			label = "Lid";
> +			gpios = <&gpio TEGRA_GPIO(B, 4) GPIO_ACTIVE_LOW>;
> +			linux,input-type = <5>; /* EV_SW */
> +			linux,code = <0>; /* SW_LID */
> +			gpio-key,wakeup;
> +		};
> +
> +		tablet_mode {
> +			label = "Tablet Mode";
> +			gpios = <&gpio TEGRA_GPIO(Z, 2) GPIO_ACTIVE_HIGH>;
> +			linux,input-type = <5>; /* EV_SW */
> +			linux,code = <1>; /* SW_TABLET_MODE */
> +			gpio-key,wakeup;
> +		};

Is there a way to trigger these on a DVT device? Power and volume
controls work fine, but I haven't found a way to test these two.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] arm64: tegra210-smaug: Add gpio-key nodes
  2016-03-04  8:47   ` Thierry Reding
@ 2016-03-04 16:51     ` Rhyland Klein
  0 siblings, 0 replies; 5+ messages in thread
From: Rhyland Klein @ 2016-03-04 16:51 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
	Stephen Warren, Alexandre Courbot, Olof Johansson,
	Andrew Bresticker, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

On 3/4/2016 3:47 AM, Thierry Reding wrote:
> * PGP Signed by an unknown key
> 
> On Thu, Mar 03, 2016 at 02:54:25PM -0500, Rhyland Klein wrote:
>> diff --git a/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts b/arch/arm64/boot/dts/nvidia/tegra210-smaug.dts
> [...]
>> +		lid {
>> +			label = "Lid";
>> +			gpios = <&gpio TEGRA_GPIO(B, 4) GPIO_ACTIVE_LOW>;
>> +			linux,input-type = <5>; /* EV_SW */
>> +			linux,code = <0>; /* SW_LID */
>> +			gpio-key,wakeup;
>> +		};
>> +
>> +		tablet_mode {
>> +			label = "Tablet Mode";
>> +			gpios = <&gpio TEGRA_GPIO(Z, 2) GPIO_ACTIVE_HIGH>;
>> +			linux,input-type = <5>; /* EV_SW */
>> +			linux,code = <1>; /* SW_TABLET_MODE */
>> +			gpio-key,wakeup;
>> +		};
> 
> Is there a way to trigger these on a DVT device? Power and volume
> controls work fine, but I haven't found a way to test these two.

First of all, thanks for catching the deprecated property and changes in
the input.h.

As for testing, both can be triggered with magnets. The lid switch is
near the camera on the top of the display. For me, the tablet-mode
sensor is around 1/3 up from the bottom (assuming camera is the top) on
the back side of the device. Not sure how that would line up for you
though...

-rhyland

-- 
nvpublic

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

end of thread, other threads:[~2016-03-04 16:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03 19:54 [PATCH] arm64: tegra210-smaug: Add gpio-key nodes Rhyland Klein
     [not found] ` <1457034865-17826-1-git-send-email-rklein-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-03-03 22:00   ` Andrew Bresticker
2016-03-04  8:30   ` Thierry Reding
2016-03-04  8:47   ` Thierry Reding
2016-03-04 16:51     ` Rhyland Klein

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).