From: Mikael Gonella-Bolduc <mgonellabolduc@dimonoff.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Mikael Gonella-Bolduc via B4 Relay
<devnull+mgonellabolduc.dimonoff.com@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Mikael Gonella-Bolduc <m.gonella.bolduc@gmail.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
Hugo Villeneuve <hvilleneuve@dimonoff.com>,
Matti Vaittinen <mazziesaccount@gmail.com>
Subject: Re: [PATCH v2 2/2] iio: light: Add APDS9160 ALS & Proximity sensor driver
Date: Mon, 9 Dec 2024 16:49:12 -0500 [thread overview]
Message-ID: <Z1dl2C9/BYoeyudu@uva.nl> (raw)
In-Reply-To: <20241208122038.18cf7db8@jic23-huawei>
On Sun, Dec 08, 2024 at 12:20:38PM +0000, Jonathan Cameron wrote:
> On Fri, 06 Dec 2024 11:09:57 -0500
> Mikael Gonella-Bolduc via B4 Relay <devnull+mgonellabolduc.dimonoff.com@kernel.org> wrote:
>
> > From: Mikael Gonella-Bolduc <mgonellabolduc@dimonoff.com>
> >
> > APDS9160 is a combination of ALS and proximity sensors.
> >
> > This patch add supports for:
> > - Intensity clear data and illuminance data
> > - Proximity data
> > - Gain control, rate control
> > - Event thresholds
> >
> > Signed-off-by: Mikael Gonella-Bolduc <mgonellabolduc@dimonoff.com>
>
> Hi Mikael,
>
> As the bots noted, the maintainers entry has the wrong vendor prefix,
> or the binding does.
>
> Also the issue with missing include of linux/bitfield.h
>
> Unused gain table is less obvious. Not sure what intent was on that one.
>
> Given the discussion with Matti about how to do the gain control, please add
> some description here of the outcome. The control scheme is not particularly
> obvious and is the key bit we should be reviewing. It feels like you've
> applied the feedback on v1 to the light channel but it is equally applicable
> to proximity channels when they are just measures of reflected light intensity.
>
> Various other minor things inline.
>
> Thanks,
>
>
> Jonathan
Hi Jonathan,
I will fix the warnings the bots noted and other inline comments for v3, sorry about that.
Regarding gain control for ALS, I kept the non-linear table provided in the datasheet.
The user can adjust the integration time and the available scales will update
depending on the value.
For example, at 100ms, you have possible scales of 0.819, 0.269, 0.131, etc. (lux/count).
The hardware gain and other relevant registers gets adjusted by the driver depending on selected scale.
The attribute is kept as read-only as Matti suggested.
Now, for proximity, again I'm confused. Please bear with me a little.
The only "scale" I see in the datasheet is that the proximity sensor is for a short distance of under 70mm.
There's nothing provided in the datasheet to convert the proximity ADC count to a distance or to anything meaningful like standard units.
I don't feel like this is really precise and the intended use case is probably like mine where you can use this to detect
if there's something covering the sensor or not.
I took a look at other light/proximity sensors, again, it's not clear for me how to handle this.
It seems that some drivers just directly control the hardware gain register with the scale even if it's not really a scale.
What should I do?
Best regards,
Mikael
next prev parent reply other threads:[~2024-12-09 21:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 16:09 [PATCH v2 0/2] Add support for Avago/Broadcom APDS9160 Mikael Gonella-Bolduc via B4 Relay
2024-12-06 16:09 ` [PATCH v2 1/2] dt-bindings: iio: light: Add APDS9160 binding Mikael Gonella-Bolduc via B4 Relay
2024-12-06 16:33 ` Conor Dooley
2024-12-06 20:03 ` Mikael Gonella-Bolduc
2024-12-08 11:41 ` Jonathan Cameron
2024-12-15 15:33 ` Conor Dooley
2024-12-06 16:09 ` [PATCH v2 2/2] iio: light: Add APDS9160 ALS & Proximity sensor driver Mikael Gonella-Bolduc via B4 Relay
2024-12-06 21:12 ` kernel test robot
2024-12-06 22:24 ` kernel test robot
2024-12-08 12:20 ` Jonathan Cameron
2024-12-09 21:49 ` Mikael Gonella-Bolduc [this message]
2024-12-11 20:53 ` Jonathan Cameron
2024-12-16 23:00 ` Mikael Gonella-Bolduc
2024-12-09 3:40 ` kernel test robot
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=Z1dl2C9/BYoeyudu@uva.nl \
--to=mgonellabolduc@dimonoff.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=devnull+mgonellabolduc.dimonoff.com@kernel.org \
--cc=hvilleneuve@dimonoff.com \
--cc=jic23@kernel.org \
--cc=justinstitt@google.com \
--cc=krzk+dt@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=m.gonella.bolduc@gmail.com \
--cc=mazziesaccount@gmail.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--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;
as well as URLs for NNTP newsgroup(s).