diff options
| -rw-r--r-- | drivers/acpi/power.c | 2 | ||||
| -rw-r--r-- | drivers/acpi/scan.c | 17 | ||||
| -rw-r--r-- | drivers/pci/pci-acpi.c | 4 | ||||
| -rw-r--r-- | include/acpi/actypes.h | 7 |
4 files changed, 14 insertions, 16 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 7049a7d27c4f..330bb4d75852 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
| @@ -631,7 +631,7 @@ int acpi_power_get_inferred_state(struct acpi_device *device, int *state) | |||
| 631 | * We know a device's inferred power state when all the resources | 631 | * We know a device's inferred power state when all the resources |
| 632 | * required for a given D-state are 'on'. | 632 | * required for a given D-state are 'on'. |
| 633 | */ | 633 | */ |
| 634 | for (i = ACPI_STATE_D0; i < ACPI_STATE_D3; i++) { | 634 | for (i = ACPI_STATE_D0; i < ACPI_STATE_D3_HOT; i++) { |
| 635 | list = &device->power.states[i].resources; | 635 | list = &device->power.states[i].resources; |
| 636 | if (list->count < 1) | 636 | if (list->count < 1) |
| 637 | continue; | 637 | continue; |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 767e2dcb9616..7417267e88fa 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
| @@ -869,7 +869,7 @@ static int acpi_bus_get_power_flags(struct acpi_device *device) | |||
| 869 | /* | 869 | /* |
| 870 | * Enumerate supported power management states | 870 | * Enumerate supported power management states |
| 871 | */ | 871 | */ |
| 872 | for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3; i++) { | 872 | for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) { |
| 873 | struct acpi_device_power_state *ps = &device->power.states[i]; | 873 | struct acpi_device_power_state *ps = &device->power.states[i]; |
| 874 | char object_name[5] = { '_', 'P', 'R', '0' + i, '\0' }; | 874 | char object_name[5] = { '_', 'P', 'R', '0' + i, '\0' }; |
| 875 | 875 | ||
| @@ -884,21 +884,18 @@ static int acpi_bus_get_power_flags(struct acpi_device *device) | |||
| 884 | acpi_bus_add_power_resource(ps->resources.handles[j]); | 884 | acpi_bus_add_power_resource(ps->resources.handles[j]); |
| 885 | } | 885 | } |
| 886 | 886 | ||
| 887 | /* The exist of _PR3 indicates D3Cold support */ | ||
| 888 | if (i == ACPI_STATE_D3) { | ||
| 889 | status = acpi_get_handle(device->handle, object_name, &handle); | ||
| 890 | if (ACPI_SUCCESS(status)) | ||
| 891 | device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1; | ||
| 892 | } | ||
| 893 | |||
| 894 | /* Evaluate "_PSx" to see if we can do explicit sets */ | 887 | /* Evaluate "_PSx" to see if we can do explicit sets */ |
| 895 | object_name[2] = 'S'; | 888 | object_name[2] = 'S'; |
| 896 | status = acpi_get_handle(device->handle, object_name, &handle); | 889 | status = acpi_get_handle(device->handle, object_name, &handle); |
| 897 | if (ACPI_SUCCESS(status)) | 890 | if (ACPI_SUCCESS(status)) |
| 898 | ps->flags.explicit_set = 1; | 891 | ps->flags.explicit_set = 1; |
| 899 | 892 | ||
| 900 | /* State is valid if we have some power control */ | 893 | /* |
| 901 | if (ps->resources.count || ps->flags.explicit_set) | 894 | * State is valid if there are means to put the device into it. |
| 895 | * D3hot is only valid if _PR3 present. | ||
| 896 | */ | ||
| 897 | if (ps->resources.count || | ||
| 898 | (ps->flags.explicit_set && i < ACPI_STATE_D3_HOT)) | ||
| 902 | ps->flags.valid = 1; | 899 | ps->flags.valid = 1; |
| 903 | 900 | ||
| 904 | ps->power = -1; /* Unknown - driver assigned */ | 901 | ps->power = -1; /* Unknown - driver assigned */ |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 0f150f271c2a..1929c0c63b75 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
| @@ -200,7 +200,7 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev) | |||
| 200 | return PCI_D1; | 200 | return PCI_D1; |
| 201 | case ACPI_STATE_D2: | 201 | case ACPI_STATE_D2: |
| 202 | return PCI_D2; | 202 | return PCI_D2; |
| 203 | case ACPI_STATE_D3: | 203 | case ACPI_STATE_D3_HOT: |
| 204 | return PCI_D3hot; | 204 | return PCI_D3hot; |
| 205 | case ACPI_STATE_D3_COLD: | 205 | case ACPI_STATE_D3_COLD: |
| 206 | return PCI_D3cold; | 206 | return PCI_D3cold; |
| @@ -223,7 +223,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
| 223 | [PCI_D0] = ACPI_STATE_D0, | 223 | [PCI_D0] = ACPI_STATE_D0, |
| 224 | [PCI_D1] = ACPI_STATE_D1, | 224 | [PCI_D1] = ACPI_STATE_D1, |
| 225 | [PCI_D2] = ACPI_STATE_D2, | 225 | [PCI_D2] = ACPI_STATE_D2, |
| 226 | [PCI_D3hot] = ACPI_STATE_D3, | 226 | [PCI_D3hot] = ACPI_STATE_D3_HOT, |
| 227 | [PCI_D3cold] = ACPI_STATE_D3 | 227 | [PCI_D3cold] = ACPI_STATE_D3 |
| 228 | }; | 228 | }; |
| 229 | int error = -EINVAL; | 229 | int error = -EINVAL; |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index eba66043cf1b..e8bcc4742e0e 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h | |||
| @@ -499,9 +499,10 @@ typedef u64 acpi_integer; | |||
| 499 | #define ACPI_STATE_D0 (u8) 0 | 499 | #define ACPI_STATE_D0 (u8) 0 |
| 500 | #define ACPI_STATE_D1 (u8) 1 | 500 | #define ACPI_STATE_D1 (u8) 1 |
| 501 | #define ACPI_STATE_D2 (u8) 2 | 501 | #define ACPI_STATE_D2 (u8) 2 |
| 502 | #define ACPI_STATE_D3 (u8) 3 | 502 | #define ACPI_STATE_D3_HOT (u8) 3 |
| 503 | #define ACPI_STATE_D3_COLD (u8) 4 | 503 | #define ACPI_STATE_D3 (u8) 4 |
| 504 | #define ACPI_D_STATES_MAX ACPI_STATE_D3_COLD | 504 | #define ACPI_STATE_D3_COLD ACPI_STATE_D3 |
| 505 | #define ACPI_D_STATES_MAX ACPI_STATE_D3 | ||
| 505 | #define ACPI_D_STATE_COUNT 5 | 506 | #define ACPI_D_STATE_COUNT 5 |
| 506 | 507 | ||
| 507 | #define ACPI_STATE_C0 (u8) 0 | 508 | #define ACPI_STATE_C0 (u8) 0 |
