diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-11-14 11:11:18 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-11-14 11:11:18 +0000 |
commit | 48fc3abcef14e03c0306c5ac89d754b8170d9582 (patch) | |
tree | b51202f588ff6625be62fe669adb8461488ef33f /sys/arch | |
parent | 2477eba3e1cd4e72b17c122dc369d224de73ac00 (diff) |
Turns out the power button on the Mac mini and the touchid button on the
various Macbook models generate different events. So rename the existing
constant for a "short press" of the touchid button and add support for the
power button on the Mac mini such that is can be resumed.
ok tobhe@, patrick@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm64/dev/aplsmc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/arm64/dev/aplsmc.c b/sys/arch/arm64/dev/aplsmc.c index e2b618e63f9..e3a82a7dd6f 100644 --- a/sys/arch/arm64/dev/aplsmc.c +++ b/sys/arch/arm64/dev/aplsmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aplsmc.c,v 1.17 2022/11/10 23:21:15 kettenis Exp $ */ +/* $OpenBSD: aplsmc.c,v 1.18 2022/11/14 11:11:17 kettenis Exp $ */ /* * Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org> * @@ -92,7 +92,8 @@ struct aplsmc_sensor { /* Button events */ #define SMC_PWRBTN_OFF 0x00 -#define SMC_PWRBTN_SHORT 0x06 +#define SMC_PWRBTN_SHORT 0x01 +#define SMC_PWRBTN_TOUCHID 0x06 #define SMC_PWRBTN_LONG 0xfe #define APLSMC_BE (1 << 0) @@ -346,6 +347,7 @@ aplsmc_handle_notification(struct aplsmc_softc *sc, uint64_t data) case SMC_EV_TYPE_BTN: switch (SMC_EV_SUBTYPE(data)) { case SMC_PWRBTN_SHORT: + case SMC_PWRBTN_TOUCHID: if (SMC_EV_DATA(data) == 1) { #ifdef SUSPEND if (cpu_suspended) { |