linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Ladislav Michl <ladis@linux-mips.org>
Cc: linux-iio@vger.kernel.org,
	Daniel Baluta <daniel.baluta@intel.com>,
	Matt Ranostay <matt.ranostay@intel.com>
Subject: Re: [PATCH 1/2] iio: adc: ti-ads1015: fix conversion time
Date: Wed, 9 Aug 2017 15:15:23 +0100	[thread overview]
Message-ID: <20170809151523.1533bba1@archlinux> (raw)
In-Reply-To: <20170801082605.kxzqtnrbt6glplmu@lenoch>

On Tue, 1 Aug 2017 10:26:05 +0200
Ladislav Michl <ladis@linux-mips.org> wrote:

> When reading diffrent channel value than device is currently processing
> wait time of conversion period is applied, which is not enough as device
> might be already in the middle of conversion and therefore previously
> converted value is returned - the one belonging to another channel.
> Fix it by waiting for two sampling periods.
> 
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Strangely we already have a fix in place for this it seems.

See the fixes-togreg branch of iio.git

Clearly a popular device at the moment!

Thanks,

Jonathan
> ---
>  drivers/iio/adc/ti-ads1015.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
> index 884b8e461b17..86fd2753869d 100644
> --- a/drivers/iio/adc/ti-ads1015.c
> +++ b/drivers/iio/adc/ti-ads1015.c
> @@ -260,7 +260,7 @@ int ads1015_get_adc_result(struct ads1015_data *data, int chan, int *val)
>  		return ret;
>  
>  	if (change) {
> -		conv_time = DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr]);
> +		conv_time = 2 * DIV_ROUND_UP(USEC_PER_SEC, data->data_rate[dr]);
>  		usleep_range(conv_time, conv_time + 1);
>  	}
>  


  parent reply	other threads:[~2017-08-09 14:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-01  8:25 [PATCH 0/2] iio: adc: ti-ads1015: fix channel crosstalk Ladislav Michl
2017-08-01  8:26 ` [PATCH 1/2] iio: adc: ti-ads1015: fix conversion time Ladislav Michl
2017-08-01  9:09   ` Daniel Baluta
2017-08-01  9:59     ` Ladislav Michl
2017-08-01 16:25       ` Daniel Baluta
2017-08-09 14:15   ` Jonathan Cameron [this message]
2017-08-09 16:27     ` Ladislav Michl
2017-08-01  8:26 ` [PATCH 2/2] iio: adc: ti-ads1015: use dynamically generated attributes Ladislav Michl
2017-08-09 14:11   ` Jonathan Cameron
2017-08-09 16:44     ` Ladislav Michl
2017-08-12 11:10       ` 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=20170809151523.1533bba1@archlinux \
    --to=jic23@kernel.org \
    --cc=daniel.baluta@intel.com \
    --cc=ladis@linux-mips.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=matt.ranostay@intel.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;
as well as URLs for NNTP newsgroup(s).