From: "Jakub Szczudło" <jakubszczudlo40@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: linux-iio@vger.kernel.org, andy@kernel.org,
antoniu.miclaus@analog.com, conor+dt@kernel.org,
devicetree@vger.kernel.org, dlechner@baylibre.com,
duje@dujemihanovic.xyz, jic23@kernel.org,
jishnu.prakash@oss.qualcomm.com, jorge.marques@analog.com,
joshua.crofts1@gmail.com, krzk+dt@kernel.org, linusw@kernel.org,
linux-kernel@vger.kernel.org, marcelo.schmitt@analog.com,
mazziesaccount@gmail.com, mike.looijmans@topic.nl,
nuno.sa@analog.com, robh@kernel.org,
sakari.ailus@linux.intel.com, wens@kernel.org
Subject: Re: [PATCH v4 3/3] iio: adc: Add ti-ads1110 support to ti-ads1100 driver
Date: Tue, 23 Jun 2026 20:49:57 +0200 [thread overview]
Message-ID: <CA+gq5JitNkTpNbeKUd7bSnCx1bt2ypJxpK7SZsiybAOiWvHUeg@mail.gmail.com> (raw)
In-Reply-To: <ajpQn8EVOx3ssxG6@ashevche-desk.local>
wt., 23 cze 2026 o 11:23 Andy Shevchenko <andriy.shevchenko@intel.com>
napisał(a):
>
> On Tue, Jun 23, 2026 at 12:15:50AM +0200, Jakub Szczudlo wrote:
> > Add ADS1110 support that have faster datarate than ADS1100, it also uses
> > internal voltage reference of 2.048V for measurement.
>
> ...
>
> > config TI_ADS1100
> > - tristate "Texas Instruments ADS1100 and ADS1000 ADC"
> > + tristate "Texas Instruments ADS1100 and similar single channel I2C ADC"
> > depends on I2C
> > help
> > - If you say yes here you get support for Texas Instruments ADS1100 and
> > - ADS1000 ADC chips.
> > + If you say yes here you get support TI ADS1100 and similar single
> > + channel I2C Analog to Digital Converters.
>
> User won't know what similar are really supported. The rule of thumb is to add
> the list of supported here as
>
> - ADS1000 (...perhaps some very short spec info...)
> - ADS1100 (...perhaps some very short spec info...)
>
>
> > This driver can also be built as a module. If so, the module will be
> > called ti-ads1100.
>
> ...
>
> > +static int ads1100_get_vref_milivolts(struct ads1100_data *data)
> > +{
> > + if (data->ads_config->has_internal_vref_only)
> > + return ADS1110_INTERNAL_REF_mV;
> > +
> > + return regulator_get_voltage(data->reg_vdd) / MILLI;
>
> For now we used "(MICRO / MILLI)" instead of "MILLI", to show the unit
> conversion.
>
> > +}
>
> ...
>
> > if (ret < 0) {
> > dev_err(&data->client->dev, "I2C read fail: %d\n", ret);
> > return ret;
>
> > + } else if (ret < 2) {
>
> Redundant 'else'.
>
> > + dev_err(&data->client->dev, "Short I2C read\n");
> > + return -EIO;
> > }
>
> ...
>
> > - microvolts = regulator_get_voltage(data->reg_vdd);
> > + microvolts = ads1100_get_vref_milivolts(data) * (MICRO / MILLI);
>
> See above, here you correctly used the existing pattern, the above is
> inconsistent and needs to be addressed.
>
> ...
>
> > + model = i2c_get_match_data(client);
> > + if (!model)
> > + return dev_err_probe(dev, -EINVAL,
> > + "Can't get device data from firmware\n");
> > +
> > + data->ads_config = (struct ads1100_config *)model;
>
> You can't drop const like this. If you need to apply modification,
> use devm_kmemdup(). Otherwise it won't work correctly if you have two different
> sensors of the same driver in the system.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
thanks for review, I will wait few days and start working on v5
best regards,
Jakub Szczudlo
next prev parent reply other threads:[~2026-06-23 18:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 22:15 [PATCH v4 0/3] iio: adc: Add support for TI ADS1110 " Jakub Szczudlo
2026-06-22 22:15 ` [PATCH v4 1/3] iio: adc: Fix incorrect reading when datarate changed in single mode Jakub Szczudlo
2026-06-23 9:16 ` Andy Shevchenko
2026-06-23 9:29 ` Joshua Crofts
2026-06-23 9:39 ` Andy Shevchenko
2026-06-29 18:28 ` Jonathan Cameron
2026-06-29 22:51 ` Jonathan Cameron
2026-06-30 11:36 ` Andy Shevchenko
2026-06-30 12:08 ` Matti Vaittinen
2026-06-30 12:28 ` Andy Shevchenko
2026-06-30 17:01 ` Jakub Szczudło
2026-06-27 22:31 ` David Lechner
2026-06-29 18:33 ` Jonathan Cameron
2026-06-29 18:55 ` David Lechner
2026-06-22 22:15 ` [PATCH v4 2/3] dt-bindings: iio: adc: ti,ads1100: add support for ADS1110 Jakub Szczudlo
2026-06-22 22:15 ` [PATCH v4 3/3] iio: adc: Add ti-ads1110 support to ti-ads1100 driver Jakub Szczudlo
2026-06-23 9:23 ` Andy Shevchenko
2026-06-23 18:49 ` Jakub Szczudło [this message]
2026-06-27 22:42 ` David Lechner
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=CA+gq5JitNkTpNbeKUd7bSnCx1bt2ypJxpK7SZsiybAOiWvHUeg@mail.gmail.com \
--to=jakubszczudlo40@gmail.com \
--cc=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=jic23@kernel.org \
--cc=jishnu.prakash@oss.qualcomm.com \
--cc=jorge.marques@analog.com \
--cc=joshua.crofts1@gmail.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