Skip to contentSkip to conversation

ARM: tegra: enable gpio-keys on dalmore

PATCH Superseded Laxman Dewangan 2 participants 2 messages Jul 5, 2013

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: tegra: enable gpio-keys on dalmore

Dalmore have the keys mounted on board which are connected to different pins of Tegra.

Add the keys entry in DTS file to enable key functionality. This will enable KEY_POWER, KEY_HOME, KEY_VOLUMEUP and KEY_VOLUMEDOWN.

---
 arch/arm/boot/dts/tegra114-dalmore.dts |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
arch/arm/boot/dts/tegra114-dalmore.dts +29 -0
index cb640eb..886b66d 100644
@@ -976,4 +976,33 @@
 			 <&tegra_car TEGRA114_CLK_EXTERN1>;
 		clock-names = "pll_a", "pll_a_out0", "mclk";
 	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		power {
+			label = "Power";
+			gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
+			linux,code = <116>; /* KEY_POWER */
+			gpio-key,wakeup;
+		};
+
+		home {
+			label = "Home";
+			gpios = <&gpio TEGRA_GPIO(I, 5) GPIO_ACTIVE_LOW>;
+			linux,code = <102>; /* KEY_HOME */
+		};
+
+		volume_up {
+			label = "VolumeUp";
+			gpios = <&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_LOW>;
+			linux,code = <115>; /* KEY_VOLUMEUP */
+		};
+
+		volume_down {
+			label = "VolumeDown";
+			gpios = <&gpio TEGRA_GPIO(R, 1) GPIO_ACTIVE_LOW>;
+			linux,code = <114>; /* KEY_VOLUMEDOWN */
+		};
+	};
 };
Signature · 1 line
1.7.1.1
#1 lore raw
Quoted 8 lines · Laxman Dewangan

Dalmore have the keys mounted on board which are connected to different pins of Tegra.

Add the keys entry in DTS file to enable key functionality. This will enable KEY_POWER, KEY_HOME, KEY_VOLUMEUP and KEY_VOLUMEDOWN.

arch/arm/boot/dts/tegra114-dalmore.dts line 980

Quoted 6 lines
arch/arm/boot/dts/tegra114-dalmore.dts +2 -0
 
 			 <&tegra_car TEGRA114_CLK_EXTERN1>;
 		clock-names = "pll_a", "pll_a_out0", "mclk";
 	};
+
+	gpio-keys {

The node above is "sound". This node should be before that node so they're alphabetically sorted.

arch/arm/boot/dts/tegra114-dalmore.dts line 990

Quoted 10 lines
arch/arm/boot/dts/tegra114-dalmore.dts +10 -0
+		compatible = "gpio-keys";
+
+		power {
+			label = "Power";
+			gpios = <&gpio TEGRA_GPIO(Q, 0) GPIO_ACTIVE_LOW>;
+			linux,code = <116>; /* KEY_POWER */
+			gpio-key,wakeup;
+		};
+
+		home {

Similarly, the nodes inside gpio-keys should also be sorted alphabetically.