diff options
Diffstat (limited to 'drivers/platform/x86/intel/vbtn.c')
| -rw-r--r-- | drivers/platform/x86/intel/vbtn.c | 14 | 
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/platform/x86/intel/vbtn.c b/drivers/platform/x86/intel/vbtn.c index 084c355c86f5..84c1353eb12b 100644 --- a/drivers/platform/x86/intel/vbtn.c +++ b/drivers/platform/x86/intel/vbtn.c @@ -136,8 +136,6 @@ static int intel_vbtn_input_setup(struct platform_device *device)  	priv->switches_dev->id.bustype = BUS_HOST;  	if (priv->has_switches) { -		detect_tablet_mode(&device->dev); -  		ret = input_register_device(priv->switches_dev);  		if (ret)  			return ret; @@ -158,7 +156,8 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)  	if ((ke = sparse_keymap_entry_from_scancode(priv->buttons_dev, event))) {  		if (!priv->has_buttons) { -			dev_warn(&device->dev, "Warning: received a button event on a device without buttons, please report this.\n"); +			dev_warn(&device->dev, "Warning: received 0x%02x button event on a device without buttons, please report this.\n", +				 event);  			return;  		}  		input_dev = priv->buttons_dev; @@ -258,9 +257,6 @@ static const struct dmi_system_id dmi_switches_allow_list[] = {  static bool intel_vbtn_has_switches(acpi_handle handle, bool dual_accel)  { -	unsigned long long vgbs; -	acpi_status status; -  	/* See dual_accel_detect.h for more info */  	if (dual_accel)  		return false; @@ -268,8 +264,7 @@ static bool intel_vbtn_has_switches(acpi_handle handle, bool dual_accel)  	if (!dmi_check_system(dmi_switches_allow_list))  		return false; -	status = acpi_evaluate_integer(handle, "VGBS", NULL, &vgbs); -	return ACPI_SUCCESS(status); +	return acpi_has_method(handle, "VGBS");  }  static int intel_vbtn_probe(struct platform_device *device) @@ -316,6 +311,9 @@ static int intel_vbtn_probe(struct platform_device *device)  		if (ACPI_FAILURE(status))  			dev_err(&device->dev, "Error VBDL failed with ACPI status %d\n", status);  	} +	// Check switches after buttons since VBDL may have side effects. +	if (has_switches) +		detect_tablet_mode(&device->dev);  	device_init_wakeup(&device->dev, true);  	/*  |