mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Export the actual LID state via sysctl. This allows more complex
policies about when to suspend based on other events happening AND the lid being closed through the use of clever devd or other scripts.
This commit is contained in:
parent
8a3966405e
commit
1c2eb3e8d1
1 changed files with 8 additions and 0 deletions
|
|
@ -122,6 +122,14 @@ acpi_lid_attach(device_t dev)
|
|||
if (acpi_parse_prw(sc->lid_handle, &prw) == 0)
|
||||
AcpiEnableGpe(prw.gpe_handle, prw.gpe_bit);
|
||||
|
||||
/*
|
||||
* Export the lid status
|
||||
*/
|
||||
SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),
|
||||
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
|
||||
"state", CTLFLAG_RD, &sc->lid_status, 0,
|
||||
"Device set to wake the system");
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue