Skip to contentSkip to conversation

platform/x86: Make dual_accel_detect() KIOX010A + KIOX020A detect more robust

PATCH New Hans de Goede 1 participant 1 message Aug 2, 2021 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: Make dual_accel_detect() KIOX010A + KIOX020A detect more robust

360 degree hinges devices with dual KIOX010A + KIOX020A accelerometers always have both a KIOX010A and a KIOX020A ACPI device (one for each accel).

Theoretical some vendor may re-use some DSDT for a non-convertible stripping out just the KIOX020A ACPI device from the DSDT. Check that both ACPI devices are present to make the check more robust.

Fixes 153cca9caa81 ("platform/x86: Add and use a dual_accel_detect() helper")
---
 drivers/platform/x86/dual_accel_detect.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/dual_accel_detect.h +2 -1
index 1a069159da91..a9eae17cc43d 100644
@@ -60,7 +60,8 @@ static bool dual_accel_detect_bosc0200(void)
 static bool dual_accel_detect(void)
 {
 	/* Systems which use a pair of accels with KIOX010A / KIOX020A ACPI ids */
-	if (acpi_dev_present("KIOX010A", NULL, -1))
+	if (acpi_dev_present("KIOX010A", NULL, -1) &&
+	    acpi_dev_present("KIOX020A", NULL, -1))
 		return true;
 
 	/* Systems which use a single DUAL250E ACPI device to model 2 accels */
Signature · 1 line
2.31.1