Skip to content

Instantly share code, notes, and snippets.

@Peetz0r
Created October 25, 2017 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Peetz0r/144f80758ce72ffe578a60a0feb70912 to your computer and use it in GitHub Desktop.
Save Peetz0r/144f80758ce72ffe578a60a0feb70912 to your computer and use it in GitHub Desktop.
thinkpad_acpi.c diff
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 2242d6035d9e..34ad70bb04fe 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -192,9 +192,11 @@ enum tpacpi_hkey_event_t {
TP_HKEY_EV_LID_OPEN = 0x5002, /* laptop lid opened */
TP_HKEY_EV_TABLET_TABLET = 0x5009, /* tablet swivel up */
TP_HKEY_EV_TABLET_NOTEBOOK = 0x500a, /* tablet swivel down */
- TP_HKEY_EV_TABLET_CHANGED = 0x60c0, /* X1 Yoga (2016):
+ TP_HKEY_EV_TABLET_CHANGED_F = 0x60f0, /* X1 Yoga (2016):
* enter/leave tablet mode
*/
+ TP_HKEY_EV_TABLET_CHANGED_C = 0x60c0,
+
TP_HKEY_EV_PEN_INSERTED = 0x500b, /* tablet pen inserted */
TP_HKEY_EV_PEN_REMOVED = 0x500c, /* tablet pen removed */
TP_HKEY_EV_BRGHT_CHANGED = 0x5010, /* backlight control event */
@@ -2074,13 +2076,15 @@ static int hotkey_get_tablet_mode(int *status)
case TP_HOTKEY_TABLET_USES_MHKG:
if (!acpi_evalf(hkey_handle, &s, "MHKG", "d"))
return -EIO;
-
+
+ pr_err("TP_HOTKEY_TABLET_USES_MHKG: %d\n", s);
*status = ((s & TP_HOTKEY_TABLET_MASK) != 0);
break;
case TP_HOTKEY_TABLET_USES_CMMD:
if (!acpi_evalf(ec_handle, &s, "CMMD", "d"))
return -EIO;
+ pr_err("TP_HOTKEY_TABLET_USES_CMMD: %d\n", s);
*status = (s == TP_EC_CMMD_TABLET_MODE);
break;
default:
@@ -3967,7 +3971,15 @@ static bool hotkey_notify_6xxx(const u32 hkey,
*ignore_acpi_ev = true;
return true;
- case TP_HKEY_EV_TABLET_CHANGED:
+ case TP_HKEY_EV_TABLET_CHANGED_F:
+ pr_err("TP_HKEY_EV_TABLET_CHANGED_F");
+ tpacpi_input_send_tabletsw();
+ hotkey_tablet_mode_notify_change();
+ *send_acpi_ev = false;
+ break;
+
+ case TP_HKEY_EV_TABLET_CHANGED_C:
+ pr_err("TP_HKEY_EV_TABLET_CHANGED_C");
tpacpi_input_send_tabletsw();
hotkey_tablet_mode_notify_change();
*send_acpi_ev = false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment