Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Dec 2003 12:47:04 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 43463 for review
Message-ID:  <200312052047.hB5Kl42P051049@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help

http://perforce.freebsd.org/chv.cgi?CH=43463

Change 43463 by jhb@jhb_blue on 2003/12/05 12:46:37

	- Axe acpi_SetPowerState() and use acpi_pwr_switch_consumer()
	  instead.
	- Update notes.

Affected files ...

.. //depot/projects/power/notes#9 edit
.. //depot/projects/power/sys/dev/acpica/acpi.c#7 edit
.. //depot/projects/power/sys/dev/acpica/acpi_pci.c#5 edit
.. //depot/projects/power/sys/dev/acpica/acpivar.h#5 edit

Differences ...

==== //depot/projects/power/notes#9 (text+ko) ====

@@ -17,12 +17,13 @@
     powerstate via _PSx
   + fix ACPI PCI bus driver to call _PSx outside of calling the default
     PCI powerstate functions
-  - XXX: need to handle _PRx and _SxD !!
-    - We should be able to hook the power resource stuff up once we have
-      our power shadow tree in the acpi_SetPowerState() function.
-  - Use the power resource consumer power state change stuff in
+  + Handle power resources (_PRx)
+  - Handle _SxD
+  - Handle _IRC?
+  + Use the power resource consumer power state change stuff in
     acpi_SetDevicePowerState().  We need to pre-register all the resources
     and consumers in a tree sweep though to do this properly.
+  - Add tree sweep to register consumers and producers.
 - define a bus method for powering up/down devices
   - bus_set_powerstate(parent, child, state) where state is on or off
   # actually on/off is insufficient for a power management daemon that

==== //depot/projects/power/sys/dev/acpica/acpi.c#7 (text+ko) ====

@@ -1457,33 +1457,6 @@
 }
 
 /*
- * Set a specified device's power state.
- */
-ACPI_STATUS
-acpi_SetPowerState(ACPI_HANDLE handle, int state)
-{
-	char *method;
-
-	switch (state) {
-	case ACPI_STATE_D0:
-		method = "_PS0";
-		break;
-	case ACPI_STATE_D1:
-		method = "_PS1";
-		break;
-	case ACPI_STATE_D2:
-		method = "_PS2";
-		break;
-	case ACPI_STATE_D3:
-		method = "_PS3";
-		break;
-	default:
-		return (AE_BAD_PARAMETER);
-	}
-	return (AcpiEvaluateObject(handle, method, NULL, NULL));
-}
-
-/*
  * Set the system sleep state
  *
  * Currently we support S1-S5 but S4 is only S4BIOS

==== //depot/projects/power/sys/dev/acpica/acpi_pci.c#5 (text+ko) ====

@@ -177,7 +177,7 @@
 		if (error)
 			return (error);
 	}
-	status = acpi_SetPowerState(acpi_get_handle(child), acpi_state);
+	status = acpi_pwr_switch_consumer(acpi_get_handle(child), acpi_state);
 	if (ACPI_FAILURE(status))
 		device_printf(dev,
 		    "Failed to set ACPI power state D%d on %s: %s\n",

==== //depot/projects/power/sys/dev/acpica/acpivar.h#5 (text+ko) ====

@@ -189,7 +189,6 @@
 						  ACPI_RESOURCE *res);
 extern ACPI_STATUS	acpi_OverrideInterruptLevel(UINT32 InterruptNumber);
 extern ACPI_STATUS	acpi_SetIntrModel(int model);
-extern ACPI_STATUS	acpi_SetPowerState(ACPI_HANDLE handle, int state);
 extern ACPI_STATUS	acpi_SetSleepState(struct acpi_softc *sc, int state);
 extern ACPI_STATUS	acpi_Enable(struct acpi_softc *sc);
 extern ACPI_STATUS	acpi_Disable(struct acpi_softc *sc);



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