Skip to content

Commit

Permalink
platform/x86: thinkpad_acpi: Simplify known_ev handling
Browse files Browse the repository at this point in the history
Modify how known_ev event is handled in preparation for adding new hkey
event range.

Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://lore.kernel.org/r/20240417173124.9953-1-mpearson-lenovo@squebb.ca
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240424122834.19801-22-hdegoede@redhat.com
  • Loading branch information
mrhpearson authored and jwrdegoede committed Apr 29, 2024
1 parent 7545dc7 commit 5a3fc7a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3845,6 +3845,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
}

send_acpi_ev = true;
known_ev = false;

switch (hkey >> 12) {
case 1:
Expand All @@ -3868,8 +3869,6 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
/* FIXME: kick libata if SATA link offline */
known_ev = true;
break;
default:
known_ev = false;
}
break;
case 4:
Expand All @@ -3892,11 +3891,8 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
tpacpi_send_radiosw_update();
send_acpi_ev = 0;
known_ev = true;
break;
}
fallthrough; /* to default */
default:
known_ev = false;
break;
}
if (!known_ev) {
pr_notice("unhandled HKEY event 0x%04x\n", hkey);
Expand Down

0 comments on commit 5a3fc7a

Please sign in to comment.