arm: dts: bcm2711-rpi-4-b: Adds buttons for speaker profile
authorJaechul Lee <jcsing.lee@samsung.com>
Mon, 4 Nov 2019 07:16:17 +0000 (16:16 +0900)
committerJunghoon Kim <jhoon20.kim@samsung.com>
Thu, 2 Apr 2020 04:09:10 +0000 (13:09 +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
GPIO25 : KEY_PLAYPAUSE

Change-Id: Iadaa10478c32517ae09c1c10f1d29d0f2518bfb5
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
arch/arm/boot/dts/bcm2711-rpi-4-b.dts
rpi4/boot/config.txt

index 2c56183..0a1b252 100644 (file)
@@ -3,6 +3,7 @@
 #include "bcm2711.dtsi"
 #include "bcm2711-rpi.dtsi"
 #include "bcm283x-rpi-csi1-2lane.dtsi"
+#include <dt-bindings/input/input.h>
 
 / {
        compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
                ethernet0 = &genet;
                pcie0 = &pcie_0;
        };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               key-volume-up {
+                       lable = "volume-up";
+                       linux,code = <KEY_VOLUMEUP>;
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+               };
+
+               key-volume-down {
+                       lable = "volume-down";
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+               };
+
+               key-fastforward {
+                       lable = "fastforward";
+                       linux,code = <KEY_FASTFORWARD>;
+                       gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
+               };
+
+               key-rewind {
+                       lable = "rewind";
+                       linux,code = <KEY_REWIND>;
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+               };
+
+               key-playpause {
+                       lable = "playpause";
+                       linux,code = <KEY_PLAYPAUSE>;
+                       gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
+               };
+       };
 };
 
 &mmcnr {
                brcm,pins = <40 41>;
                brcm,function = <4>;
        };
+
+       /* Needs to describe gpio settings at config.txt */
+       key_volume_up: key_volume_up {
+               brcm,pins = <16>;
+               brcm,function = <1>; /* BCM2835_FSEL_GPIO_IN */
+               brcm,pull = <2>; /* BCM2835_PUD_UP */
+       };
+
+       key_volume_down: key_volume_down {
+               brcm,pins = <13>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
+
+       key_fastforward: key_fastforward {
+               brcm,pins = <6>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
+
+       key_rewind: key_rewind {
+               brcm,pins = <12>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
+
+       key_playpause: key_playpause {
+               brcm,pins = <25>;
+               brcm,function = <1>;
+               brcm,pull = <2>;
+       };
 };
 
 &i2c0 {
index 1dd43e0..8984ea8 100644 (file)
@@ -77,3 +77,6 @@ disable_camera_led=1
 # Defines the HDMI output group DMT, set defualt mode 720p
 hdmi_group=2
 hdmi_mode=85
+
+# Set gpio pins to Input, Pullup mode.
+gpio=6,12,13,16,25=ip,pu