[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220215042011.2266897-1-kai.heng.feng@canonical.com>
Date: Tue, 15 Feb 2022 12:20:11 +0800
From: Kai-Heng Feng <kai.heng.feng@...onical.com>
To: lars@...afoo.de, Michael.Hennerich@...log.com, jic23@...nel.org
Cc: andy.shevchenko@...il.com,
Kai-Heng Feng <kai.heng.feng@...onical.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v3] iio: accel: adxl345: Add ACPI HID table
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.
Suggested-by: Andy Shevchenko <andy.shevchenko@...il.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
---
v3:
- Convert the driver from input to iio.
v2:
- Drop ACPI_PTR()
- Drop redundant empty line and comma
- Add info from vendor
drivers/iio/accel/adxl345_i2c.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c
index a431cba216e69..1d57050c775de 100644
--- a/drivers/iio/accel/adxl345_i2c.c
+++ b/drivers/iio/accel/adxl345_i2c.c
@@ -41,6 +41,7 @@ static int adxl345_i2c_probe(struct i2c_client *client,
static const struct i2c_device_id adxl345_i2c_id[] = {
{ "adxl345", ADXL345 },
{ "adxl375", ADXL375 },
+ { "ADS0345:00", ADXL345 },
{ }
};
@@ -54,10 +55,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" },
+ { }
+};
+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 = adxl345_i2c_probe,
.id_table = adxl345_i2c_id,
--
2.34.1
Powered by blists - more mailing lists