summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-12-30 11:11:57 +0800
committerLen Brown <len.brown@intel.com>2008-12-31 01:14:32 -0500
commitd3fd902d1ed43aebfc407c08d7ce86495604124c (patch)
treeed72421413df5e76518a1945191e62981a923380 /drivers/acpi
parent7db5d82d0278b506441ab6025f0c6ce2f2aa3019 (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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/hardware/hwxface.c37
1 files changed, 37 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")
/******************************************************************************
*
+ * FUNCTION: acpi_reset
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Set reset register in memory or IO space. Note: Does not
+ * support reset register in PCI config space, this must be
+ * handled separately.
+ *
+ ******************************************************************************/
+acpi_status acpi_reset(void)
+{
+ struct acpi_generic_address *reset_reg;
+ acpi_status status;
+
+ ACPI_FUNCTION_TRACE(acpi_reset);
+
+ reset_reg = &acpi_gbl_FADT.reset_register;
+
+ /* Check if the reset register is supported */
+
+ if (!(acpi_gbl_FADT.flags & ACPI_FADT_RESET_REGISTER) ||
+ !reset_reg->address) {
+ return_ACPI_STATUS(AE_NOT_EXIST);
+ }
+
+ /* Write the reset value to the reset register */
+
+ status = acpi_write(acpi_gbl_FADT.reset_value, reset_reg);
+ return_ACPI_STATUS(status);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_reset)
+
+/******************************************************************************
+ *
* FUNCTION: acpi_read
*
* PARAMETERS: Value - Where the value is returned