Linux IIO development
 help / color / mirror / Atom feed
From: Marius Hoch <mail@mariushoch.de>
To: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Denis Ciocca <denis.ciocca@st.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Hans de Goede <hdegoede@redhat.com>, Marius Hoch <mail@mariushoch.de>
Subject: [PATCH v3 3/6] iio: st_sensors: Add lsm303d support to the LSM9DS0 IMU driver
Date: Sun, 16 Apr 2023 01:11:27 +0200	[thread overview]
Message-ID: <20230415231130.115094-4-mail@mariushoch.de> (raw)
In-Reply-To: <20230415231130.115094-1-mail@mariushoch.de>

The lsm303d is basically the lsm9ds0 without the gyroscope
(which the LSM9DS0 IMU driver doesn't handle), as far as I
can tell.

Signed-off-by: Marius Hoch <mail@mariushoch.de>
---
 drivers/iio/imu/st_lsm9ds0/Kconfig          | 3 ++-
 drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 5 +++++
 drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 5 +++++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/imu/st_lsm9ds0/Kconfig b/drivers/iio/imu/st_lsm9ds0/Kconfig
index d29558edee60..7aef714b6ecb 100644
--- a/drivers/iio/imu/st_lsm9ds0/Kconfig
+++ b/drivers/iio/imu/st_lsm9ds0/Kconfig
@@ -10,7 +10,8 @@ config IIO_ST_LSM9DS0
 
 	help
 	  Say yes here to build support for STMicroelectronics LSM9DS0 IMU
-	  sensor. Supported devices: accelerometer/magnetometer of lsm9ds0.
+	  sensor. Supported devices: accelerometer/magnetometer of lsm9ds0
+	  and lsm303d.
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called st_lsm9ds0.
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
index a90138d8b06a..64fa77d302e2 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
@@ -22,12 +22,17 @@ static const struct of_device_id st_lsm9ds0_of_match[] = {
 		.compatible = "st,lsm9ds0-imu",
 		.data = LSM9DS0_IMU_DEV_NAME,
 	},
+	{
+		.compatible = "st,lsm303d-imu",
+		.data = LSM303D_IMU_DEV_NAME,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, st_lsm9ds0_of_match);
 
 static const struct i2c_device_id st_lsm9ds0_id_table[] = {
 	{ LSM9DS0_IMU_DEV_NAME },
+	{ LSM303D_IMU_DEV_NAME },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, st_lsm9ds0_id_table);
diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
index b743bf3546a7..997b5ff792be 100644
--- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
+++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
@@ -22,12 +22,17 @@ static const struct of_device_id st_lsm9ds0_of_match[] = {
 		.compatible = "st,lsm9ds0-imu",
 		.data = LSM9DS0_IMU_DEV_NAME,
 	},
+	{
+		.compatible = "st,lsm303d-imu",
+		.data = LSM303D_IMU_DEV_NAME,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, st_lsm9ds0_of_match);
 
 static const struct spi_device_id st_lsm9ds0_id_table[] = {
 	{ LSM9DS0_IMU_DEV_NAME },
+	{ LSM303D_IMU_DEV_NAME },
 	{}
 };
 MODULE_DEVICE_TABLE(spi, st_lsm9ds0_id_table);
-- 
2.39.2


  parent reply	other threads:[~2023-04-15 23:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-15 23:11 [PATCH v3 0/6] iio: st_sensors: Add lsm303d support Marius Hoch
2023-04-15 23:11 ` [PATCH v3 1/6] iio: accel: st_accel: Add LSM303D Marius Hoch
2023-04-21  8:41   ` Linus Walleij
2023-04-15 23:11 ` [PATCH v3 2/6] iio: magnetometer: " Marius Hoch
2023-04-21  8:41   ` Linus Walleij
2023-04-15 23:11 ` Marius Hoch [this message]
2023-04-21  8:42   ` [PATCH v3 3/6] iio: st_sensors: Add lsm303d support to the LSM9DS0 IMU driver Linus Walleij
2023-04-15 23:11 ` [PATCH v3 4/6] iio: st_sensors: Add ACPI support for lsm303d " Marius Hoch
2023-04-21  8:43   ` Linus Walleij
2023-05-02 14:51   ` Marius Hoch
2023-05-07 13:50     ` Jonathan Cameron
2023-04-15 23:11 ` [PATCH v3 5/6] iio: Comment that the LSM303D also has the Magnetometer DRDY Marius Hoch
2023-04-21  8:43   ` Linus Walleij
2023-04-15 23:11 ` [PATCH v3 6/6] dt-bindings: iio: st-sensors: Add LSM303D accelerometer+magnetometer Marius Hoch
2023-04-16  7:29   ` Krzysztof Kozlowski
2023-04-16 12:23     ` Jonathan Cameron
2023-04-16 20:19 ` [PATCH v3 0/6] iio: st_sensors: Add lsm303d support Hans de Goede
2023-04-20 17:21   ` Marius Hoch
2023-04-21  7:55   ` Hans de Goede

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=20230415231130.115094-4-mail@mariushoch.de \
    --to=mail@mariushoch.de \
    --cc=denis.ciocca@st.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hdegoede@redhat.com \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox