From b53df54f502d3445792876c58a0170c5db4c967c Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Wed, 2 Mar 2005 01:45:02 +0000 Subject: [PATCH] Made the status register clear code work. Apparently you need to write 1 to the register to set it to zero. It doesn't make any sense to me either. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11527 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../drivers/power/acpi_button/acpi_button.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/add-ons/kernel/drivers/power/acpi_button/acpi_button.c b/src/add-ons/kernel/drivers/power/acpi_button/acpi_button.c index 17414e90ea..95f6585031 100644 --- a/src/add-ons/kernel/drivers/power/acpi_button/acpi_button.c +++ b/src/add-ons/kernel/drivers/power/acpi_button/acpi_button.c @@ -61,19 +61,10 @@ acpi_button_read (void* cookie, off_t position, void *buf, size_t* num_bytes) *((uint8 *)(buf)) = acpi->read_acpi_reg((uint32)(cookie)); - /* acpi->write_acpi_reg((uint32)(cookie),0); */ + acpi->write_acpi_reg((uint32)(cookie),1); - /* The above simple clearing of the status register doesn't seem to work. - So we toggle the ENABLE bit instead. Hopefully this doesn't interfere - with the debounce logic and result in two events */ - - if ((uint32)(cookie) == ACPI_BITREG_POWER_BUTTON_STATUS) { - acpi->write_acpi_reg(ACPI_BITREG_POWER_BUTTON_ENABLE,1); - acpi->write_acpi_reg(ACPI_BITREG_POWER_BUTTON_ENABLE,0); - } else if ((uint32)(cookie) == ACPI_BITREG_SLEEP_BUTTON_STATUS) { - acpi->write_acpi_reg(ACPI_BITREG_SLEEP_BUTTON_ENABLE,1); - acpi->write_acpi_reg(ACPI_BITREG_SLEEP_BUTTON_ENABLE,0); - } + /* You need to write 1 to the status register to clear it to 0. + No, I don't understand Intel either. */ *num_bytes = 1; return B_OK;