From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754085Ab0L1PeE (ORCPT ); Tue, 28 Dec 2010 10:34:04 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:60273 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377Ab0L1Pc0 (ORCPT ); Tue, 28 Dec 2010 10:32:26 -0500 From: "Rafael J. Wysocki" To: Len Brown Subject: [PATCH 4/4] ACPI / PM: Report wakeup events from buttons Date: Tue, 28 Dec 2010 16:31:26 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.37-rc7+; KDE/4.4.4; x86_64; ; ) Cc: ACPI Devel Maling List , LKML , "Linux-pm mailing list" References: <201012281625.36191.rjw@sisk.pl> In-Reply-To: <201012281625.36191.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201012281631.26958.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Since ACPI buttons and lids can be configured to wake up the system from sleep states, report wakeup events from these devices. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/button.c | 5 +++++ 1 file changed, 5 insertions(+) Index: linux-2.6/drivers/acpi/button.c =================================================================== --- linux-2.6.orig/drivers/acpi/button.c +++ linux-2.6/drivers/acpi/button.c @@ -279,6 +279,9 @@ static int acpi_lid_send_state(struct ac input_report_switch(button->input, SW_LID, !state); input_sync(button->input); + if (state) + pm_wakeup_event(&device->dev, 0); + ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, device); if (ret == NOTIFY_DONE) ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, @@ -314,6 +317,8 @@ static void acpi_button_notify(struct ac input_sync(input); input_report_key(input, keycode, 0); input_sync(input); + + pm_wakeup_event(&device->dev, 0); } acpi_bus_generate_proc_event(device, event, ++button->pushed);