From e1e17d0c8cbe78375a4c97d5da7a557b575e5bd8 Mon Sep 17 00:00:00 2001 From: Jaechul Lee Date: Mon, 4 Nov 2019 16:16:17 +0900 Subject: [PATCH] arm: dts: bcm2711-rpi-4-b: Adds buttons for speaker profile 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 Signed-off-by: Jaechul Lee Conflicts: arch/arm/boot/dts/bcm2711-rpi-4-b.dts Change-Id: I25bffde7c669c0572496ec3adbd4240fb2ed49cd Signed-off-by: Hoegeun Kwon --- arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 66 +++++++++++++++++++++++++++++++++++ rpi4/boot/config.txt | 3 ++ 2 files changed, 69 insertions(+) diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts index f290925..f51050b 100644 --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts @@ -3,6 +3,7 @@ #include "bcm2711.dtsi" #include "bcm2711-rpi.dtsi" //#include "bcm283x-rpi-usb-peripheral.dtsi" +#include / { compatible = "raspberrypi,4-model-b", "brcm,bcm2711"; @@ -13,6 +14,40 @@ stdout-path = "serial1:115200n8"; }; + gpio-keys { + compatible = "gpio-keys"; + + key-volume-up { + lable = "volume-up"; + linux,code = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + key-volume-down { + lable = "volume-down"; + linux,code = ; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + key-fastforward { + lable = "fastforward"; + linux,code = ; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + key-rewind { + lable = "rewind"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + key-playpause { + lable = "playpause"; + linux,code = ; + gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + }; + }; + leds { led-act { gpios = <&gpio 42 GPIO_ACTIVE_HIGH>; @@ -500,6 +535,37 @@ brcm,function = ; brcm,pull = <0 2>; }; + + /* 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>; + }; }; &i2c0if { diff --git a/rpi4/boot/config.txt b/rpi4/boot/config.txt index fd8bb13..9e9962a 100644 --- a/rpi4/boot/config.txt +++ b/rpi4/boot/config.txt @@ -82,3 +82,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 -- 2.7.4