diff options
author | Robert Nagy <robert@cvs.openbsd.org> | 2022-01-12 15:05:39 +0000 |
---|---|---|
committer | Robert Nagy <robert@cvs.openbsd.org> | 2022-01-12 15:05:39 +0000 |
commit | 2d1cc5d3c3367d92a72842cf97486c47329af799 (patch) | |
tree | d06c0eb78aec2188da581700cad1bbd68d267f18 /sys/arch | |
parent | deb0bad5c3165c91f795511faa09fad437c51382 (diff) |
toggle hw.power based on the ACDI SMR key if available
ok kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm64/dev/aplsmc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/arm64/dev/aplsmc.c b/sys/arch/arm64/dev/aplsmc.c index bdb95284033..80f9f52a4c8 100644 --- a/sys/arch/arm64/dev/aplsmc.c +++ b/sys/arch/arm64/dev/aplsmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aplsmc.c,v 1.4 2022/01/12 13:08:06 robert Exp $ */ +/* $OpenBSD: aplsmc.c,v 1.5 2022/01/12 15:05:38 robert Exp $ */ /* * Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org> * @@ -361,6 +361,7 @@ aplsmc_read_key(struct aplsmc_softc *sc, uint32_t key, void *data, size_t len) void aplsmc_refresh_sensors(void *arg) { + extern int hw_power; struct aplsmc_softc *sc = arg; struct aplsmc_sensor *sensor; int64_t value; @@ -417,5 +418,8 @@ aplsmc_refresh_sensors(void *arg) sc->sc_sensors[i].flags &= ~SENSOR_FUNKNOWN; sc->sc_sensors[i].value = value; } + + if (strcmp(sensor->key, "ACDI") == 0) + hw_power = (value > 0); } } |