From: Christian Eggers <ceggers@arri.de>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
Jonathan Cameron <jic23@kernel.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
"Peter Meerwald-Stadler" <pmeerw@pmeerw.net>,
linux-iio <linux-iio@vger.kernel.org>,
devicetree <devicetree@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] iio: light: as73211: New driver
Date: Thu, 30 Jul 2020 12:18:14 +0200 [thread overview]
Message-ID: <2956063.qbQfZA7an0@n95hx1g2> (raw)
In-Reply-To: <CAHp75Vcz1kv_xhaRZMdK21KrkAbeBLE3evJNsjA2yMa=V0Yb0g@mail.gmail.com>
Hi Andy,
thanks for the extensive review. Almost all of you comments will be integrated
into v3.
On Tuesday, 28 July 2020, 20:00:31 CEST, Andy Shevchenko wrote:
> On Tue, Jul 28, 2020 at 9:32 AM Christian Eggers <ceggers@arri.de> wrote:
> > + if (data->client->irq)
> > + init_completion(&data->completion);
> I believe it should be reinit_completion().
added missing init_completion() in probe().
> > + /* During measurement, there should be no traffic on the i2c bus
*/
> > + i2c_lock_bus(data->client->adapter, I2C_LOCK_SEGMENT);
> Hmm.. Really?
yes. According to the datasheet, the device is very sensitive to external
noise
during measurement.
> > + *val = (1 << (data->creg3 & 0b11)) * 1024 * 1000;
>
> BIT()? GENMASK() ? 1000 I believe defined already.
Please recheck in v3. What shall I use instead of "1000"?
> > + /* saturate all channels (useful for overflows) */
> > + iio_buffer[1] = 0xffff;
> > + iio_buffer[2] = 0xffff;
> > + iio_buffer[3] = 0xffff;
>
> Magic!
Replaced by U16_MAX. Do you want to see something else here? It is required
to communicate measurement errors to user space as the application will have
to adjust integration time and gain.
> > +static ssize_t as73211_show_samp_freq_available(
> > + struct device *dev __always_unused,
> > + struct device_attribute *attr __always_unused,
> > + char *buf)
> > +{
> > + size_t len = 0;
> > + int i;
> > +
> > + for (i = 0; i < 4; i++) {
> > + len += scnprintf(buf + len, PAGE_SIZE - len, "%d ",
> > + (1 << (i + 10)) * 1000);
> > + }
> > +
> > + /* replace trailing space by newline */
> > + buf[len - 1] = '\n';
> > +
> > + return len;
> > +}
>
> Repetition of IIO core functionality?
>
> Ditto question for the other similar functions.
Can you please give me a pointer to an example? The list of available values
of
some attributes depend on the current value of other attributes.
regards
Christian
next prev parent reply other threads:[~2020-07-30 10:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-28 6:28 [PATCH v2 0/2] iio: light: Support AMS AS73211 digital XYZ sensor Christian Eggers
2020-07-28 6:28 ` [PATCH v2 1/2] dt-bindings: iio: light: add AMS AS73211 support Christian Eggers
2020-07-28 6:28 ` [PATCH v2 2/2] iio: light: as73211: New driver Christian Eggers
2020-07-28 18:00 ` Andy Shevchenko
2020-07-30 10:18 ` Christian Eggers [this message]
2020-07-28 18:01 ` Jonathan Cameron
2020-07-30 10:18 ` Christian Eggers
2020-08-01 15:55 ` 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=2956063.qbQfZA7an0@n95hx1g2 \
--to=ceggers@arri.de \
--cc=andy.shevchenko@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).