From patchwork Fri Jun 19 20:57:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 31453 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5JKvp8Y032148 for ; Fri, 19 Jun 2009 20:57:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbZFSU5u (ORCPT ); Fri, 19 Jun 2009 16:57:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752576AbZFSU5u (ORCPT ); Fri, 19 Jun 2009 16:57:50 -0400 Received: from g1t0028.austin.hp.com ([15.216.28.35]:7583 "EHLO g1t0028.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752130AbZFSU5u (ORCPT ); Fri, 19 Jun 2009 16:57:50 -0400 Received: from smtp2.fc.hp.com (smtp.fc.hp.com [15.11.136.114]) by g1t0028.austin.hp.com (Postfix) with ESMTP id 0FF8B1C042; Fri, 19 Jun 2009 20:57:53 +0000 (UTC) Received: from localhost.localdomain (lart.fc.hp.com [15.11.146.31]) by smtp2.fc.hp.com (Postfix) with ESMTP id BCD7C2CD14C; Fri, 19 Jun 2009 20:28:04 +0000 (UTC) Received: from bob.kio (localhost [127.0.0.1]) by localhost.localdomain (Postfix) with ESMTP id B5DAB2616C; Fri, 19 Jun 2009 14:57:52 -0600 (MDT) Subject: [PATCH 1/3] ACPICA: Use fixed event wrappers to enable/disable/clear To: Bob Moore , Len Brown From: Bjorn Helgaas Cc: Zhao Yakui , linux-acpi@vger.kernel.org Date: Fri, 19 Jun 2009 14:57:52 -0600 Message-ID: <20090619205752.30130.25320.stgit@bob.kio> In-Reply-To: <20090619205713.30130.79530.stgit@bob.kio> References: <20090619205713.30130.79530.stgit@bob.kio> User-Agent: StGit/0.14.3.385.gd87a.dirty MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Use acpi_enable_event(), acpi_disable_event(), and acpi_clear_event() instead of writing the register directly. This patch may be used under either the GPL v2 or the BSD-style license used for the Intel ACPICA. Signed-off-by: Bjorn Helgaas CC: Zhao Yakui --- drivers/acpi/acpica/evevent.c | 13 +++---------- drivers/acpi/acpica/hwsleep.c | 11 ++--------- 2 files changed, 5 insertions(+), 19 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c index cd55c77..5df6af7 100644 --- a/drivers/acpi/acpica/evevent.c +++ b/drivers/acpi/acpica/evevent.c @@ -203,10 +203,7 @@ static acpi_status acpi_ev_fixed_event_initialize(void) /* Disable the fixed event */ if (acpi_gbl_fixed_event_info[i].enable_register_id != 0xFF) { - status = - acpi_write_bit_register(acpi_gbl_fixed_event_info - [i].enable_register_id, - ACPI_DISABLE_EVENT); + status = acpi_disable_event(i, 0); if (ACPI_FAILURE(status)) { return (status); } @@ -288,18 +285,14 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event) ACPI_FUNCTION_ENTRY(); /* Clear the status bit */ - - (void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event]. - status_register_id, ACPI_CLEAR_STATUS); + acpi_clear_event(event); /* * Make sure we've got a handler. If not, report an error. The event is * disabled to prevent further interrupts. */ if (NULL == acpi_gbl_fixed_event_handlers[event].handler) { - (void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event]. - enable_register_id, - ACPI_DISABLE_EVENT); + acpi_disable_event(event, 0); ACPI_ERROR((AE_INFO, "No installed handler for fixed event [%08X]", diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c index db307a3..ea51ee6 100644 --- a/drivers/acpi/acpica/hwsleep.c +++ b/drivers/acpi/acpica/hwsleep.c @@ -610,15 +610,8 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state) /* Enable power button */ - (void) - acpi_write_bit_register(acpi_gbl_fixed_event_info - [ACPI_EVENT_POWER_BUTTON]. - enable_register_id, ACPI_ENABLE_EVENT); - - (void) - acpi_write_bit_register(acpi_gbl_fixed_event_info - [ACPI_EVENT_POWER_BUTTON]. - status_register_id, ACPI_CLEAR_STATUS); + acpi_enable_event(ACPI_EVENT_POWER_BUTTON, 0); + acpi_clear_event(ACPI_EVENT_POWER_BUTTON); arg.integer.value = ACPI_SST_WORKING; status = acpi_evaluate_object(NULL, METHOD_NAME__SST, &arg_list, NULL);