[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220222090009.2060-5-andriy.shevchenko@linux.intel.com>
Date: Tue, 22 Feb 2022 11:00:06 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Jonathan Cameron <jic23@...nel.org>,
Kai-Heng Feng <kai.heng.feng@...onical.com>,
Andy Shevchenko <andy.shevchenko@...il.com>
Subject: [PATCH v2 5/8] iio: accel: adxl345: Add ACPI HID table
From: Kai-Heng Feng <kai.heng.feng@...onical.com>
x86 boards may use ACPI HID "ADS0345" for adxl345 device.
Analog replied:
"ADS034X is not a valid PNP ID. ADS0345 would be.
I'm not aware that this ID is already taken.
Feel free to submit a mainline Linux input mailing list patch."
So add an ACPI match table for that accordingly.
Since ACPI device may not match to any I2C ID, use the name and type
directly from ACPI ID table in absence of I2C ID.
Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
v2: no changes
drivers/iio/accel/adxl345_i2c.c | 7 +++++++
drivers/iio/accel/adxl345_spi.c | 7 +++++++
2 files changed, 14 insertions(+)
diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c
index 861d8477d799..11ecff0e0405 100644
--- a/drivers/iio/accel/adxl345_i2c.c
+++ b/drivers/iio/accel/adxl345_i2c.c
@@ -47,10 +47,17 @@ static const struct of_device_id adxl345_of_match[] = {
MODULE_DEVICE_TABLE(of, adxl345_of_match);
+static const struct acpi_device_id adxl345_acpi_match[] = {
+ { "ADS0345", ADXL345 },
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, adxl345_acpi_match);
+
static struct i2c_driver adxl345_i2c_driver = {
.driver = {
.name = "adxl345_i2c",
.of_match_table = adxl345_of_match,
+ .acpi_match_table = adxl345_acpi_match,
},
.probe_new = adxl345_i2c_probe,
.id_table = adxl345_i2c_id,
diff --git a/drivers/iio/accel/adxl345_spi.c b/drivers/iio/accel/adxl345_spi.c
index ee4c50c8a95b..850ac616d65e 100644
--- a/drivers/iio/accel/adxl345_spi.c
+++ b/drivers/iio/accel/adxl345_spi.c
@@ -52,10 +52,17 @@ static const struct of_device_id adxl345_of_match[] = {
MODULE_DEVICE_TABLE(of, adxl345_of_match);
+static const struct acpi_device_id adxl345_acpi_match[] = {
+ { "ADS0345", ADXL345 },
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, adxl345_acpi_match);
+
static struct spi_driver adxl345_spi_driver = {
.driver = {
.name = "adxl345_spi",
.of_match_table = adxl345_of_match,
+ .acpi_match_table = adxl345_acpi_match,
},
.probe = adxl345_spi_probe,
.id_table = adxl345_spi_id,
--
2.34.1
Powered by blists - more mailing lists