From: Matti Vaittinen <mazziesaccount@gmail.com>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Rishi Gupta <gupt21@gmail.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH 0/2] iio: light: fix scale in veml6030
Date: Mon, 13 Jan 2025 12:25:52 +0200 [thread overview]
Message-ID: <25d5ff51-8a1c-4e34-9f0e-e11778313d8c@gmail.com> (raw)
In-Reply-To: <20250107-veml6030-scale-v1-0-1281e3ad012c@gmail.com>
On 07/01/2025 22:50, Javier Carrasco wrote:
> This series follows a similar approach as recently used for the veml3235
> by using iio-gts to manage the scale as stated in the ABI. In its
> current form, the driver exposes the hardware gain instead of the
> multiplier for the raw value to obtain a value in lux.
>
> Although this driver and the veml3235 have many similarities, there are
> two main differences in this series compared to the one used to fix the
> other driver:
>
> - The veml6030 has fractional gains, which are not supported by the
> iio-gts helpers. My first attempt was adding support for them, but
> that made the whole iio-gts implementation more complex, cumbersome,
> and the risk of affecting existing clients was not negligible.
I do agree. If one added support for fractional gains, it should be very
very clear implementation so that even my limited capacity could handle
it :)
> Instead, a x8 factor has been used for the hardware gain to present
> the minimum value (x0.125) as x1, keeping linearity. The scales
> iio-gts generates are therefore right without any extra conversion,
> and they match the values provided in the different datasheets.
I didn't look through the patches yet - I'm getting to there though :)
Anyways, I assume you don't expose this HARDWAREGAIN to users?
> - This driver included a processed value for the ambient light, maybe
> because the scale did not follow the ABI and the conversion was not
> direct. To avoid breaking userspace, the functionality has been kept,
> but of course using the fixed scales. That requires using intermediate
> u64 values u64 divisions via div_u64() and do_div() to avoid overflows.
>
> To ease the usage of the iio-gts selectors, a previous patch to support
> regfields and caching has been included.
I don't see why iio-gts would need regfields? (I have never been able to
fully decide whether the regfields are a nice thing or not. I feel that
in many cases regfields just add an extra layer of obfuscation while
providing little help - but this is just my personal opinion and I'm not
against using them. I just don't think the iio-gts needs them to be
used. AFAIR, selectors do not need to start from zero.).
Yours,
-- Matti
next prev parent reply other threads:[~2025-01-13 10:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 20:50 [PATCH 0/2] iio: light: fix scale in veml6030 Javier Carrasco
2025-01-07 20:50 ` [PATCH 1/2] iio: light: veml6030: extend regmap to support regfields and caching Javier Carrasco
2025-01-12 13:18 ` Jonathan Cameron
2025-01-12 14:10 ` Javier Carrasco
2025-01-12 16:40 ` Jonathan Cameron
2025-01-07 20:50 ` [PATCH 2/2] iio: light: veml6030: fix scale to conform to ABI Javier Carrasco
2025-01-09 17:46 ` Javier Carrasco
2025-01-12 13:22 ` Jonathan Cameron
2025-01-13 11:56 ` Matti Vaittinen
2025-01-13 15:05 ` Javier Carrasco
2025-01-13 19:52 ` Matti Vaittinen
2025-01-13 22:32 ` Javier Carrasco
2025-01-14 6:43 ` Matti Vaittinen
2025-01-14 13:02 ` Javier Carrasco
2025-01-14 14:26 ` Matti Vaittinen
2025-01-18 12:16 ` Jonathan Cameron
2025-01-13 10:25 ` Matti Vaittinen [this message]
2025-01-13 11:02 ` [PATCH 0/2] iio: light: fix scale in veml6030 Javier Carrasco
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=25d5ff51-8a1c-4e34-9f0e-e11778313d8c@gmail.com \
--to=mazziesaccount@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=gupt21@gmail.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--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