From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Jakub Szczudlo <jakubszczudlo40@gmail.com>
Cc: linux-iio@vger.kernel.org, jic23@kernel.org,
dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
marcelo.schmitt@analog.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, mike.looijmans@topic.nl,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
jorge.marques@analog.com, antoniu.miclaus@analog.com,
mazziesaccount@gmail.com, jishnu.prakash@oss.qualcomm.com,
duje@dujemihanovic.xyz, wens@kernel.org,
sakari.ailus@linux.intel.com, linusw@kernel.org
Subject: Re: [PATCH v9 1/3] iio: adc: ti-ads1100: Fix incorrect reading when datarate changed in single mode
Date: Mon, 10 Aug 2026 21:41:34 +0300 [thread overview]
Message-ID: <anobXhtKuDZHGaa_@ashevche-desk.local> (raw)
In-Reply-To: <20260804192840.29121-2-jakubszczudlo40@gmail.com>
On Tue, Aug 04, 2026 at 09:28:38PM +0200, Jakub Szczudlo wrote:
> When device is suspended and it is in single mode then changing
> datarate doesn't make it actually wait for new measurement, so to
> be sure that read after change is correct, functions that changes
> datarate and gain will wait for a new data.
A couple of minor issues (no need to resend just for these).
...
> +static int ads1100_start_single_conversion(struct ads1100_data *data)
> +{
> + u8 config = data->config | ADS1100_CFG_SC;
> + int ret;
> +
> + ret = i2c_master_send(data->client, &config, sizeof(config));
> + if (ret < 0) {
> + dev_err(&data->client->dev, "I2C write fail: %d\n", ret);
> + return ret;
> + }
> + /* Need to wait because of change from continuous to single mode */
Broken indentation.
> + ret = ads1100_wait_single_conversion(data);
> + if (ret)
> + return ret;
> +
> + config |= ADS1100_CFG_ST_BSY;
> +
> + ret = i2c_master_send(data->client, &config, sizeof(config));
> + if (ret < 0) {
> + dev_err(&data->client->dev, "I2C write fail: %d\n", ret);
> + return ret;
> + }
> +
> + /* No need to cache it, it's status bit */
> + data->config = config & ~ADS1100_CFG_ST_BSY;
> +
> + return 0;
> +}
> +
> +static int ads1100_poll_data_ready(struct ads1100_data *data)
> +{
> + int ret;
> +
> + ret = ads1100_start_single_conversion(data);
> + if (ret)
> + return ret;
> +
> + ret = ads1100_wait_single_conversion(data);
> + if (ret)
> + return ret;
> +
> + return ads1100_set_config_bits(data, ADS1100_CFG_SC,
> + ADS1100_CONTINUOUS);
It's one line (81 characters which is acceptable).
> +}
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-08-10 18:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-04 19:28 [PATCH v9 0/3] iio: adc: ti-ads1100: Add support for TI ADS1110 to ti-ads1100 driver Jakub Szczudlo
2026-08-04 19:28 ` [PATCH v9 1/3] iio: adc: ti-ads1100: Fix incorrect reading when datarate changed in single mode Jakub Szczudlo
2026-08-04 19:44 ` sashiko-bot
2026-08-10 18:41 ` Andy Shevchenko [this message]
2026-08-04 19:28 ` [PATCH v9 2/3] dt-bindings: iio: adc: ti,ads1100: add support for ADS1110 Jakub Szczudlo
2026-08-04 19:28 ` [PATCH v9 3/3] iio: adc: ti-ads1100: Add ti-ads1110 support to ti-ads1100 driver Jakub Szczudlo
2026-08-04 19:42 ` sashiko-bot
2026-08-10 18:44 ` Andy Shevchenko
2026-08-10 18:45 ` [PATCH v9 0/3] iio: adc: ti-ads1100: Add support for TI ADS1110 " Andy Shevchenko
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=anobXhtKuDZHGaa_@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=duje@dujemihanovic.xyz \
--cc=jakubszczudlo40@gmail.com \
--cc=jic23@kernel.org \
--cc=jishnu.prakash@oss.qualcomm.com \
--cc=jorge.marques@analog.com \
--cc=krzk+dt@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.schmitt@analog.com \
--cc=mazziesaccount@gmail.com \
--cc=mike.looijmans@topic.nl \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=wens@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