d928458b7858f29867d3cab74475b1d60ac98696
[openwrt/staging/stintel.git] / target / linux / brcm2708 / patches-4.19 / 950-0723-overlays-gpio-shutdown-Add-debounce-parameter.patch
1 From 499e28e3a38f0de843b07bf4bbf7692b07c5e3ba Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 7 Oct 2019 13:51:07 +0100
4 Subject: [PATCH] overlays: gpio-shutdown: Add debounce parameter
5
6 Give the gpio-shutdown overlay a debounce parameter that requires
7 the GPIO to be held at the relevant level for a specified number
8 of milliseconds. The default value is 100 - higher than the driver
9 default of 5ms to avoid unfortunate glitches.
10
11 See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=253680
12
13 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
14 ---
15 arch/arm/boot/dts/overlays/README | 3 +++
16 arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts | 2 ++
17 2 files changed, 5 insertions(+)
18
19 --- a/arch/arm/boot/dts/overlays/README
20 +++ b/arch/arm/boot/dts/overlays/README
21 @@ -803,6 +803,9 @@ Params: gpio_pin GPIO pin
22 Note that the default pin (GPIO3) has an
23 external pullup.
24
25 + debounce Specify the debounce interval in milliseconds
26 + (default 100)
27 +
28
29 Name: hd44780-lcd
30 Info: Configures an HD44780 compatible LCD display. Uses 4 gpio pins for
31 --- a/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts
32 +++ b/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts
33 @@ -53,6 +53,7 @@
34 label = "shutdown";
35 linux,code = <116>; // KEY_POWER
36 gpios = <&gpio 3 1>;
37 + debounce-interval = <100>; // ms
38 };
39 };
40 };
41 @@ -75,6 +76,7 @@
42
43 // Allow setting the active_low flag. 0 = active high, 1 = active low
44 active_low = <&button>,"gpios:8";
45 + debounce = <&button>,"debounce-interval:0";
46 };
47
48 };