Module Name: src Committed By: jmcneill Date: Thu Jul 6 14:01:38 UTC 2017
Modified Files: src/sys/dev/fdt: gpiokeys.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/gpiokeys.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/fdt/gpiokeys.c diff -u src/sys/dev/fdt/gpiokeys.c:1.2 src/sys/dev/fdt/gpiokeys.c:1.3 --- src/sys/dev/fdt/gpiokeys.c:1.2 Wed Dec 16 19:33:55 2015 +++ src/sys/dev/fdt/gpiokeys.c Thu Jul 6 14:01:38 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: gpiokeys.c,v 1.2 2015/12/16 19:33:55 jmcneill Exp $ */ +/* $NetBSD: gpiokeys.c,v 1.3 2017/07/06 14:01:38 jmcneill Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcne...@invisible.ca> @@ -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.3 2017/07/06 14:01:38 jmcneill Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -128,6 +128,7 @@ gpiokeys_attach(device_t parent, device_ key->key_debounce = debounce; key->key_pin = fdtbus_gpio_acquire(child, "gpios", GPIO_PIN_INPUT); + key->key_state = fdtbus_gpio_read(key->key_pin); key->key_pswitch.smpsw_name = key->key_label; switch (code) {