linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eva Rachel Retuya <eraretuya@gmail.com>
To: jic23@kernel.org, linux-iio@vger.kernel.org
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
	dmitry.torokhov@gmail.com, michael.hennerich@analog.com,
	daniel.baluta@gmail.com, amsfield22@gmail.com,
	florian.vaussard@heig-vd.ch, linux-kernel@vger.kernel.org,
	Eva Rachel Retuya <eraretuya@gmail.com>
Subject: [PATCH 4/4] iio: accel: adxl345: Add ACPI support
Date: Thu, 16 Feb 2017 18:02:07 +0800	[thread overview]
Message-ID: <1487239327-21406-5-git-send-email-eraretuya@gmail.com> (raw)
In-Reply-To: <1487239327-21406-1-git-send-email-eraretuya@gmail.com>

Allow probing the adxl345 on both I2C and SPI protocols using ACPI.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
---
 drivers/iio/accel/adxl345_i2c.c | 9 +++++++++
 drivers/iio/accel/adxl345_spi.c | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c
index b114eb0..13080ff 100644
--- a/drivers/iio/accel/adxl345_i2c.c
+++ b/drivers/iio/accel/adxl345_i2c.c
@@ -12,6 +12,7 @@
  * 0x53 (ALT ADDRESS pin grounded)
  */
 
+#include <linux/acpi.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/regmap.h>
@@ -54,9 +55,17 @@ static const struct i2c_device_id adxl345_i2c_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, adxl345_i2c_id);
 
+static const struct acpi_device_id adxl345_acpi_id[] = {
+	{ "ADX0345", 0 },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(acpi, adxl345_acpi_id);
+
 static struct i2c_driver adxl345_i2c_driver = {
 	.driver = {
 		.name	= "adxl345_i2c",
+		.acpi_match_table = ACPI_PTR(adxl345_acpi_id),
 	},
 	.probe		= adxl345_i2c_probe,
 	.remove		= adxl345_i2c_remove,
diff --git a/drivers/iio/accel/adxl345_spi.c b/drivers/iio/accel/adxl345_spi.c
index 5fcd1fa..3f2a1db 100644
--- a/drivers/iio/accel/adxl345_spi.c
+++ b/drivers/iio/accel/adxl345_spi.c
@@ -10,6 +10,7 @@
  * SPI driver for ADXL345
  */
 
+#include <linux/acpi.h>
 #include <linux/module.h>
 #include <linux/regmap.h>
 #include <linux/spi/spi.h>
@@ -59,9 +60,17 @@ static const struct spi_device_id adxl345_spi_id[] = {
 
 MODULE_DEVICE_TABLE(spi, adxl345_spi_id);
 
+static const struct acpi_device_id adxl345_acpi_id[] = {
+	{ "ADX0345", 0 },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(acpi, adxl345_acpi_id);
+
 static struct spi_driver adxl345_spi_driver = {
 	.driver = {
 		.name	= "adxl345_spi",
+		.acpi_match_table = ACPI_PTR(adxl345_acpi_id),
 	},
 	.probe		= adxl345_spi_probe,
 	.remove		= adxl345_spi_remove,
-- 
2.7.4


  parent reply	other threads:[~2017-02-16 10:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16 10:02 [PATCH 0/4] iio: accel: adxl345: Split driver into core and I2C then add SPI support Eva Rachel Retuya
2017-02-16 10:02 ` [PATCH 1/4] iio: accel: adxl345: Use I2C regmap instead of direct I2C access Eva Rachel Retuya
2017-02-19 13:04   ` Jonathan Cameron
2017-02-16 10:02 ` [PATCH 2/4] iio: accel: adxl345: Split driver into core and I2C Eva Rachel Retuya
2017-02-19 13:11   ` Jonathan Cameron
2017-02-20  6:41     ` Eva Rachel Retuya
2017-02-20  9:32       ` Eva Rachel Retuya
2017-02-20 11:47         ` Andy Shevchenko
2017-02-16 10:02 ` [PATCH 3/4] iio: accel: adxl345: Add SPI support Eva Rachel Retuya
2017-02-19 13:12   ` Jonathan Cameron
2017-02-20  6:46     ` Eva Rachel Retuya
2017-02-16 10:02 ` Eva Rachel Retuya [this message]
2017-02-19 10:01   ` [PATCH 4/4] iio: accel: adxl345: Add ACPI support Lars-Peter Clausen
2017-02-19 12:15     ` Eva Rachel Retuya
2017-02-20 12:07       ` Lars-Peter Clausen
2017-02-21 15:18         ` Eva Rachel Retuya

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=1487239327-21406-5-git-send-email-eraretuya@gmail.com \
    --to=eraretuya@gmail.com \
    --cc=amsfield22@gmail.com \
    --cc=daniel.baluta@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=florian.vaussard@heig-vd.ch \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=pmeerw@pmeerw.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).