diff options
Diffstat (limited to 'drivers/platform/x86/intel-vbtn.c')
| -rw-r--r-- | drivers/platform/x86/intel-vbtn.c | 15 | 
1 files changed, 10 insertions, 5 deletions
| diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c index 8a8017f9ca91..888a764efad1 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c @@ -48,16 +48,21 @@ static const struct key_entry intel_vbtn_keymap[] = {  };  static const struct key_entry intel_vbtn_switchmap[] = { -	{ KE_SW,     0xCA, { .sw = { SW_DOCK, 1 } } },		/* Docked */ -	{ KE_SW,     0xCB, { .sw = { SW_DOCK, 0 } } },		/* Undocked */ +	/* +	 * SW_DOCK should only be reported for docking stations, but DSDTs using the +	 * intel-vbtn code, always seem to use this for 2-in-1s / convertibles and set +	 * SW_DOCK=1 when in laptop-mode (in tandem with setting SW_TABLET_MODE=0). +	 * This causes userspace to think the laptop is docked to a port-replicator +	 * and to disable suspend-on-lid-close, which is undesirable. +	 * Map the dock events to KEY_IGNORE to avoid this broken SW_DOCK reporting. +	 */ +	{ KE_IGNORE, 0xCA, { .sw = { SW_DOCK, 1 } } },		/* Docked */ +	{ KE_IGNORE, 0xCB, { .sw = { SW_DOCK, 0 } } },		/* Undocked */  	{ KE_SW,     0xCC, { .sw = { SW_TABLET_MODE, 1 } } },	/* Tablet */  	{ KE_SW,     0xCD, { .sw = { SW_TABLET_MODE, 0 } } },	/* Laptop */  	{ KE_END }  }; -#define KEYMAP_LEN \ -	(ARRAY_SIZE(intel_vbtn_keymap) + ARRAY_SIZE(intel_vbtn_switchmap) + 1) -  struct intel_vbtn_priv {  	struct input_dev *buttons_dev;  	struct input_dev *switches_dev; | 
