From: Jonathan Cameron <jic23@kernel.org>
To: Abhash jha <abhashkumarjha123@gmail.com>
Cc: linux-iio@vger.kernel.org, lars@metafoo.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] iio: light: vl6180: Add support for Continuous Mode
Date: Sat, 5 Oct 2024 19:15:08 +0100 [thread overview]
Message-ID: <20241005191508.16150a9d@jic23-huawei> (raw)
In-Reply-To: <CAG=0RqJNJNg9yydeKfpo87P6sYd5n6Xi0MoLz0OFQrXPgb8cFA@mail.gmail.com>
On Sat, 5 Oct 2024 22:42:43 +0530
Abhash jha <abhashkumarjha123@gmail.com> wrote:
> > Hi Abhash,
> >
> > Some comments below.
> >
> Hi Jonathan,
> I will do the fixes and send a v3.
>
> I have a question though:
> The device has a 8 x 16-bit HW-buffer.
> I want to implement the HW buffer support. Where in this driver should
> I read the hardware buffer?
If it were a fifo there are lots of examples in tree, but those tend
to 'empty' on read. From your description I'm not sure this one does.
> How is that exposed to userspace? Is it even exposed?
> There is no buffer-full interrupt, It just has the latest 16 range
> measurements and
> latest 8 ALS measurements.
Ah. Can we tell if the data is new vs data we have already read?
From a quick glance looks like you can clear it, so maybe we can use that
though we'll have to be careful about races. Do we have to stop
continuous mode to clear it? Sort of looks like that's the case from
the description of the clear not occuring until a start_stop write.
However we'll have to dead reckon the timing without an interrupt.
That should be fine, as just configure it to max say 3/4 of the
time to fill it.
>
> There is also a SYSTEM_HISTORY_CTRL register, which configures the HW buffer,
> like setting which data to capture (ALS/RANGE) as well as turning the
> buffer on/off.
> Where should all this configuration be done?
> Should it be default or have some sysfs attribute associated with it?
So if it were a conventional fifo it would mostly be hidden behind the
software fifo and just act as an optimization of the data capture.
A few things are exposed though as can make a difference to how you configure
the device such as the size of the hardware fifo and the hwfifo threshold
(affects latency of data capture). However sounds like you don't have
that here.
So challenging feature to support.
>
> Thanks,
> Abhash
prev parent reply other threads:[~2024-10-05 18:15 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 15:01 [PATCH 0/3] Interrupt and Continuous mode support for VL6180 Abhash Jha
2024-10-04 15:01 ` [PATCH 1/3] iio: light: vl6180: Add configurable inter-measurement period support Abhash Jha
2024-10-05 12:25 ` kernel test robot
2024-10-05 16:41 ` Jonathan Cameron
2024-10-05 16:56 ` Abhash jha
2024-10-05 17:03 ` Jonathan Cameron
2024-10-04 15:01 ` [PATCH 2/3] iio: light: vl6180: Added Interrupt support for single shot access Abhash Jha
2024-10-05 16:47 ` Jonathan Cameron
2024-10-05 17:35 ` Abhash jha
2024-10-05 18:08 ` Jonathan Cameron
2024-10-04 15:01 ` [PATCH 3/3] iio: light: vl6180: Add support for Continuous Mode Abhash Jha
2024-10-05 16:59 ` Jonathan Cameron
2024-10-05 17:12 ` Abhash jha
2024-10-05 18:15 ` Jonathan Cameron [this message]
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=20241005191508.16150a9d@jic23-huawei \
--to=jic23@kernel.org \
--cc=abhashkumarjha123@gmail.com \
--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