Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Cc: linux-iio@vger.kernel.org, lorenzo.bianconi@st.com
Subject: Re: [PATCH 1/4] iio: imu: st_lsm6dsx: convert max_fifo_size in fifo words
Date: Sun, 1 Oct 2017 11:40:44 +0100	[thread overview]
Message-ID: <20171001114044.48521531@archlinux> (raw)
In-Reply-To: <20170927192928.16160-2-lorenzo.bianconi@st.com>

On Wed, 27 Sep 2017 21:29:25 +0200
Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> wrote:

> Express max fifo depth in fifo words instead of in bytes.
> That change will be necessary to properly support more devices
> in st_lsm6dsx driver
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>

I'm not sure the term words really applies here.  Fifo entries maybe?
We are talking about a set of sample I think?

Other than terminology the patch is fine.

Jonathan

> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> index debf4064f474..e6e0363cd1c2 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
> @@ -156,21 +156,21 @@ static const struct st_lsm6dsx_fs_table_entry st_lsm6dsx_fs_table[] = {
>  static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = {
>  	{
>  		.wai = 0x69,
> -		.max_fifo_size = 8192,
> +		.max_fifo_size = 1365,
>  		.id = {
>  			[0] = ST_LSM6DS3_ID,
>  		},
>  	},
>  	{
>  		.wai = 0x69,
> -		.max_fifo_size = 4096,
> +		.max_fifo_size = 682,
>  		.id = {
>  			[0] = ST_LSM6DS3H_ID,
>  		},
>  	},
>  	{
>  		.wai = 0x6a,
> -		.max_fifo_size = 4096,
> +		.max_fifo_size = 682,
>  		.id = {
>  			[0] = ST_LSM6DSL_ID,
>  			[1] = ST_LSM6DSM_ID,
> @@ -462,10 +462,9 @@ static int st_lsm6dsx_set_watermark(struct iio_dev *iio_dev, unsigned int val)
>  {
>  	struct st_lsm6dsx_sensor *sensor = iio_priv(iio_dev);
>  	struct st_lsm6dsx_hw *hw = sensor->hw;
> -	int err, max_fifo_len;
> +	int err;
>  
> -	max_fifo_len = hw->settings->max_fifo_size / ST_LSM6DSX_SAMPLE_SIZE;
> -	if (val < 1 || val > max_fifo_len)
> +	if (val < 1 || val > hw->settings->max_fifo_size)
>  		return -EINVAL;
>  
>  	err = st_lsm6dsx_update_watermark(sensor, val);


  reply	other threads:[~2017-10-01 10:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27 19:29 [PATCH 0/4] rework st_lsm6dsx driver to support more devices Lorenzo Bianconi
2017-09-27 19:29 ` [PATCH 1/4] iio: imu: st_lsm6dsx: convert max_fifo_size in fifo words Lorenzo Bianconi
2017-10-01 10:40   ` Jonathan Cameron [this message]
2017-10-01 13:05     ` Lorenzo Bianconi
2017-09-27 19:29 ` [PATCH 2/4] iio: imu: st_lsm6dsx: split fifo mode and fifo odr configuration Lorenzo Bianconi
2017-10-01 10:42   ` Jonathan Cameron
2017-09-27 19:29 ` [PATCH 3/4] iio: imu: st_lsm6dsx: move decimator info in st_lsm6dsx_sensor_settings Lorenzo Bianconi
2017-10-01 10:44   ` Jonathan Cameron
2017-09-27 19:29 ` [PATCH 4/4] iio: imu: st_lsm6dsx: add FIFO ops data structure Lorenzo Bianconi
2017-10-01 10:48   ` Jonathan Cameron
2017-10-01 13:13     ` Lorenzo Bianconi
2017-10-02  9:46       ` 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=20171001114044.48521531@archlinux \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=lorenzo.bianconi83@gmail.com \
    --cc=lorenzo.bianconi@st.com \
    /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