Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/dev/fdt Pull up following revision(s) (requested by j...
details: https://anonhg.NetBSD.org/src/rev/b53963800e5d
branches: netbsd-8
changeset: 434088:b53963800e5d
user: martin <martin%NetBSD.org@localhost>
date: Fri Jul 07 09:29:23 2017 +0000
description:
Pull up following revision(s) (requested by jmcneill in ticket #101):
sys/dev/fdt/gpiokeys.c: revision 1.3
sys/dev/fdt/gpiokeys.c: revision 1.4
Read the initial key state at startup so we only trigger events on state
changes. Prevents a misconfigured power button from shutting us down at
boot.
Only read gpio pin if the pin is valid
diffstat:
sys/dev/fdt/gpiokeys.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r 7e3942a8f8a0 -r b53963800e5d sys/dev/fdt/gpiokeys.c
--- a/sys/dev/fdt/gpiokeys.c Fri Jul 07 09:23:01 2017 +0000
+++ b/sys/dev/fdt/gpiokeys.c Fri Jul 07 09:29:23 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gpiokeys.c,v 1.2 2015/12/16 19:33:55 jmcneill Exp $ */
+/* $NetBSD: gpiokeys.c,v 1.2.12.1 2017/07/07 09:29:23 martin Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gpiokeys.c,v 1.2 2015/12/16 19:33:55 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpiokeys.c,v 1.2.12.1 2017/07/07 09:29:23 martin Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -128,6 +128,8 @@
key->key_debounce = debounce;
key->key_pin = fdtbus_gpio_acquire(child, "gpios",
GPIO_PIN_INPUT);
+ if (key->key_pin)
+ key->key_state = fdtbus_gpio_read(key->key_pin);
key->key_pswitch.smpsw_name = key->key_label;
switch (code) {
Home |
Main Index |
Thread Index |
Old Index