Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jan 2010 06:24:24 +0000 (UTC)
From:      Mitsuru IWASAKI <iwasaki@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r202456 - stable/7/sys/dev/acpi_support
Message-ID:  <201001170624.o0H6OOkj033391@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: iwasaki
Date: Sun Jan 17 06:24:24 2010
New Revision: 202456
URL: http://svn.freebsd.org/changeset/base/202456

Log:
  MFC r201605: Update acpi_ibm syctl nodes on resume.

Modified:
  stable/7/sys/dev/acpi_support/acpi_ibm.c

Modified: stable/7/sys/dev/acpi_support/acpi_ibm.c
==============================================================================
--- stable/7/sys/dev/acpi_support/acpi_ibm.c	Sun Jan 17 06:24:09 2010	(r202455)
+++ stable/7/sys/dev/acpi_support/acpi_ibm.c	Sun Jan 17 06:24:24 2010	(r202456)
@@ -252,6 +252,7 @@ ACPI_SERIAL_DECL(ibm, "ACPI IBM extras")
 static int	acpi_ibm_probe(device_t dev);
 static int	acpi_ibm_attach(device_t dev);
 static int	acpi_ibm_detach(device_t dev);
+static int	acpi_ibm_resume(device_t dev);
 
 static void	ibm_led(void *softc, int onoff);
 static void	ibm_led_task(struct acpi_ibm_softc *sc, int pending __unused);
@@ -270,6 +271,7 @@ static device_method_t acpi_ibm_methods[
 	DEVMETHOD(device_probe, acpi_ibm_probe),
 	DEVMETHOD(device_attach, acpi_ibm_attach),
 	DEVMETHOD(device_detach, acpi_ibm_detach),
+	DEVMETHOD(device_resume, acpi_ibm_resume),
 
 	{0, 0}
 };
@@ -435,6 +437,34 @@ acpi_ibm_detach(device_t dev)
 }
 
 static int
+acpi_ibm_resume(device_t dev)
+{
+	struct acpi_ibm_softc *sc = device_get_softc(dev);
+
+	ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__);
+
+	ACPI_SERIAL_BEGIN(ibm);
+	for (int i = 0; acpi_ibm_sysctls[i].name != NULL; i++) {
+		int val;
+
+		if ((acpi_ibm_sysctls[i].access & CTLFLAG_RD) == 0) {
+			continue;
+		}
+
+		val = acpi_ibm_sysctl_get(sc, i);
+
+		if ((acpi_ibm_sysctls[i].access & CTLFLAG_WR) == 0) {
+			continue;
+		}
+
+		acpi_ibm_sysctl_set(sc, i, val);
+	}
+	ACPI_SERIAL_END(ibm);
+
+	return (0);
+}
+
+static int
 acpi_ibm_eventmask_set(struct acpi_ibm_softc *sc, int val)
 {
 	ACPI_OBJECT		arg[2];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001170624.o0H6OOkj033391>