diff options
Diffstat (limited to 'drivers/platform/x86/intel-hid.c')
| -rw-r--r-- | drivers/platform/x86/intel-hid.c | 23 | 
1 files changed, 16 insertions, 7 deletions
| diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c index 2f5b8d09143e..078648a9201b 100644 --- a/drivers/platform/x86/intel-hid.c +++ b/drivers/platform/x86/intel-hid.c @@ -90,6 +90,13 @@ static const struct dmi_system_id button_array_table[] = {  			DMI_MATCH(DMI_PRODUCT_NAME, "HP Spectre x2 Detachable"),  		},  	}, +	{ +		.ident = "Lenovo ThinkPad X1 Tablet Gen 2", +		.matches = { +			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +			DMI_MATCH(DMI_PRODUCT_FAMILY, "ThinkPad X1 Tablet Gen 2"), +		}, +	},  	{ }  }; @@ -476,11 +483,16 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)  			goto wakeup;  		/* -		 * Switch events will wake the device and report the new switch -		 * position to the input subsystem. +		 * Some devices send (duplicate) tablet-mode events when moved +		 * around even though the mode has not changed; and they do this +		 * even when suspended. +		 * Update the switch state in case it changed and then return +		 * without waking up to avoid spurious wakeups.  		 */ -		if (priv->switches && (event == 0xcc || event == 0xcd)) -			goto wakeup; +		if (event == 0xcc || event == 0xcd) { +			report_tablet_mode_event(priv->switches, event); +			return; +		}  		/* Wake up on 5-button array events only. */  		if (event == 0xc0 || !priv->array) @@ -494,9 +506,6 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)  wakeup:  		pm_wakeup_hard_event(&device->dev); -		if (report_tablet_mode_event(priv->switches, event)) -			return; -  		return;  	} | 
