/* SPDX-License-Identifier: GPL-2.0 */ /* * Helper code to detect 360 degree hinges (yoga) style 2-in-1 devices using 2 accelerometers * to allow the OS to determine the angle between the display and the base of the device. * * On Windows these are read by a special HingeAngleService process which calls undocumented * ACPI methods, to let the firmware know if the 2-in-1 is in tablet- or laptop-mode. * The firmware may use this to disable the kbd and touchpad to avoid spurious input in * tablet-mode as well as to report SW_TABLET_MODE info to the OS. * * Since Linux does not call these undocumented methods, the SW_TABLET_MODE info reported * by various drivers/platform/x86 drivers is incorrect. These drivers use the detection * code in this file to disable SW_TABLET_MODE reporting to avoid reporting broken info * (instead userspace can derive the status itself by directly reading the 2 accels). */ #include <linux/acpi.h> #include <linux/i2c.h> static bool dual_accel_detect_bosc0200(void) { … } static bool dual_accel_detect(void) { … }