Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1651629
| From | Lv Zheng <lv.zheng@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC PATCH v3 1/5] ACPI: button: Add indication of BIOS notification and faked events |
| Date | 2017-05-27 03:30 +0200 |
| Message-ID | <tLyIj-4Vw-47@gated-at.bofh.it> (permalink) |
| References | <tLyIj-4Vw-49@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
This patch adds a parameter to acpi_lid_notify_state() so that it can act
differently against BIOS notification and kernel faked events.
Cc: <systemd-devel@lists.freedesktop.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
---
drivers/acpi/button.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 6d5a8c1..874ba60 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -138,7 +138,8 @@ static int acpi_lid_evaluate_state(struct acpi_device *device)
return lid_state ? 1 : 0;
}
-static int acpi_lid_notify_state(struct acpi_device *device, int state)
+static int acpi_lid_notify_state(struct acpi_device *device,
+ int state, bool bios_notify)
{
struct acpi_button *button = acpi_driver_data(device);
int ret;
@@ -360,7 +361,8 @@ int acpi_lid_open(void)
}
EXPORT_SYMBOL(acpi_lid_open);
-static int acpi_lid_update_state(struct acpi_device *device)
+static int acpi_lid_update_state(struct acpi_device *device,
+ bool bios_notify)
{
int state;
@@ -368,17 +370,17 @@ static int acpi_lid_update_state(struct acpi_device *device)
if (state < 0)
return state;
- return acpi_lid_notify_state(device, state);
+ return acpi_lid_notify_state(device, state, bios_notify);
}
static void acpi_lid_initialize_state(struct acpi_device *device)
{
switch (lid_init_state) {
case ACPI_BUTTON_LID_INIT_OPEN:
- (void)acpi_lid_notify_state(device, 1);
+ (void)acpi_lid_notify_state(device, 1, false);
break;
case ACPI_BUTTON_LID_INIT_METHOD:
- (void)acpi_lid_update_state(device);
+ (void)acpi_lid_update_state(device, false);
break;
case ACPI_BUTTON_LID_INIT_IGNORE:
default:
@@ -398,7 +400,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event)
case ACPI_BUTTON_NOTIFY_STATUS:
input = button->input;
if (button->type == ACPI_BUTTON_TYPE_LID) {
- acpi_lid_update_state(device);
+ acpi_lid_update_state(device, true);
} else {
int keycode;
--
2.7.4
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[RFC PATCH v3 1/5] ACPI: button: Add indication of BIOS notification and faked events Lv Zheng <lv.zheng@intel.com> - 2017-05-27 03:30 +0200
Re: [RFC PATCH v3 1/5] ACPI: button: Add indication of BIOS notification and faked events Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2017-05-29 18:10 +0200
RE: [RFC PATCH v3 1/5] ACPI: button: Add indication of BIOS notification and faked events "Zheng, Lv" <lv.zheng@intel.com> - 2017-05-31 11:00 +0200
csiph-web