summarylogtreecommitdiffstats
path: root/0003-iio-imu_Add_ROG_ALLY_bmi323-support.patch
diff options
context:
space:
mode:
Diffstat (limited to '0003-iio-imu_Add_ROG_ALLY_bmi323-support.patch')
-rw-r--r--0003-iio-imu_Add_ROG_ALLY_bmi323-support.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/0003-iio-imu_Add_ROG_ALLY_bmi323-support.patch b/0003-iio-imu_Add_ROG_ALLY_bmi323-support.patch
new file mode 100644
index 000000000000..4111417f6ac9
--- /dev/null
+++ b/0003-iio-imu_Add_ROG_ALLY_bmi323-support.patch
@@ -0,0 +1,54 @@
+diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c
+index 1105918..d665a6e 100644
+--- a/drivers/iio/accel/bmc150-accel-core.c
++++ b/drivers/iio/accel/bmc150-accel-core.c
+@@ -10,6 +10,7 @@
+ #include <linux/delay.h>
+ #include <linux/slab.h>
+ #include <linux/acpi.h>
++#include <linux/dmi.h>
+ #include <linux/of_irq.h>
+ #include <linux/pm.h>
+ #include <linux/pm_runtime.h>
+@@ -1670,6 +1671,8 @@ int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq,
+ struct iio_dev *indio_dev;
+ int ret;
+
++ if (dmi_match(DMI_BOARD_NAME, "RC71L") || (dmi_match(DMI_BOARD_NAME, "AB05-AMD") && dmi_match(DMI_PRODUCT_NAME, "AIR Plus")))
++ return -ENODEV; // Abort loading bmc150 for ASUS ROG ALLY, Ayaneo Air Plus
+ indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
+ if (!indio_dev)
+ return -ENOMEM;
+diff --git a/drivers/iio/imu/bmi323/bmi323_i2c.c b/drivers/iio/imu/bmi323/bmi323_i2c.c
+index 20a8001..346ba2d 100644
+--- a/drivers/iio/imu/bmi323/bmi323_i2c.c
++++ b/drivers/iio/imu/bmi323/bmi323_i2c.c
+@@ -5,6 +5,7 @@
+ * Copyright (C) 2023, Jagath Jog J <jagathjog1996@gmail.com>
+ */
+
++#include <linux/acpi.h>
+ #include <linux/i2c.h>
+ #include <linux/mod_devicetable.h>
+ #include <linux/module.h>
+@@ -93,6 +94,12 @@ static int bmi323_i2c_probe(struct i2c_client *i2c)
+ return bmi323_core_probe(dev);
+ }
+
++static const struct acpi_device_id bmi323_acpi_match[] = {
++ {"BOSC0200"},
++ { },
++};
++MODULE_DEVICE_TABLE(acpi, bmi323_acpi_match);
++
+ static const struct i2c_device_id bmi323_i2c_ids[] = {
+ { "bmi323" },
+ { }
+@@ -109,6 +116,7 @@ static struct i2c_driver bmi323_i2c_driver = {
+ .driver = {
+ .name = "bmi323",
+ .of_match_table = bmi323_of_i2c_match,
++ .acpi_match_table = ACPI_PTR(bmi323_acpi_match),
+ },
+ .probe = bmi323_i2c_probe,
+ .id_table = bmi323_i2c_ids,