[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210915114646.1d3303d2@xps13>
Date: Wed, 15 Sep 2021 11:46:46 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Lars-Peter Clausen <lars@...afoo.de>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Nuno Sa <Nuno.Sa@...log.com>
Subject: Re: [PATCH v2 05/16] iio: adc: max1027: Minimize the number of
converted channels
Hi Jonathan,
jic23@...nel.org wrote on Sun, 5 Sep 2021 16:34:06 +0100:
> On Thu, 2 Sep 2021 23:14:26 +0200
> Miquel Raynal <miquel.raynal@...tlin.com> wrote:
>
> > Provide a list of ->available_scan_masks which match the device's
> > capabilities. Basically, the devices is able to scan from 0 to N, N
> > being the highest voltage channel requested by the user. The temperature
> > can be included or not, but cannot be retrieved alone.
> >
> > The consequence is, instead of reading and pushing to the IIO buffers
> > all channels each time, the "minimum" number of channels will be scanned
> > and pushed based on the ->active_scan_mask.
> >
> > For example, if the user wants channels 1, 4 and 5, all channels from
> > 0 to 5 will be scanned and pushed to the IIO buffers. The core will then
> > filter out the unneeded samples based on the ->active_scan_mask that has
> > been selected and only channels 1, 4 and 5 will be available to the user
> > in the shared buffer.
>
> This explanation is excellent. If you are respinning it would be great
> to have the essence of it as a comment alongside the code.
> The bit about temp in particular was something I'd missed.
No problem, I'll add a comment inline as well.
> Nice optimization in general.
Thanks!
> Jonathan
>
Best regards,
Miquèl
Powered by blists - more mailing lists