From: Francesco Dolcini <francesco@dolcini.it>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Francesco Dolcini" <francesco@dolcini.it>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"João Paulo Gonçalves" <jpaulo.silvagoncalves@gmail.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"João Paulo Gonçalves" <joao.goncalves@toradex.com>,
linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
"Francesco Dolcini" <francesco.dolcini@toradex.com>
Subject: Re: [PATCH v2 2/2] iio: adc: ti-ads1119: Add driver
Date: Mon, 10 Jun 2024 13:59:09 +0200 [thread overview]
Message-ID: <20240610115909.GA27057@francesco-nb> (raw)
In-Reply-To: <20240609115234.20e08840@jic23-huawei>
Hello Jonathan,
thanks for the review.
On Sun, Jun 09, 2024 at 11:52:34AM +0100, Jonathan Cameron wrote:
> On Thu, 6 Jun 2024 18:35:29 +0200
> Francesco Dolcini <francesco@dolcini.it> wrote:
>
> > From: João Paulo Gonçalves <joao.goncalves@toradex.com>
> >
> > The ADS1119 is a precision, 16-bit, analog-to-digital converter (ADC)
> > that features two differential or four single-ended inputs through a
> > flexible input multiplexer (MUX), rail-to-rail input
> > buffers, a programmable gain stage, a voltage reference, and an
> > oscillator.
> >
> > Apart from normal single conversion, the driver also supports
> > continuous conversion mode using a triggered buffer. However, in this
> > mode only one channel can be scanned at a time, and it only uses the data
> > ready interrupt as a trigger. This is because the device channels are
> > multiplexed, and using its own data ready interrupt as a trigger guarantees
> > the signal sampling frequency.
> >
> > Datasheet: https://www.ti.com/lit/gpn/ads1119
> > Signed-off-by: João Paulo Gonçalves <joao.goncalves@toradex.com>
> > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
>
> A few more comments inline. Some of these I missed in the first
> versions - sorry about that. Takes a few passes to pick up
> on everything unfortunately.
>
> > diff --git a/drivers/iio/adc/ti-ads1119.c b/drivers/iio/adc/ti-ads1119.c
> > new file mode 100644
> > index 000000000000..ea0573f07279
> > --- /dev/null
> > +++ b/drivers/iio/adc/ti-ads1119.c
> > @@ -0,0 +1,850 @@
...
> > +
> > +static int ads1119_cmd(struct ads1119_state *st, unsigned int cmd)
> > +{
> > + dev_dbg(&st->client->dev, "cmd: %#x\n", cmd);
> > +
> > + return i2c_smbus_write_byte(st->client, cmd);
> I'm not a fan of tiny wrappers to add debug info.
> The i2c core has trace points that let you get to the relevant data. Better
> to use those for debug and flatten this code so we
> see the actual bus accesses inline.
Fine on removing the debug prints, we'll do.
However ads1119_cmd_rdata() and ads1119_update_config_reg() wrappers are
making the error handling in the caller easier.
Either we remove only ads1119_cmd/ads1119_cmd_wreg or we keep them all
for orthogonality. Both works for me, just let me know if you agree and
which option do you prefer. Personally I would keep them all without
debug prints.
> > +
> > + return read_poll_timeout(ads1119_data_ready,
> > + data_ready,
> > + (data_ready == true),
> > + wait_time,
> > + ADS1119_MAX_DRDY_TIMEOUT,
> > + false,
> > + st);
> Over wrapped. Aim for closer to 80 chars.
I'll do.
Do you have any rules on the IIO subsystem driver? IOW is it fine to
have line slightly longer than 80chars if this improves readability ?
Francesco
next prev parent reply other threads:[~2024-06-10 11:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-06 16:35 [PATCH v2 0/2] iio: adc: ti-ads1119: Add driver Francesco Dolcini
2024-06-06 16:35 ` [PATCH v2 1/2] dt-bindings: iio: adc: add ti,ads1119 Francesco Dolcini
2024-06-06 17:07 ` Conor Dooley
2024-06-06 20:49 ` Rob Herring
2024-06-06 22:11 ` Francesco Dolcini
2024-06-09 10:17 ` Jonathan Cameron
2024-06-06 16:35 ` [PATCH v2 2/2] iio: adc: ti-ads1119: Add driver Francesco Dolcini
2024-06-09 10:52 ` Jonathan Cameron
2024-06-10 11:59 ` Francesco Dolcini [this message]
2024-06-11 17:26 ` Jonathan Cameron
2024-06-10 13:26 ` João Paulo Gonçalves
2024-06-11 17:29 ` 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=20240610115909.GA27057@francesco-nb \
--to=francesco@dolcini.it \
--cc=broonie@kernel.org \
--cc=francesco.dolcini@toradex.com \
--cc=jic23@kernel.org \
--cc=joao.goncalves@toradex.com \
--cc=jpaulo.silvagoncalves@gmail.com \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.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