// SPDX-License-Identifier: GPL-2.0-only /* * power/home/volume button support for * Microsoft Surface Pro 3/4 tablet. * * Copyright (c) 2015 Intel Corporation. * All rights reserved.
*/
/* * Power button, Home button, Volume buttons support is supposed to * be covered by drivers/input/misc/soc_button_array.c, which is implemented * according to "Windows ACPI Design Guide for SoC Platforms". * However surface pro3 seems not to obey the specs, instead it uses * device VGBI(MSHW0028) for dispatching the events. * We choose acpi_driver rather than platform_driver/i2c_driver because * although VGBI has an i2c resource connected to i2c controller, it * is not embedded in any i2c controller's scope, thus neither platform_device * will be created, nor i2c_client will be enumerated, we have to use * acpi_driver.
*/ staticconststruct acpi_device_id surface_button_device_ids[] = {
{SURFACE_PRO3_BUTTON_HID, 0},
{SURFACE_PRO4_BUTTON_HID, 0},
{"", 0},
};
MODULE_DEVICE_TABLE(acpi, surface_button_device_ids);
/* * Surface Pro 4 and Surface Book 2 / Surface Pro 2017 use the same device * ID (MSHW0040) for the power/volume buttons. Make sure this is the right * device by checking for the _DSM method and OEM Platform Revision. * * Returns true if the driver should bind to this device, i.e. the device is * either MSWH0028 (Pro 3) or MSHW0040 on a Pro 4 or Book 1.
*/ staticbool surface_button_check_MSHW0040(struct acpi_device *dev)
{
acpi_handle handle = dev->handle; union acpi_object *result;
u64 oem_platform_rev = 0; // valid revisions are nonzero
// get OEM platform revision
result = acpi_evaluate_dsm_typed(handle, &MSHW0040_DSM_UUID,
MSHW0040_DSM_REVISION,
MSHW0040_DSM_GET_OMPR,
NULL, ACPI_TYPE_INTEGER);
/* * If evaluating the _DSM fails, the method is not present. This means * that we have either MSHW0028 or MSHW0040 on Pro 4 or Book 1, so we * should use this driver. We use revision 0 indicating it is * unavailable.
*/
if (result) {
oem_platform_rev = result->integer.value;
ACPI_FREE(result);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.