From: David Lechner <dlechner@baylibre.com>
To: "Erikas Bitovtas" <xerikasxx@gmail.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Kevin Tsai" <ktsai@capellamicro.com>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
~postmarketos/upstreaming@lists.sr.ht,
phone-devel@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: light: Add support for Capella cm36686 and cm36672p sensors
Date: Mon, 2 Feb 2026 16:48:34 -0600 [thread overview]
Message-ID: <086d6b35-8c19-4e92-9cd1-557b98991d35@baylibre.com> (raw)
In-Reply-To: <b133521f-434d-4972-82a3-6e7978e557bd@gmail.com>
On 2/2/26 6:04 AM, Erikas Bitovtas wrote:
>
>
> On 2/1/26 8:45 PM, David Lechner wrote:
>> On 2/1/26 11:03 AM, Erikas Bitovtas wrote:
Pro tip: when you reply, trim out the not relevant parts like this.
It was hard to find your actual reply.
...
>>> +static const struct iio_chan_spec cm36686_channels[] = {
>>> + {
>>> + .type = IIO_LIGHT,
>>> + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) |
>>
>> IIO_LIGHT should have IIO_CHAN_INFO_SCALE to convert raw to convert the
>> raw value to lux. If we don't have that info due to lack of documentation,
>> then we should add a comment to explain that. Or maybe we can make an
>> educated guess?
> No documentation on this is available, but we know that ASUS in their driver for
> cm36686 use 160ms integration time for light and, after applying their custom
> calibration functions, divide received raw value by 25 if the device is cm36686,
> or by 20 if it's cm36283. Maybe from there we can extrapolate the lux value like
> this:
> 80ms -> raw / 12.5
> 160ms -> raw / 25
> 320ms -> raw / 50
> 640ms -> raw / 100
> Not sure how accurate that would be, however.
> Xiaomi gets IIO_CHAN_INFO_SCALE by multiplying a value retrieved from a device
> tree property called "als_trans_ratio", which is not documented anywhere.
The ASUS driver is an input driver, not IIO, so not sure that helps.
We could start with hard-coding the als_trans_ratio in this driver for the
scale (and write comments explaining where it came from and what we know
and don't know). Then at least we would have a scale. And if anyone needs
something more accurate and reverse-engineers it we could fix it up later
with a DT property or something like that.
next prev parent reply other threads:[~2026-02-02 22:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-01 17:03 [PATCH 0/2] iio: light: Add support for Capella cm36686 and cm36672p sensors Erikas Bitovtas
2026-02-01 17:03 ` [PATCH 1/2] dt-bindings: Add binding document for cm36686 Erikas Bitovtas
2026-02-01 18:45 ` David Lechner
2026-02-07 16:29 ` Jonathan Cameron
2026-02-01 17:03 ` [PATCH 2/2] iio: light: Add support for Capella cm36686 and cm36672p sensors Erikas Bitovtas
2026-02-01 18:45 ` David Lechner
2026-02-02 12:04 ` Erikas Bitovtas
2026-02-02 22:48 ` David Lechner [this message]
2026-02-03 15:41 ` Erikas Bitovtas
2026-02-03 16:36 ` David Lechner
2026-02-04 16:34 ` Erikas Bitovtas
2026-02-07 16:26 ` Jonathan Cameron
2026-02-07 16:43 ` 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=086d6b35-8c19-4e92-9cd1-557b98991d35@baylibre.com \
--to=dlechner@baylibre.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=ktsai@capellamicro.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=phone-devel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=xerikasxx@gmail.com \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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