Skip to content

Commit

Permalink
ACPICA: New: acpi_reset interface - write to reset register
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bob Moore authored and Len Brown committed Dec 31, 2008
1 parent 7db5d82 commit d3fd902
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
37 changes: 37 additions & 0 deletions drivers/acpi/hardware/hwxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,43 @@
#define _COMPONENT ACPI_HARDWARE
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
Expand Down
2 changes: 2 additions & 0 deletions include/acpi/acpixf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d3fd902

Please sign in to comment.