From: Jaechul Lee Date: Sun, 31 Mar 2019 23:22:08 +0000 (+0900) Subject: ARM64: dts: bcm2710-rpi-3-b: Adds buttons for speaker profile X-Git-Tag: accepted/tizen/unified/20190614.051536~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f8f55aa0232babaf13726b90361518f6f0b3998;p=platform%2Fkernel%2Flinux-rpi3.git 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 --- 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 d9a3f6f..841a361 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 / { 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 = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + key-down { + lable = "down"; + linux,code = ; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + key-left { + lable = "left"; + linux,code = ; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + key-right { + lable = "right"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + key-center { + lable = "center"; + linux,code = ; + 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 924b296..90f33ba 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 / { 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 = ; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + key-down { + lable = "down"; + linux,code = ; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + key-left { + lable = "left"; + linux,code = ; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + }; + + key-right { + lable = "right"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + key-center { + lable = "center"; + linux,code = ; + 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 5874929..20c5c1f 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 dd5ec8b..228d945 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