Date: Sun, 12 Mar 2017 18:00:02 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315166 - head/sys/dev/acpica Message-ID: <201703121800.v2CI02gr077071@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sun Mar 12 18:00:02 2017 New Revision: 315166 URL: https://svnweb.freebsd.org/changeset/base/315166 Log: 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. Modified: head/sys/dev/acpica/acpi_lid.c Modified: head/sys/dev/acpica/acpi_lid.c ============================================================================== --- head/sys/dev/acpica/acpi_lid.c Sun Mar 12 17:43:45 2017 (r315165) +++ head/sys/dev/acpica/acpi_lid.c Sun Mar 12 18:00:02 2017 (r315166) @@ -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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703121800.v2CI02gr077071>