svn commit: r349140 - in stable/12: sbin/devd sys/dev/acpica

Mark Johnston markj at FreeBSD.org
Mon Jun 17 15:11:56 UTC 2019


Author: markj
Date: Mon Jun 17 15:11:54 2019
New Revision: 349140
URL: https://svnweb.freebsd.org/changeset/base/349140

Log:
  MFC r348459:
  acpi_dock(4): Notify devd(8) on dock status change.
  
  PR:	238138

Modified:
  stable/12/sbin/devd/devd.conf.5
  stable/12/sys/dev/acpica/acpi_dock.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/devd/devd.conf.5
==============================================================================
--- stable/12/sbin/devd/devd.conf.5	Mon Jun 17 15:11:04 2019	(r349139)
+++ stable/12/sbin/devd/devd.conf.5	Mon Jun 17 15:11:54 2019	(r349140)
@@ -41,7 +41,7 @@
 .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 .\" SOFTWARE.
 .\"
-.Dd July 20, 2018
+.Dd May 31, 2019
 .Dt DEVD.CONF 5
 .Os
 .Sh NAME
@@ -341,6 +341,8 @@ AC line state ($notify=0x00 is offline, 0x01 is online
 Button state ($notify=0x00 is power, 0x01 is sleep).
 .It Li CMBAT
 Battery events.
+.It Li Dock
+Dock state ($notify=0x00 is undocked, 0x01 is docked).
 .It Li Lid
 Lid state ($notify=0x00 is closed, 0x01 is open).
 .It Li PROCESSOR

Modified: stable/12/sys/dev/acpica/acpi_dock.c
==============================================================================
--- stable/12/sys/dev/acpica/acpi_dock.c	Mon Jun 17 15:11:04 2019	(r349139)
+++ stable/12/sys/dev/acpica/acpi_dock.c	Mon Jun 17 15:11:54 2019	(r349140)
@@ -256,11 +256,13 @@ acpi_dock_insert_children(device_t dev)
 static void
 acpi_dock_insert(device_t dev)
 {
-	struct acpi_dock_softc *sc;
+	struct acpi_dock_softc	*sc;
+	ACPI_HANDLE		h;
 
 	ACPI_SERIAL_ASSERT(dock);
 
 	sc = device_get_softc(dev);
+	h = acpi_get_handle(dev);
 
 	if (sc->status == ACPI_DOCK_STATUS_UNDOCKED ||
 	    sc->status == ACPI_DOCK_STATUS_UNKNOWN) {
@@ -270,8 +272,12 @@ acpi_dock_insert(device_t dev)
 			return;
 		}
 
-		if (!cold)
+		if (!cold) {
 			acpi_dock_insert_children(dev);
+
+			acpi_UserNotify("Dock", h, 1);
+		}
+
 		sc->status = ACPI_DOCK_STATUS_DOCKED;
 	}
 }
@@ -325,10 +331,13 @@ static void
 acpi_dock_removal(device_t dev)
 {
 	struct acpi_dock_softc *sc;
+	ACPI_HANDLE		h;
 
 	ACPI_SERIAL_ASSERT(dock);
 
 	sc = device_get_softc(dev);
+	h = acpi_get_handle(dev);
+
 	if (sc->status == ACPI_DOCK_STATUS_DOCKED ||
 	    sc->status == ACPI_DOCK_STATUS_UNKNOWN) {
 		acpi_dock_eject_children(dev);
@@ -342,6 +351,8 @@ acpi_dock_removal(device_t dev)
 			return;
 		}
 
+		acpi_UserNotify("Dock", h, 0);
+
 		sc->status = ACPI_DOCK_STATUS_UNDOCKED;
 	}
 
@@ -534,4 +545,3 @@ static devclass_t acpi_dock_devclass;
 
 DRIVER_MODULE(acpi_dock, acpi, acpi_dock_driver, acpi_dock_devclass, 0, 0);
 MODULE_DEPEND(acpi_dock, acpi, 1, 1, 1);
-


More information about the svn-src-all mailing list