All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: linux-iio@vger.kernel.org, lorenzo.bianconi@redhat.com
Subject: Re: [PATCH 1/6] iio: imu: st_lsm6dsx: export max num of slave devices in st_lsm6dsx_shub_settings
Date: Mon, 23 Dec 2019 16:50:06 +0000	[thread overview]
Message-ID: <20191223165006.3ee0be50@archlinux> (raw)
In-Reply-To: <9c4945c59f4ac63d28de6180da2409a95c60aee5.1576341963.git.lorenzo@kernel.org>

On Sat, 14 Dec 2019 17:52:54 +0100
Lorenzo Bianconi <lorenzo@kernel.org> wrote:

> Export max number of slave devices supported by the i2c master
> controller in st_lsm6dsx_shub_settings data structure.
> This is a preliminary patch to support i2c master controller
> on lsm6dsm sensors
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Applied.

Thanks,

J
> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h      | 2 ++
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 2 ++
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 3 +--
>  3 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> index c605b153be41..fb76e0d6770d 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> @@ -176,6 +176,7 @@ struct st_lsm6dsx_hw_ts_settings {
>   * @pullup_en: i2c controller pull-up register info (addr + mask).
>   * @aux_sens: aux sensor register info (addr + mask).
>   * @wr_once: write_once register info (addr + mask).
> + * @num_ext_dev: max number of slave devices.
>   * @shub_out: sensor hub first output register info.
>   * @slv0_addr: slave0 address in secondary page.
>   * @dw_slv0_addr: slave0 write register address in secondary page.
> @@ -187,6 +188,7 @@ struct st_lsm6dsx_shub_settings {
>  	struct st_lsm6dsx_reg pullup_en;
>  	struct st_lsm6dsx_reg aux_sens;
>  	struct st_lsm6dsx_reg wr_once;
> +	u8 num_ext_dev;
>  	u8 shub_out;
>  	u8 slv0_addr;
>  	u8 dw_slv0_addr;
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> index a4ed72aef93e..bf995b58c333 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> @@ -882,6 +882,7 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
>  				.addr = 0x14,
>  				.mask = BIT(6),
>  			},
> +			.num_ext_dev = 3,
>  			.shub_out = 0x02,
>  			.slv0_addr = 0x15,
>  			.dw_slv0_addr = 0x21,
> @@ -1256,6 +1257,7 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
>  				.addr = 0x14,
>  				.mask = BIT(6),
>  			},
> +			.num_ext_dev = 3,
>  			.shub_out = 0x02,
>  			.slv0_addr = 0x15,
>  			.dw_slv0_addr = 0x21,
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> index fa5d1001a46c..5684e663d0aa 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> @@ -30,7 +30,6 @@
>  
>  #include "st_lsm6dsx.h"
>  
> -#define ST_LSM6DSX_MAX_SLV_NUM			3
>  #define ST_LSM6DSX_SLV_ADDR(n, base)		((base) + (n) * 3)
>  #define ST_LSM6DSX_SLV_SUB_ADDR(n, base)	((base) + 1 + (n) * 3)
>  #define ST_LSM6DSX_SLV_CONFIG(n, base)		((base) + 2 + (n) * 3)
> @@ -770,7 +769,7 @@ int st_lsm6dsx_shub_probe(struct st_lsm6dsx_hw *hw, const char *name)
>  		if (err < 0)
>  			return err;
>  
> -		if (++num_ext_dev >= ST_LSM6DSX_MAX_SLV_NUM)
> +		if (++num_ext_dev >= hw->settings->shub_settings.num_ext_dev)
>  			break;
>  		id++;
>  	}


  reply	other threads:[~2019-12-23 17:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 16:52 [PATCH 0/6] introduce i2c master controller support for LSM6DSM Lorenzo Bianconi
2019-12-14 16:52 ` [PATCH 1/6] iio: imu: st_lsm6dsx: export max num of slave devices in st_lsm6dsx_shub_settings Lorenzo Bianconi
2019-12-23 16:50   ` Jonathan Cameron [this message]
2019-12-14 16:52 ` [PATCH 2/6] iio: imu: st_lsm6dsx: check if master_enable is located in primary page Lorenzo Bianconi
2019-12-23 16:51   ` Jonathan Cameron
2019-12-14 16:52 ` [PATCH 3/6] iio: imu: st_lsm6dsx: check if pull_up " Lorenzo Bianconi
2019-12-23 16:51   ` Jonathan Cameron
2019-12-23 16:59   ` Jonathan Cameron
2019-12-14 16:52 ` [PATCH 4/6] iio: imu: st_lsm6dsx: check if shub_output reg " Lorenzo Bianconi
2019-12-23 17:00   ` Jonathan Cameron
2019-12-14 16:52 ` [PATCH 5/6] iio: imu: st_lsm6dsx: rename st_lsm6dsx_shub_read_reg in st_lsm6dsx_shub_read_output Lorenzo Bianconi
2019-12-23 17:01   ` Jonathan Cameron
2019-12-14 16:52 ` [PATCH 6/6] iio: imu: st_lsm6dsx: enable sensor-hub support for lsm6dsm Lorenzo Bianconi
2019-12-23 16:49   ` Jonathan Cameron
2019-12-23 17:25     ` 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=20191223165006.3ee0be50@archlinux \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@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.