lkml.org 
[lkml]   [2020]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 2/2] iio: light: as73211: New driver
Date
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



\
 
 \ /
  Last update: 2020-07-30 12:19    [W:0.143 / U:3.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site