]> xenbits.xensource.com Git - people/aperard/linux.git/commitdiff
iio: imu: bmi323: Add ACPI Match Table
authorJonathan LoBue <jlobue10@gmail.com>
Fri, 16 Feb 2024 18:23:08 +0000 (10:23 -0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 19 Feb 2024 19:34:44 +0000 (19:34 +0000)
Adds the ACPI match table for ASUS ROG ALLY to load the bmi323
driver with an ACPI match of "BOSC0200", and a comment about duplicate
ACPI identifiers between devices using the bmc150 and bmi323 chips.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Co-developed-by: Luke D. Jones <luke@ljones.dev>
Signed-off-by: Luke D. Jones <luke@ljones.dev>
Co-developed-by: Denis Benato <benato.denis96@gmail.com>
Signed-off-by: Denis Benato <benato.denis96@gmail.com>
Co-developed-by: Antheas Kapenekakis <lkml@antheas.dev>
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
Signed-off-by: Jonathan LoBue <jlobue10@gmail.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240216182308.27125-1-jlobue10@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/imu/bmi323/bmi323_i2c.c

index 20a8001b9956a39dddd1775543acdceb10e5a931..52140bf057658edf0b23519b8cf8bc11691a9520 100644 (file)
@@ -93,6 +93,26 @@ static int bmi323_i2c_probe(struct i2c_client *i2c)
        return bmi323_core_probe(dev);
 }
 
+static const struct acpi_device_id bmi323_acpi_match[] = {
+       /*
+        * The "BOSC0200" identifier used here is not unique to bmi323 devices.
+        * The same "BOSC0200" identifier is found in the ACPI tables of devices
+        * using the bmc150 chip. This creates a conflict with duplicate ACPI
+        * identifiers which multiple drivers want to use. If a non-bmi323
+        * device starts to load with this "BOSC0200" ACPI match here, then the
+        * chip ID check portion should fail because the chip IDs received (via
+        * i2c) are unique between bmc150 and bmi323 and the driver should
+        * relinquish the device. If and when a different driver (such as
+        * bmc150) starts to load with the "BOSC0200" ACPI match, a short reset
+        * should ensure that the device is not in a bad state during that
+        * driver initialization. This device reset does occur in both the
+        * bmi323 and bmc150 init sequences.
+        */
+       { "BOSC0200" },
+       { }
+};
+MODULE_DEVICE_TABLE(acpi, bmi323_acpi_match);
+
 static const struct i2c_device_id bmi323_i2c_ids[] = {
        { "bmi323" },
        { }
@@ -109,6 +129,7 @@ static struct i2c_driver bmi323_i2c_driver = {
        .driver = {
                .name = "bmi323",
                .of_match_table = bmi323_of_i2c_match,
+               .acpi_match_table = bmi323_acpi_match,
        },
        .probe = bmi323_i2c_probe,
        .id_table = bmi323_i2c_ids,