From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
lorenzo.bianconi@redhat.com, robh@kernel.org
Subject: Re: [PATCH 1/2] iio: imu: st_lsm6dsx: add support to ASM330LHHX
Date: Sun, 3 Apr 2022 13:15:04 +0200 [thread overview]
Message-ID: <YkmBuDOSrHzh3pFc@lore-desk> (raw)
In-Reply-To: <20220402172240.2465e7f5@jic23-huawei>
[-- Attachment #1: Type: text/plain, Size: 6931 bytes --]
> On Sat, 2 Apr 2022 12:09:29 +0200
> Lorenzo Bianconi <lorenzo@kernel.org> wrote:
>
> > Add support to STM ASM330LHHX (acc + gyro) Mems sensor
> > https://www.st.com/resource/en/datasheet/asm330lhhx.pdf
> Use a Datasheet tag as below.
> Perhaps mention it's an automotive rated sensor and that
> it's compatible otherwise with xxx existing part.
ack, will do
>
> Quick glance at the datasheet suggests this part has a sensor hub...
> Should it be in a the block with parameters for that as you
> currently have it in the one for no sensorhub I think.
>
> Or is it using an incompatible sensor hub interface?
asm330lhhx supports sensor hub with the same configuration of LSM6DSR or
LSM6DSO.
Regards,
Lorenzo
>
> >
> Datasheet: https://www.st.com/resource/en/datasheet/asm330lhhx.pdf
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > drivers/iio/imu/st_lsm6dsx/Kconfig | 6 +++---
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 2 ++
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 3 ++-
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 6 +++++-
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c | 5 +++++
> > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c | 5 +++++
> > 6 files changed, 22 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/iio/imu/st_lsm6dsx/Kconfig b/drivers/iio/imu/st_lsm6dsx/Kconfig
> > index 85860217aaf3..fefd0b939100 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/Kconfig
> > +++ b/drivers/iio/imu/st_lsm6dsx/Kconfig
> > @@ -11,9 +11,9 @@ config IIO_ST_LSM6DSX
> > help
> > Say yes here to build support for STMicroelectronics LSM6DSx imu
> > sensor. Supported devices: lsm6ds3, lsm6ds3h, lsm6dsl, lsm6dsm,
> > - ism330dlc, lsm6dso, lsm6dsox, asm330lhh, lsm6dsr, lsm6ds3tr-c,
> > - ism330dhcx, lsm6dsrx, lsm6ds0, lsm6dsop, the accelerometer/gyroscope
> > - of lsm9ds1 and lsm6dst.
> > + ism330dlc, lsm6dso, lsm6dsox, asm330lhh, asm330lhhx, lsm6dsr,
> > + lsm6ds3tr-c, ism330dhcx, lsm6dsrx, lsm6ds0, lsm6dsop,
> > + the accelerometer/gyroscope of lsm9ds1 and lsm6dst.
> >
> > To compile this driver as a module, choose M here: the module
> > will be called st_lsm6dsx.
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > index 6ac4eac36458..a86dd29a4738 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> > @@ -31,6 +31,7 @@
> > #define ST_LSM6DSRX_DEV_NAME "lsm6dsrx"
> > #define ST_LSM6DST_DEV_NAME "lsm6dst"
> > #define ST_LSM6DSOP_DEV_NAME "lsm6dsop"
> > +#define ST_ASM330LHHX_DEV_NAME "asm330lhhx"
> >
> > enum st_lsm6dsx_hw_id {
> > ST_LSM6DS3_ID,
> > @@ -49,6 +50,7 @@ enum st_lsm6dsx_hw_id {
> > ST_LSM6DSRX_ID,
> > ST_LSM6DST_ID,
> > ST_LSM6DSOP_ID,
> > + ST_ASM330LHHX_ID,
> > ST_LSM6DSX_MAX_ID,
> > };
> >
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> > index 16730a780964..38bb5f645ebd 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
> > @@ -14,7 +14,8 @@
> > * (e.g. Gx, Gy, Gz, Ax, Ay, Az), then data are repeated depending on the
> > * value of the decimation factor and ODR set for each FIFO data set.
> > *
> > - * LSM6DSO/LSM6DSOX/ASM330LHH/LSM6DSR/LSM6DSRX/ISM330DHCX/LSM6DST/LSM6DSOP:
> > + * LSM6DSO/LSM6DSOX/ASM330LHH/ASM330LHHX/LSM6DSR/LSM6DSRX/ISM330DHCX/
> > + * LSM6DST/LSM6DSOP:
> > * The FIFO buffer can be configured to store data from gyroscope and
> > * accelerometer. Each sample is queued with a tag (1B) indicating data
> > * source (gyroscope, accelerometer, hw timer).
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > index b1d8d5a66f01..910397716833 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> > @@ -26,7 +26,7 @@
> > * - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000
> > * - FIFO size: 4KB
> > *
> > - * - LSM6DSO/LSM6DSOX/ASM330LHH/LSM6DSR/ISM330DHCX/LSM6DST/LSM6DSOP:
> > + * - LSM6DSO/LSM6DSOX/ASM330LHH/ASM330LHHX/LSM6DSR/ISM330DHCX/LSM6DST/LSM6DSOP:
> > * - Accelerometer/Gyroscope supported ODR [Hz]: 12.5, 26, 52, 104, 208, 416,
> > * 833
> > * - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16
> > @@ -786,6 +786,10 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
> > .hw_id = ST_LSM6DST_ID,
> > .name = ST_LSM6DST_DEV_NAME,
> > .wai = 0x6d,
> > + }, {
> > + .hw_id = ST_ASM330LHHX_ID,
> > + .name = ST_ASM330LHHX_DEV_NAME,
> > + .wai = 0x6b,
>
> Probably nicer to put it next to he other 0x6b entries.
>
> > },
> > },
> > .channels = {
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> > index 8b4fc2c15622..715fbdc8190e 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
> > @@ -101,6 +101,10 @@ static const struct of_device_id st_lsm6dsx_i2c_of_match[] = {
> > .compatible = "st,lsm6dsop",
> > .data = (void *)ST_LSM6DSOP_ID,
> > },
> > + {
> > + .compatible = "st,asm330lhhx",
> > + .data = (void *)ST_ASM330LHHX_ID,
> > + },
> > {},
> > };
> > MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match);
> > @@ -122,6 +126,7 @@ static const struct i2c_device_id st_lsm6dsx_i2c_id_table[] = {
> > { ST_LSM6DSRX_DEV_NAME, ST_LSM6DSRX_ID },
> > { ST_LSM6DST_DEV_NAME, ST_LSM6DST_ID },
> > { ST_LSM6DSOP_DEV_NAME, ST_LSM6DSOP_ID },
> > + { ST_ASM330LHHX_DEV_NAME, ST_ASM330LHHX_ID },
> > {},
> > };
> > MODULE_DEVICE_TABLE(i2c, st_lsm6dsx_i2c_id_table);
> > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> > index e80110b6b280..f5767cf76c1d 100644
> > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
> > @@ -101,6 +101,10 @@ static const struct of_device_id st_lsm6dsx_spi_of_match[] = {
> > .compatible = "st,lsm6dsop",
> > .data = (void *)ST_LSM6DSOP_ID,
> > },
> > + {
> > + .compatible = "st,asm330lhhx",
> > + .data = (void *)ST_ASM330LHHX_ID,
> > + },
> > {},
> > };
> > MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match);
> > @@ -122,6 +126,7 @@ static const struct spi_device_id st_lsm6dsx_spi_id_table[] = {
> > { ST_LSM6DSRX_DEV_NAME, ST_LSM6DSRX_ID },
> > { ST_LSM6DST_DEV_NAME, ST_LSM6DST_ID },
> > { ST_LSM6DSOP_DEV_NAME, ST_LSM6DSOP_ID },
> > + { ST_ASM330LHHX_DEV_NAME, ST_ASM330LHHX_ID },
> > {},
> > };
> > MODULE_DEVICE_TABLE(spi, st_lsm6dsx_spi_id_table);
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2022-04-03 11:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-02 10:09 [PATCH 0/2] add support for ASM330LHHX Lorenzo Bianconi
2022-04-02 10:09 ` [PATCH 1/2] iio: imu: st_lsm6dsx: add support to ASM330LHHX Lorenzo Bianconi
2022-04-02 16:22 ` Jonathan Cameron
2022-04-03 11:15 ` Lorenzo Bianconi [this message]
2022-04-02 10:09 ` [PATCH 2/2] dt-bindings: iio: imu: st_lsm6dsx: add asm330lhhx device bindings Lorenzo Bianconi
2022-04-02 16:17 ` Jonathan Cameron
2022-04-03 14:56 ` Lorenzo Bianconi
2022-04-04 9:22 ` Jonathan Cameron
2022-04-04 9:33 ` Lorenzo Bianconi
2022-04-04 16:17 ` Jonathan Cameron
2022-04-04 19:18 ` Lorenzo Bianconi
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=YkmBuDOSrHzh3pFc@lore-desk \
--to=lorenzo@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=robh@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