ARM64: dts: bcm2710-rpi-3-b: Adds buttons for speaker profile
authorJaechul Lee <jcsing.lee@samsung.com>
Sun, 31 Mar 2019 23:22:08 +0000 (08:22 +0900)
committerHoegeun Kwon <hoegeun.kwon@samsung.com>
Mon, 4 Nov 2019 09:00:55 +0000 (18:00 +0900)
Tizen Speaker Profile uses a keypad that consists of 5 buttons for
up/down/left/right/center. The buttons are connected to GPIO pins as
follows.

GPIO16 : KEY_VOLUMEUP
GPIO13 : KEY_VOLUMEDOWN
GPIO6 : KEY_FASTFORWARD
GPIO12 : KEY_REWIND
GPIO26 : KEY_PLAYPAUSE

gpio=6,12,13,16,26=ip,pu at config.txt means that 6,12,13,16,26 pins are used as
input and pullup mode.

Change-Id: I8b7fe4fa360c2d17042e31270702d7abe49a5977
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts
arch/arm/boot/dts/bcm2710-rpi-3-b.dts
rpi3/boot/config_32bit.txt
rpi3/boot/config_64bit.txt

index 4014d83..a070991 100644 (file)
@@ -8,6 +8,7 @@
 #include "bcm2709-rpi.dtsi"
 #include "bcm283x-rpi-lan7515.dtsi"
 #include "bcm283x-rpi-csi1-2lane.dtsi"
+#include <dt-bindings/input/input.h>
 
 / {
        compatible = "raspberrypi,3-model-b-plus", "brcm,bcm2837";
                firmware = <&firmware>;
                status = "okay";
        };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               key-up {
+                       lable = "up";
+                       linux,code = <KEY_VOLUMEUP>;
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+               };
+
+               key-down {
+                       lable = "down";
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+               };
+
+               key-left {
+                       lable = "left";
+                       linux,code = <KEY_FASTFORWARD>;
+                       gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
+               };
+
+               key-right {
+                       lable = "right";
+                       linux,code = <KEY_REWIND>;
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+               };
+
+               key-center {
+                       lable = "center";
+                       linux,code = <KEY_PLAYPAUSE>;
+                       gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
+               };
+       };
 };
 
 &gpio {
                brcm,pins = <40 41>;
                brcm,function = <4>;
        };
+
+       /* Needs to describe gpio settings at config.txt */
+       key_up: key_up {
+               brcm,pins = <16>;
+               brcm,function = <1>; /* BCM2835_FSEL_GPIO_IN */
+               brcm,pull = <2>; /* BCM2835_PUD_UP */
+       };
+
+       key_down: key_down {
+               brcm,pins = <13>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
+
+       key_left: key_left {
+               brcm,pins = <6>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
+
+       key_right: key_right {
+               brcm,pins = <12>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
+
+       key_center: key_center {
+               brcm,pins = <26>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
 };
 
 &mmcnr {
index 511c6d1..f416b8c 100644 (file)
@@ -8,6 +8,7 @@
 #include "bcm2709-rpi.dtsi"
 #include "bcm283x-rpi-smsc9514.dtsi"
 #include "bcm283x-rpi-csi1-2lane.dtsi"
+#include <dt-bindings/input/input.h>
 
 / {
        compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
                firmware = <&firmware>;
                status = "okay";
        };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               key-up {
+                       lable = "up";
+                       linux,code = <KEY_VOLUMEUP>;
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+               };
+
+               key-down {
+                       lable = "down";
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+               };
+
+               key-left {
+                       lable = "left";
+                       linux,code = <KEY_FASTFORWARD>;
+                       gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
+               };
+
+               key-right {
+                       lable = "right";
+                       linux,code = <KEY_REWIND>;
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+               };
+
+               key-center {
+                       lable = "center";
+                       linux,code = <KEY_PLAYPAUSE>;
+                       gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
+               };
+       };
 };
 
 &gpio {
                brcm,pins = <40 41>;
                brcm,function = <4>;
        };
+
+       /* Needs to describe gpio settings at config.txt */
+       key_up: key_up {
+               brcm,pins = <16>;
+               brcm,function = <1>; /* BCM2835_FSEL_GPIO_IN */
+               brcm,pull = <2>; /* BCM2835_PUD_UP */
+       };
+
+       key_down: key_down {
+               brcm,pins = <13>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
+
+       key_left: key_left {
+               brcm,pins = <6>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
+
+       key_right: key_right {
+               brcm,pins = <12>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
+
+       key_center: key_center {
+               brcm,pins = <26>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
 };
 
 &mmcnr {
index 5874929..20c5c1f 100644 (file)
@@ -83,3 +83,6 @@ disable_camera_led=1
 
 # Minimum GPU memory for camera use
 gpu_mem=128
+
+# Set gpio pins to Input, Pullup mode.
+gpio=6,12,13,16,26=ip,pu
index dd5ec8b..228d945 100644 (file)
@@ -83,3 +83,6 @@ disable_camera_led=1
 
 # Minimum GPU memory for camera use
 gpu_mem=128
+
+# Set gpio pins to Input, Pullup mode.
+gpio=6,12,13,16,26=ip,pu