patch-2.4.10 linux/drivers/acpi/ospm/busmgr/bmpm.c
Next file: linux/drivers/acpi/ospm/busmgr/bmpower.c
Previous file: linux/drivers/acpi/ospm/busmgr/bmnotify.c
Back to the patch index
Back to the overall index
- Lines: 342
- Date:
Sun Sep 23 09:42:32 2001
- Orig file:
v2.4.9/linux/drivers/acpi/ospm/busmgr/bmpm.c
- Orig date:
Tue Jul 3 17:08:19 2001
diff -u --recursive --new-file v2.4.9/linux/drivers/acpi/ospm/busmgr/bmpm.c linux/drivers/acpi/ospm/busmgr/bmpm.c
@@ -1,7 +1,7 @@
/*****************************************************************************
*
* Module Name: bmpm.c
- * $Revision: 10 $
+ * $Revision: 14 $
*
*****************************************************************************/
@@ -41,19 +41,19 @@
*
* FUNCTION: bm_get_inferred_power_state
*
- * PARAMETERS:
+ * PARAMETERS:
*
- * RETURN:
+ * RETURN:
*
- * DESCRIPTION:
+ * DESCRIPTION:
*
****************************************************************************/
-ACPI_STATUS
+acpi_status
bm_get_inferred_power_state (
BM_DEVICE *device)
{
- ACPI_STATUS status = AE_OK;
+ acpi_status status = AE_OK;
BM_HANDLE_LIST pr_list;
BM_POWER_STATE list_state = ACPI_STATE_UNKNOWN;
char object_name[5] = {'_','P','R','0','\0'};
@@ -72,18 +72,18 @@
/*
* Calculate Power State:
* ----------------------
- * Try to infer the devices's power state by checking the state of
+ * Try to infer the devices's power state by checking the state of
* the devices's power resources. We start by evaluating _PR0
* (resource requirements at D0) and work through _PR1 and _PR2.
- * We know the current devices power state when all resources (for
- * a give Dx state) are ON. If no power resources are on then the
+ * We know the current devices power state when all resources (for
+ * a give Dx state) are ON. If no power resources are on then the
* device is assumed to be off (D3).
*/
for (i=ACPI_STATE_D0; i<ACPI_STATE_D3; i++) {
object_name[3] = '0' + i;
- status = bm_evaluate_reference_list(device->acpi_handle,
+ status = bm_evaluate_reference_list(device->acpi_handle,
object_name, &pr_list);
if (ACPI_SUCCESS(status)) {
@@ -112,19 +112,19 @@
*
* FUNCTION: bm_get_power_state
*
- * PARAMETERS:
+ * PARAMETERS:
*
- * RETURN:
+ * RETURN:
*
- * DESCRIPTION:
+ * DESCRIPTION:
*
****************************************************************************/
-ACPI_STATUS
+acpi_status
bm_get_power_state (
BM_NODE *node)
{
- ACPI_STATUS status = AE_OK;
+ acpi_status status = AE_OK;
BM_DEVICE *device = NULL;
FUNCTION_TRACE("bm_get_power_state");
@@ -140,7 +140,7 @@
/*
* Power Control?
* --------------
- * If this device isn't directly power manageable (e.g. doesn't
+ * If this device isn't directly power manageable (e.g. doesn't
* include _PR0/_PS0) then there's nothing to do (state is static).
*/
if (!BM_IS_POWER_CONTROL(device)) {
@@ -163,7 +163,7 @@
* dependencies).
*/
if (BM_IS_POWER_STATE(device)) {
- status = bm_evaluate_simple_integer(device->acpi_handle,
+ status = bm_evaluate_simple_integer(device->acpi_handle,
"_PSC", &(device->power.state));
}
else {
@@ -171,10 +171,10 @@
}
if (ACPI_SUCCESS(status)) {
- DEBUG_PRINT(ACPI_INFO, ("Device [%02x] is at power state [D%d].\n", device->handle, device->power.state));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Device [%02x] is at power state [D%d].\n", device->handle, device->power.state));
}
else {
- DEBUG_PRINT(ACPI_INFO, ("Error getting power state for device [%02x]\n", device->handle));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Error getting power state for device [%02x]\n", device->handle));
}
return_ACPI_STATUS(status);
@@ -185,20 +185,20 @@
*
* FUNCTION: bm_set_power_state
*
- * PARAMETERS:
+ * PARAMETERS:
*
- * RETURN:
+ * RETURN:
*
- * DESCRIPTION:
+ * DESCRIPTION:
*
****************************************************************************/
-ACPI_STATUS
+acpi_status
bm_set_power_state (
BM_NODE *node,
BM_POWER_STATE state)
{
- ACPI_STATUS status = AE_OK;
+ acpi_status status = AE_OK;
BM_DEVICE *device = NULL;
BM_DEVICE *parent_device = NULL;
BM_HANDLE_LIST current_list;
@@ -220,7 +220,7 @@
/*
* Power Control?
* --------------
- * If this device isn't directly power manageable (e.g. doesn't
+ * If this device isn't directly power manageable (e.g. doesn't
* include _PR0/_PS0) then return an error (can't set state).
*/
if (!BM_IS_POWER_CONTROL(device)) {
@@ -242,31 +242,31 @@
* Can't be in a higher power state (lower Dx value) than parent.
*/
if (state < parent_device->power.state) {
- DEBUG_PRINT(ACPI_WARN, ("Cannot set device [%02x] to a higher-powered state than parent_device.\n", device->handle));
+ ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Cannot set device [%02x] to a higher-powered state than parent_device.\n", device->handle));
return_ACPI_STATUS(AE_ERROR);
}
/*
* Get Resources:
* --------------
- * Get the power resources associated with the device's current
+ * Get the power resources associated with the device's current
* and target power states.
*/
if (device->power.state != ACPI_STATE_UNKNOWN) {
object_name[3] = '0' + device->power.state;
- bm_evaluate_reference_list(device->acpi_handle,
+ bm_evaluate_reference_list(device->acpi_handle,
object_name, ¤t_list);
}
object_name[3] = '0' + state;
- bm_evaluate_reference_list(device->acpi_handle, object_name,
+ bm_evaluate_reference_list(device->acpi_handle, object_name,
&target_list);
/*
* Transition Resources:
* ---------------------
- * Transition all power resources referenced by this device to
- * the correct power state (taking into consideration sequencing
+ * Transition all power resources referenced by this device to
+ * the correct power state (taking into consideration sequencing
* and dependencies to other devices).
*/
if (current_list.count || target_list.count) {
@@ -279,7 +279,7 @@
/*
* Execute _PSx:
* -------------
- * Execute the _PSx method corresponding to the target Dx state,
+ * Execute the _PSx method corresponding to the target Dx state,
* if it exists.
*/
object_name[2] = 'S';
@@ -287,7 +287,7 @@
bm_evaluate_object(device->acpi_handle, object_name, NULL, NULL);
if (ACPI_SUCCESS(status)) {
- DEBUG_PRINT(ACPI_INFO, ("Device [%02x] is now at [D%d].\n", device->handle, state));
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Device [%02x] is now at [D%d].\n", device->handle, state));
device->power.state = state;
}
@@ -299,22 +299,22 @@
*
* FUNCTION: bm_get_pm_capabilities
*
- * PARAMETERS:
+ * PARAMETERS:
*
- * RETURN:
+ * RETURN:
*
- * DESCRIPTION:
+ * DESCRIPTION:
*
****************************************************************************/
-ACPI_STATUS
+acpi_status
bm_get_pm_capabilities (
BM_NODE *node)
{
- ACPI_STATUS status = AE_OK;
+ acpi_status status = AE_OK;
BM_DEVICE *device = NULL;
BM_DEVICE *parent_device = NULL;
- ACPI_HANDLE acpi_handle = NULL;
+ acpi_handle acpi_handle = NULL;
BM_POWER_STATE dx_supported = ACPI_STATE_UNKNOWN;
char object_name[5] = {'_','S','0','D','\0'};
u32 i = 0;
@@ -332,17 +332,17 @@
* Power Management Flags:
* -----------------------
*/
- if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PSC",
+ if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PSC",
&acpi_handle))) {
device->power.flags |= BM_FLAGS_POWER_STATE;
}
- if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_IRC",
+ if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_IRC",
&acpi_handle))) {
device->power.flags |= BM_FLAGS_INRUSH_CURRENT;
}
- if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PRW",
+ if (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PRW",
&acpi_handle))) {
device->power.flags |= BM_FLAGS_WAKE_CAPABLE;
}
@@ -362,22 +362,22 @@
* Figure out which Dx states are supported by this device for the
* S0 (working) state. Note that D0 and D3 are required (assumed).
*/
- device->power.dx_supported[ACPI_STATE_S0] = BM_FLAGS_D0_SUPPORT |
+ device->power.dx_supported[ACPI_STATE_S0] = BM_FLAGS_D0_SUPPORT |
BM_FLAGS_D3_SUPPORT;
- if ((ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PR1",
- &acpi_handle))) ||
- (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PS1",
+ if ((ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PR1",
+ &acpi_handle))) ||
+ (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PS1",
&acpi_handle)))) {
- device->power.dx_supported[ACPI_STATE_S0] |=
+ device->power.dx_supported[ACPI_STATE_S0] |=
BM_FLAGS_D1_SUPPORT;
}
- if ((ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PR2",
- &acpi_handle))) ||
- (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PS2",
+ if ((ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PR2",
+ &acpi_handle))) ||
+ (ACPI_SUCCESS(acpi_get_handle(device->acpi_handle, "_PS2",
&acpi_handle)))) {
- device->power.dx_supported[ACPI_STATE_S0] |=
+ device->power.dx_supported[ACPI_STATE_S0] |=
BM_FLAGS_D2_SUPPORT;
}
@@ -395,30 +395,30 @@
device->power.dx_supported[i] = BM_FLAGS_D3_SUPPORT;
/*
- * Evalute _SxD:
+ * Evalute _Sx_d:
* -------------
- * Which returns the highest (power) Dx state supported in
- * this system (Sx) state. We convert this value to a bit
+ * Which returns the highest (power) Dx state supported in
+ * this system (Sx) state. We convert this value to a bit
* mask of supported states (conceptually simpler).
*/
- status = bm_evaluate_simple_integer(device->acpi_handle,
+ status = bm_evaluate_simple_integer(device->acpi_handle,
object_name, &dx_supported);
if (ACPI_SUCCESS(status)) {
switch (dx_supported) {
case 0:
- device->power.dx_supported[i] |=
+ device->power.dx_supported[i] |=
BM_FLAGS_D0_SUPPORT;
/* fall through */
case 1:
- device->power.dx_supported[i] |=
+ device->power.dx_supported[i] |=
BM_FLAGS_D1_SUPPORT;
/* fall through */
case 2:
- device->power.dx_supported[i] |=
+ device->power.dx_supported[i] |=
BM_FLAGS_D2_SUPPORT;
/* fall through */
case 3:
- device->power.dx_supported[i] |=
+ device->power.dx_supported[i] |=
BM_FLAGS_D3_SUPPORT;
break;
}
@@ -426,12 +426,12 @@
/*
* Validate:
* ---------
- * Mask of any states that _Sx_d falsely advertises
- * (e.g.claims D1 support but neither _PR2 or _PS2
- * exist). In other words, S1-S5 can't offer a Dx
+ * Mask of any states that _Sx_d falsely advertises
+ * (e.g.claims D1 support but neither _PR2 or _PS2
+ * exist). In other words, S1-S5 can't offer a Dx
* state that isn't supported by S0.
*/
- device->power.dx_supported[i] &=
+ device->power.dx_supported[i] &=
device->power.dx_supported[ACPI_STATE_S0];
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)