diff options
author | Jaechul Lee <jcsing.lee@samsung.com> | 2019-04-01 08:22:08 +0900 |
---|---|---|
committer | Junghoon Kim <jhoon20.kim@samsung.com> | 2019-06-11 09:35:55 +0900 |
commit | 1f8f55aa0232babaf13726b90361518f6f0b3998 (patch) | |
tree | 38fbce24f0c1fdf816a2e6d14f392a08ed3eb6e8 | |
parent | 5156b58304c3847f9c978afccfc23668747ceeba (diff) | |
download | linux-rpi3-1f8f55aa0232babaf13726b90361518f6f0b3998.tar.gz linux-rpi3-1f8f55aa0232babaf13726b90361518f6f0b3998.tar.bz2 linux-rpi3-1f8f55aa0232babaf13726b90361518f6f0b3998.zip |
ARM64: dts: bcm2710-rpi-3-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
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>
-rw-r--r-- | arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts | 66 | ||||
-rw-r--r-- | arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 66 | ||||
-rw-r--r-- | rpi3/boot/config_32bit.txt | 3 | ||||
-rw-r--r-- | rpi3/boot/config_64bit.txt | 3 |
4 files changed, 138 insertions, 0 deletions
diff --git a/arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts b/arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts index d9a3f6f07b70..841a361ec959 100644 --- a/arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts +++ b/arch/arm/boot/dts/bcm2710-rpi-3-b-plus.dts @@ -7,6 +7,7 @@ #include "bcm2710.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"; @@ -33,6 +34,40 @@ 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 { @@ -89,6 +124,37 @@ 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 { diff --git a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts index 924b29640f8e..90f33ba01ca9 100644 --- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts @@ -7,6 +7,7 @@ #include "bcm2710.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"; @@ -33,6 +34,40 @@ 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 { @@ -89,6 +124,37 @@ 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 { diff --git a/rpi3/boot/config_32bit.txt b/rpi3/boot/config_32bit.txt index 5874929afc52..20c5c1f57274 100644 --- a/rpi3/boot/config_32bit.txt +++ b/rpi3/boot/config_32bit.txt @@ -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 diff --git a/rpi3/boot/config_64bit.txt b/rpi3/boot/config_64bit.txt index dd5ec8b2f32e..228d9459dcf4 100644 --- a/rpi3/boot/config_64bit.txt +++ b/rpi3/boot/config_64bit.txt @@ -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 |