diff options
author | Bob Moore <robert.moore@intel.com> | 2008-12-29 22:11:57 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-12-31 01:14:32 -0500 |
commit | d3fd902d1ed43aebfc407c08d7ce86495604124c (patch) | |
tree | ed72421413df5e76518a1945191e62981a923380 | |
parent | 7db5d82d0278b506441ab6025f0c6ce2f2aa3019 (diff) |
ACPICA: New: acpi_reset interface - write to reset register
Uses the FADT-defined reset register and reset value. Checks the
FADT flags for the reset register supported bit. Supports reset
register in memory or I/O space, but not in PCI config space
since the host has the information to do it.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | drivers/acpi/hardware/hwxface.c | 37 | ||||
-rw-r--r-- | include/acpi/acpixf.h | 2 |
2 files changed, 39 insertions, 0 deletions
diff --git a/drivers/acpi/hardware/hwxface.c b/drivers/acpi/hardware/hwxface.c index b6244a0fcf4c..0601ed711f30 100644 --- a/drivers/acpi/hardware/hwxface.c +++ b/drivers/acpi/hardware/hwxface.c | |||
@@ -50,6 +50,43 @@ ACPI_MODULE_NAME("hwxface") | |||
50 | 50 | ||
51 | /****************************************************************************** | 51 | /****************************************************************************** |
52 | * | 52 | * |
53 | * FUNCTION: acpi_reset | ||
54 | * | ||
55 | * PARAMETERS: None | ||
56 | * | ||
57 | * RETURN: Status | ||
58 | * | ||
59 | * DESCRIPTION: Set reset register in memory or IO space. Note: Does not | ||
60 | * support reset register in PCI config space, this must be | ||
61 | * handled separately. | ||
62 | * | ||
63 | ******************************************************************************/ | ||
64 | acpi_status acpi_reset(void) | ||
65 | { | ||
66 | struct acpi_generic_address *reset_reg; | ||
67 | acpi_status status; | ||
68 | |||
69 | ACPI_FUNCTION_TRACE(acpi_reset); | ||
70 | |||
71 | reset_reg = &acpi_gbl_FADT.reset_register; | ||
72 | |||
73 | /* Check if the reset register is supported */ | ||
74 | |||
75 | if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) || | ||
76 | !reset_reg->address) { | ||
77 | return_ACPI_STATUS(AE_NOT_EXIST); | ||
78 | } | ||
79 | |||
80 | /* Write the reset value to the reset register */ | ||
81 | |||
82 | status = acpi_write(acpi_gbl_FADT.reset_value, reset_reg); | ||
83 | return_ACPI_STATUS(status); | ||
84 | } | ||
85 | |||
86 | ACPI_EXPORT_SYMBOL(acpi_reset) | ||
87 | |||
88 | /****************************************************************************** | ||
89 | * | ||
53 | * FUNCTION: acpi_read | 90 | * FUNCTION: acpi_read |
54 | * | 91 | * |
55 | * PARAMETERS: Value - Where the value is returned | 92 | * PARAMETERS: Value - Where the value is returned |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 030aeb556e6b..b3bceadf6f75 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -322,6 +322,8 @@ acpi_resource_to_address64(struct acpi_resource *resource, | |||
322 | /* | 322 | /* |
323 | * Hardware (ACPI device) interfaces | 323 | * Hardware (ACPI device) interfaces |
324 | */ | 324 | */ |
325 | acpi_status acpi_reset(void); | ||
326 | |||
325 | acpi_status acpi_get_register(u32 register_id, u32 * return_value); | 327 | acpi_status acpi_get_register(u32 register_id, u32 * return_value); |
326 | 328 | ||
327 | acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value); | 329 | acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value); |