public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Rishi Gupta <gupt21@gmail.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: light: add support for veml3235
Date: Tue, 22 Oct 2024 19:28:07 +0100	[thread overview]
Message-ID: <20241022192807.2f83dfa1@jic23-huawei> (raw)
In-Reply-To: <7323ca4f-2f79-4478-b2b0-2cfc350af7f8@gmail.com>

On Mon, 21 Oct 2024 22:21:22 +0200
Javier Carrasco <javier.carrasco.cruz@gmail.com> wrote:

> On 21/10/2024 20:39, Jonathan Cameron wrote:
> > On Sun, 20 Oct 2024 21:12:17 +0200
> > Javier Carrasco <javier.carrasco.cruz@gmail.com> wrote:
> >   
> >> The Vishay veml3235 is a low-power ambient light sensor with I2C
> >> interface. It provides a minimum detectable intensity of
> >> 0.0021 lx/cnt, configurable integration time and gain, and an additional
> >> white channel to distinguish between different light sources.
> >>
> >> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>  
> > Hi Javier,
> > 
> > I missed one thing on previous review...
> > There is no obvious reason this driver needs to provide raw and processed
> > values.  Unless I'm missing something, just provide raw and let userspace
> > do the maths for us.
> > 
> > Jonathan
> >   
> Sure, I will drop that for v3. I added it because this driver took the
> veml6030 as a reference, and that driver provides the processed value. I
> guess that the veml6030 should have not provided processed values
> either, but it's late to remove them after the driver was released.
> 
> Now that we are at it, what is the rule (of thumb?) to provide processed
> values? Those that can't be obtained from the raw data and simple
> operations with the scale/offset/integration time/whatever userspace can
> see?

Yes. If the conversion is linear, then leave it to userspace (with scale
and offset provided). If it's not linear then in kernel because currently
we have no other choice.

There are some historical quirks where a processed only interface got in
then we had to add raw later (typically when we added buffered output
where scale and offset are important because processed values normally
don't pack well).

Jonathan


> 
> Thank you and best regards,
> Javier Carrasco


  reply	other threads:[~2024-10-22 18:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-20 19:12 [PATCH v2 0/2] iio: light: add support for veml3235 Javier Carrasco
2024-10-20 19:12 ` [PATCH v2 1/2] dt-bindings: iio: light: veml6030: add veml3235 Javier Carrasco
2024-10-21  7:18   ` Krzysztof Kozlowski
2024-10-20 19:12 ` [PATCH v2 2/2] iio: light: add support for veml3235 Javier Carrasco
2024-10-21 18:39   ` Jonathan Cameron
2024-10-21 20:21     ` Javier Carrasco
2024-10-22 18:28       ` Jonathan Cameron [this message]
2024-11-28 12:26         ` Javier Carrasco
2024-12-14 15:24           ` Javier Carrasco
2024-12-15 14:05             ` 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=20241022192807.2f83dfa1@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gupt21@gmail.com \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@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