Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Mar 2020 09:13:27 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r358535 - stable/11/sys/dev/acpica
Message-ID:  <202003020913.0229DRfU053848@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Mar  2 09:13:26 2020
New Revision: 358535
URL: https://svnweb.freebsd.org/changeset/base/358535

Log:
  MFC r315166:
  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:
  stable/11/sys/dev/acpica/acpi_lid.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/acpica/acpi_lid.c
==============================================================================
--- stable/11/sys/dev/acpica/acpi_lid.c	Mon Mar  2 09:09:16 2020	(r358534)
+++ stable/11/sys/dev/acpica/acpi_lid.c	Mon Mar  2 09:13:26 2020	(r358535)
@@ -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?202003020913.0229DRfU053848>