firmware-utils: bump to git HEAD
[openwrt/staging/ldir.git] / target / linux / bcm27xx / patches-5.4 / 950-0755-overlays-gpio-shutdown-Add-information-for-Raspberry.patch
1 From 5f9fcc99c517a517e8d74ce001fc5bc2648f0e59 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Thu, 30 Apr 2020 19:41:10 +0200
4 Subject: [PATCH] overlays: gpio-shutdown: Add information for
5 Raspberry Pi 1 Model B rev 1
6
7 Raspberry Pi 1 Model B rev 1 uses GPIO1 for power-up instead of GPIO3.
8 ---
9 arch/arm/boot/dts/overlays/README | 10 ++++++++--
10 arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts | 6 ++++--
11 2 files changed, 12 insertions(+), 4 deletions(-)
12
13 --- a/arch/arm/boot/dts/overlays/README
14 +++ b/arch/arm/boot/dts/overlays/README
15 @@ -883,9 +883,14 @@ Info: Initiates a shutdown when GPIO p
16 can be powered up again by driving GPIO3 low. The default
17 configuration uses GPIO3 with a pullup, so if you connect a
18 button between GPIO3 and GND (pin 5 and 6 on the 40-pin header),
19 - you get a shutdown and power-up button.
20 + you get a shutdown and power-up button. Please note that
21 + Raspberry Pi 1 Model B rev 1 uses GPIO1 instead of GPIO3.
22 Load: dtoverlay=gpio-shutdown,<param>=<val>
23 Params: gpio_pin GPIO pin to trigger on (default 3)
24 + For Raspberry Pi 1 Model B rev 1 set this
25 + explicitly to value 1, e.g.:
26 +
27 + dtoverlay=gpio-shutdown,gpio_pin=1
28
29 active_low When this is 1 (active low), a falling
30 edge generates a key down event and a
31 @@ -897,7 +902,8 @@ Params: gpio_pin GPIO pin
32 Default is "up".
33
34 Note that the default pin (GPIO3) has an
35 - external pullup.
36 + external pullup. Same applies for GPIO1
37 + on Raspberry Pi 1 Model B rev 1.
38
39 debounce Specify the debounce interval in milliseconds
40 (default 100)
41 --- a/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts
42 +++ b/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts
43 @@ -4,7 +4,9 @@
44
45 // This overlay sets up an input device that generates KEY_POWER events
46 // when a given GPIO pin changes. It defaults to using GPIO3, which can
47 -// also be used to wake up (start) the Rpi again after shutdown. Since
48 +// also be used to wake up (start) the Rpi again after shutdown.
49 +// Raspberry Pi 1 Model B rev 1 can be wake up only by GPIO1 pin, so for
50 +// these boards change default GPIO pin to 1 via gpio_pin parameter. Since
51 // wakeup is active-low, this defaults to active-low with a pullup
52 // enabled, but all of this can be changed using overlay parameters (but
53 // note that GPIO3 has an external pullup on at least some boards).
54 @@ -71,7 +73,7 @@
55
56 // Allow changing the internal pullup/down state. 0 = none, 1 = pulldown, 2 = pullup
57 // Note that GPIO3 and GPIO2 are the I2c pins and have an external pullup (at least
58 - // on some boards).
59 + // on some boards). Same applies for GPIO1 on Raspberry Pi 1 Model B rev 1.
60 gpio_pull = <&pin_state>,"brcm,pull:0";
61
62 // Allow setting the active_low flag. 0 = active high, 1 = active low