Skip to content

Commit

Permalink
platform/x86: Make dual_accel_detect() KIOX010A + KIOX020A detect mor…
Browse files Browse the repository at this point in the history
…e 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: 153cca9 ("platform/x86: Add and use a dual_accel_detect() helper")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210802141000.978035-1-hdegoede@redhat.com
  • Loading branch information
Hans de Goede committed Aug 6, 2021
1 parent 153cca9 commit 085fc31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/platform/x86/dual_accel_detect.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 085fc31

Please sign in to comment.