linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Martin Kelly <martin@martingkelly.com>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>,
	Denis Ciocca <denis.ciocca@st.com>,
	Rob Herring <robh+dt@kernel.org>
Subject: Re: [PATCH v2 2/4] iio:magnetometer: st_magn: add LSM9DS1 support
Date: Sun, 28 Oct 2018 18:50:57 +0000	[thread overview]
Message-ID: <20181028185057.7bbe97ca@archlinux> (raw)
In-Reply-To: <20181026023812.29720-2-martin@martingkelly.com>

On Thu, 25 Oct 2018 19:38:10 -0700
Martin Kelly <martin@martingkelly.com> wrote:

> From: Martin Kelly <martin@martingkelly.com>
> 
> Update the sensor settings to support the LSM9DS1 sensor. Although the
> LSM9DS1 accelerometer and gyroscope are coupled together to use the same
> FIFO, the magnetometer is separate and can be cleanly supported without
> refactoring the existing driver.
> 
> Signed-off-by: Martin Kelly <martin@martingkelly.com>
Applied.

Thanks,

Jonathan

> ---
> v2:
> - Rename lsm9ds1 --> lsm9ds1-magn and lsm9ds1_magn, as this is a multi-device
>   chip.
> - Use the register layout of LIS3MDL, as the two chips match.
> - Add I2C compatibility strings.
> 
>  drivers/iio/magnetometer/st_magn.h      | 1 +
>  drivers/iio/magnetometer/st_magn_core.c | 1 +
>  drivers/iio/magnetometer/st_magn_i2c.c  | 5 +++++
>  drivers/iio/magnetometer/st_magn_spi.c  | 5 +++++
>  4 files changed, 12 insertions(+)
> 
> diff --git a/drivers/iio/magnetometer/st_magn.h b/drivers/iio/magnetometer/st_magn.h
> index 8fe51ce427bd..bc14ad4f1b26 100644
> --- a/drivers/iio/magnetometer/st_magn.h
> +++ b/drivers/iio/magnetometer/st_magn.h
> @@ -20,6 +20,7 @@
>  #define LIS3MDL_MAGN_DEV_NAME		"lis3mdl"
>  #define LSM303AGR_MAGN_DEV_NAME		"lsm303agr_magn"
>  #define LIS2MDL_MAGN_DEV_NAME		"lis2mdl"
> +#define LSM9DS1_MAGN_DEV_NAME		"lsm9ds1_magn"
> 
>  int st_magn_common_probe(struct iio_dev *indio_dev);
>  void st_magn_common_remove(struct iio_dev *indio_dev);
> diff --git a/drivers/iio/magnetometer/st_magn_core.c b/drivers/iio/magnetometer/st_magn_core.c
> index 72f6d1335a04..a186b844d664 100644
> --- a/drivers/iio/magnetometer/st_magn_core.c
> +++ b/drivers/iio/magnetometer/st_magn_core.c
> @@ -267,6 +267,7 @@ static const struct st_sensor_settings st_magn_sensors_settings[] = {
>  		.wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
>  		.sensors_supported = {
>  			[0] = LIS3MDL_MAGN_DEV_NAME,
> +			[1] = LSM9DS1_MAGN_DEV_NAME,
>  		},
>  		.ch = (struct iio_chan_spec *)st_magn_2_16bit_channels,
>  		.odr = {
> diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c
> index feaa28cf6a77..68650f5f5c19 100644
> --- a/drivers/iio/magnetometer/st_magn_i2c.c
> +++ b/drivers/iio/magnetometer/st_magn_i2c.c
> @@ -44,6 +44,10 @@ static const struct of_device_id st_magn_of_match[] = {
>  		.compatible = "st,lis2mdl",
>  		.data = LIS2MDL_MAGN_DEV_NAME,
>  	},
> +	{
> +		.compatible = "st,lsm9ds1-magn",
> +		.data = LSM9DS1_MAGN_DEV_NAME,
> +	},
>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, st_magn_of_match);
> @@ -90,6 +94,7 @@ static const struct i2c_device_id st_magn_id_table[] = {
>  	{ LIS3MDL_MAGN_DEV_NAME },
>  	{ LSM303AGR_MAGN_DEV_NAME },
>  	{ LIS2MDL_MAGN_DEV_NAME },
> +	{ LSM9DS1_MAGN_DEV_NAME },
>  	{},
>  };
>  MODULE_DEVICE_TABLE(i2c, st_magn_id_table);
> diff --git a/drivers/iio/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c
> index 15bb09267098..cb05fcd9ddfe 100644
> --- a/drivers/iio/magnetometer/st_magn_spi.c
> +++ b/drivers/iio/magnetometer/st_magn_spi.c
> @@ -39,6 +39,10 @@ static const struct of_device_id st_magn_of_match[] = {
>  		.compatible = "st,lis2mdl",
>  		.data = LIS2MDL_MAGN_DEV_NAME,
>  	},
> +	{
> +		.compatible = "st,lsm9ds1-magn",
> +		.data = LSM9DS1_MAGN_DEV_NAME,
> +	},
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, st_magn_of_match);
> @@ -81,6 +85,7 @@ static const struct spi_device_id st_magn_id_table[] = {
>  	{ LIS3MDL_MAGN_DEV_NAME },
>  	{ LSM303AGR_MAGN_DEV_NAME },
>  	{ LIS2MDL_MAGN_DEV_NAME },
> +	{ LSM9DS1_MAGN_DEV_NAME },
>  	{},
>  };
>  MODULE_DEVICE_TABLE(spi, st_magn_id_table);
> --
> 2.11.0
> 

  reply	other threads:[~2018-10-29  3:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26  2:38 [PATCH v2 1/4] iio: magnetometer: add clarifying comment Martin Kelly
2018-10-26  2:38 ` [PATCH v2 2/4] iio:magnetometer: st_magn: add LSM9DS1 support Martin Kelly
2018-10-28 18:50   ` Jonathan Cameron [this message]
2018-10-26  2:38 ` [PATCH v2 3/4] iio:magnetometer: st_magn: add BDU settings Martin Kelly
2018-10-28 18:51   ` Jonathan Cameron
2018-10-26  2:38 ` [PATCH v2 4/4] dt-bindings: iio: magn: add LSM9DS1 bindings Martin Kelly
2018-10-28 18:53   ` Jonathan Cameron
2018-10-30 21:44     ` Rob Herring
2018-11-03 10:30       ` Jonathan Cameron
2018-10-26 18:24 ` [PATCH v2 1/4] iio: magnetometer: add clarifying comment Denis CIOCCA
2018-10-28 18:45   ` Jonathan Cameron
2018-10-28 18:48 ` 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=20181028185057.7bbe97ca@archlinux \
    --to=jic23@kernel.org \
    --cc=denis.ciocca@st.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=lorenzo.bianconi83@gmail.com \
    --cc=martin@martingkelly.com \
    --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;
as well as URLs for NNTP newsgroup(s).