[PATCH 76/94] ACPICA: New: acpi_reset interface - write to reset register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bob Moore <robert.moore@xxxxxxxxx>

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@xxxxxxxxx>
Signed-off-by: Lin Ming <ming.m.lin@xxxxxxxxx>
Signed-off-by: Len Brown <len.brown@xxxxxxxxx>
---
 drivers/acpi/hardware/hwxface.c |   37 +++++++++++++++++++++++++++++++++++++
 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 b6244a0..0601ed7 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
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 030aeb5..b3bcead 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -322,6 +322,8 @@ acpi_resource_to_address64(struct acpi_resource *resource,
 /*
  * Hardware (ACPI device) interfaces
  */
+acpi_status acpi_reset(void);
+
 acpi_status acpi_get_register(u32 register_id, u32 * return_value);
 
 acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value);
-- 
1.5.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux