All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: [PATCH v2 5/8] iio: accel: adxl345: Add ACPI HID table
Date: Tue, 22 Feb 2022 11:00:06 +0200	[thread overview]
Message-ID: <20220222090009.2060-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220222090009.2060-1-andriy.shevchenko@linux.intel.com>

From: Kai-Heng Feng <kai.heng.feng@canonical.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@gmail.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.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


  parent reply	other threads:[~2022-02-22  9:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22  9:00 [PATCH v2 1/8] iio: accel: adxl345: Convert to use dev_err_probe() Andy Shevchenko
2022-02-22  9:00 ` [PATCH v2 2/8] iio: accel: adxl345: Set driver_data for OF enumeration Andy Shevchenko
2022-02-22  9:00 ` [PATCH v2 3/8] iio: accel: adxl345: Get rid of name parameter in adxl345_core_probe() Andy Shevchenko
2022-02-26 18:54   ` Jonathan Cameron
2022-02-22  9:00 ` [PATCH v2 4/8] iio: accel: adxl345: Make use of device properties Andy Shevchenko
2022-02-26 19:05   ` Jonathan Cameron
2022-02-27 11:22   ` Jonathan Cameron
2022-02-22  9:00 ` Andy Shevchenko [this message]
2022-02-22  9:00 ` [PATCH v2 6/8] iio: accel: adxl345: Extract adxl345_powerup() helper Andy Shevchenko
2022-02-22  9:00 ` [PATCH v2 7/8] iio: accel: adxl345: Drop comma in terminator entries Andy Shevchenko
2022-02-22  9:00 ` [PATCH v2 8/8] iio: accel: adxl345: Remove unneeded blank lines Andy Shevchenko
2022-02-23  3:10 ` [PATCH v2 1/8] iio: accel: adxl345: Convert to use dev_err_probe() Kai-Heng Feng
2022-02-26 19:12   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220222090009.2060-5-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=jic23@kernel.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.