bcm27xx: switch to 5.15
[openwrt/staging/chunkeey.git] / target / linux / bcm27xx / patches-5.10 / 950-0588-overlays-Allow-multiple-gpio-shutdown-instances.patch
1 From 76eb23d534419db5e794699ae77f1e644f975e8c Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Sun, 25 Apr 2021 21:07:03 +0100
4 Subject: [PATCH] overlays: Allow multiple gpio-shutdown instances
5
6 There is no reason not to support multiple gpio-shutdown signals,
7 so add the necessary __override__ magic.
8
9 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
10 ---
11 arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts | 6 ++++--
12 1 file changed, 4 insertions(+), 2 deletions(-)
13
14 --- a/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts
15 +++ b/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts
16 @@ -24,7 +24,7 @@
17 // by a "pinctrl client", as is done below. See:
18 // https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
19 // https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
20 - pin_state: shutdown_button_pins {
21 + pin_state: shutdown_button_pins@3 {
22 brcm,pins = <3>; // gpio number
23 brcm,function = <0>; // 0 = input, 1 = output
24 brcm,pull = <2>; // 0 = none, 1 = pull down, 2 = pull up
25 @@ -35,7 +35,7 @@
26 // Add a new device to the /soc devicetree node
27 target-path = "/soc";
28 __overlay__ {
29 - shutdown_button {
30 + shutdown_button: shutdown_button@3 {
31 // Let the gpio-keys driver handle this device. See:
32 // https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt
33 compatible = "gpio-keys";
34 @@ -69,6 +69,8 @@
35 __overrides__ {
36 // Allow overriding the GPIO number.
37 gpio_pin = <&button>,"gpios:4",
38 + <&shutdown_button>,"reg:0",
39 + <&pin_state>,"reg:0",
40 <&pin_state>,"brcm,pins:0";
41
42 // Allow changing the internal pullup/down state. 0 = none, 1 = pulldown, 2 = pullup