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
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.
11 See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=253680
13 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
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(+)
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
25 + debounce Specify the debounce interval in milliseconds
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
35 linux,code = <116>; // KEY_POWER
37 + debounce-interval = <100>; // ms
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";