* [PATCH] acpi: Add D3 cold state
@ 2011-05-04 14:56 Lin Ming
2011-05-04 15:47 ` Jesse Barnes
2011-05-29 6:21 ` Len Brown
0 siblings, 2 replies; 3+ messages in thread
From: Lin Ming @ 2011-05-04 14:56 UTC (permalink / raw)
To: Len Brown; +Cc: Jesse Barnes, linux-acpi, linux-pci, Moore, Robert
_SxW returns an Integer containing the lowest D-state supported in state
Sx. If OSPM has not indicated that it supports _PR3, then the value “3”
corresponds to D3. If it has indicated _PR3 support, the value “3”
represents D3hot and the value “4” represents D3cold.
Linux does set _OSC._PR3, so we should fix it to expect that _SxW can
return 4.
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---
drivers/acpi/bus.c | 2 +-
drivers/pci/pci-acpi.c | 2 ++
include/acpi/actypes.h | 5 +++--
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 9749980..d1e06c1 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -227,7 +227,7 @@ static int __acpi_bus_set_power(struct acpi_device *device, int state)
acpi_status status = AE_OK;
char object_name[5] = { '_', 'P', 'S', '0' + state, '\0' };
- if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))
+ if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3_COLD))
return -EINVAL;
/* Make sure this is a valid target state */
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 7c3b18e..d36f41e 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -195,6 +195,8 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev)
return PCI_D2;
case ACPI_STATE_D3:
return PCI_D3hot;
+ case ACPI_STATE_D3_COLD:
+ return PCI_D3cold;
}
return PCI_POWER_ERROR;
}
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 64f838b..f72cbe5 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -501,8 +501,9 @@ typedef u64 acpi_integer;
#define ACPI_STATE_D1 (u8) 1
#define ACPI_STATE_D2 (u8) 2
#define ACPI_STATE_D3 (u8) 3
-#define ACPI_D_STATES_MAX ACPI_STATE_D3
-#define ACPI_D_STATE_COUNT 4
+#define ACPI_STATE_D3_COLD (u8) 4
+#define ACPI_D_STATES_MAX ACPI_STATE_D3_COLD
+#define ACPI_D_STATE_COUNT 5
#define ACPI_STATE_C0 (u8) 0
#define ACPI_STATE_C1 (u8) 1
--
1.7.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] acpi: Add D3 cold state
2011-05-04 14:56 [PATCH] acpi: Add D3 cold state Lin Ming
@ 2011-05-04 15:47 ` Jesse Barnes
2011-05-29 6:21 ` Len Brown
1 sibling, 0 replies; 3+ messages in thread
From: Jesse Barnes @ 2011-05-04 15:47 UTC (permalink / raw)
To: Lin Ming; +Cc: Len Brown, linux-acpi, linux-pci, Moore, Robert
On Wed, 04 May 2011 22:56:43 +0800
Lin Ming <ming.m.lin@intel.com> wrote:
> _SxW returns an Integer containing the lowest D-state supported in state
> Sx. If OSPM has not indicated that it supports _PR3, then the value “3”
> corresponds to D3. If it has indicated _PR3 support, the value “3”
> represents D3hot and the value “4” represents D3cold.
>
> Linux does set _OSC._PR3, so we should fix it to expect that _SxW can
> return 4.
>
> Signed-off-by: Lin Ming <ming.m.lin@intel.com>
> ---
Yeah, looks ok.
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
--
Jesse Barnes, Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] acpi: Add D3 cold state
2011-05-04 14:56 [PATCH] acpi: Add D3 cold state Lin Ming
2011-05-04 15:47 ` Jesse Barnes
@ 2011-05-29 6:21 ` Len Brown
1 sibling, 0 replies; 3+ messages in thread
From: Len Brown @ 2011-05-29 6:21 UTC (permalink / raw)
To: Lin Ming; +Cc: Jesse Barnes, linux-acpi, linux-pci, Moore, Robert
applied
thanks,
Len Brown - Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-05-29 6:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-04 14:56 [PATCH] acpi: Add D3 cold state Lin Ming
2011-05-04 15:47 ` Jesse Barnes
2011-05-29 6:21 ` Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).