Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Nuno Sá" <nuno.sa@analog.com>
Cc: <linux-iio@vger.kernel.org>, Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Julia Pineda <julia.pineda@analog.com>
Subject: Re: [PATCH] iio: adis16480: fix buffering for devices with no burst mode
Date: Sun, 16 Jan 2022 11:22:54 +0000	[thread overview]
Message-ID: <20220116112254.784b9b6f@jic23-huawei> (raw)
In-Reply-To: <20220114132608.241-1-nuno.sa@analog.com>

On Fri, 14 Jan 2022 14:26:08 +0100
Nuno Sá <nuno.sa@analog.com> wrote:

> The trigger handler defined in the driver assumes that burst mode is
> being used. Hence, for devices that do not support it, we have to use
> the adis library default trigger implementation.
> 
> Tested-by: Julia Pineda <julia.pineda@analog.com>
> Fixes: 941f130881fa9 ("iio: adis16480: support burst read function")
> Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.

Note I'll probably rebase that branch after rc1 before sending a pull
request.

Thanks,

Jonathan

> ---
>  drivers/iio/imu/adis16480.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c
> index ed129321a14d..f9b4540db1f4 100644
> --- a/drivers/iio/imu/adis16480.c
> +++ b/drivers/iio/imu/adis16480.c
> @@ -1403,6 +1403,7 @@ static int adis16480_probe(struct spi_device *spi)
>  {
>  	const struct spi_device_id *id = spi_get_device_id(spi);
>  	const struct adis_data *adis16480_data;
> +	irq_handler_t trigger_handler = NULL;
>  	struct iio_dev *indio_dev;
>  	struct adis16480 *st;
>  	int ret;
> @@ -1474,8 +1475,12 @@ static int adis16480_probe(struct spi_device *spi)
>  		st->clk_freq = st->chip_info->int_clk;
>  	}
>  
> +	/* Only use our trigger handler if burst mode is supported */
> +	if (adis16480_data->burst_len)
> +		trigger_handler = adis16480_trigger_handler;
> +
>  	ret = devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev,
> -						 adis16480_trigger_handler);
> +						 trigger_handler);
>  	if (ret)
>  		return ret;
>  


      reply	other threads:[~2022-01-16 11:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 13:26 [PATCH] iio: adis16480: fix buffering for devices with no burst mode Nuno Sá
2022-01-16 11:22 ` Jonathan Cameron [this message]

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=20220116112254.784b9b6f@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=julia.pineda@analog.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=nuno.sa@analog.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