Re: [PATCH v6 2/2] iio: proximity: add driver for ST VL53L1X ToF sensor

From: Jonathan Cameron

Date: Sun Mar 22 2026 - 07:03:40 EST


On Sat, 21 Mar 2026 19:37:58 -0500
David Lechner <dlechner@xxxxxxxxxxxx> wrote:

> On 3/21/26 5:39 PM, Sirat wrote:
> > On Sat, Mar 21, 2026 at 11:09 PM David Lechner <dlechner@xxxxxxxxxxxx> wrote:
> >>
> >> On 3/19/26 2:07 PM, Siratul Islam wrote:
> >>> Add support for the STMicroelectronics VL53L1X Time-of-Flight
> >>> ranging sensor with I2C interface.
> >>>
> ...
>
> >>> +
> >>> + ret = vl53l1x_start_ranging(data);
> >>> + if (ret)
> >>> + return ret;
> >>
> >> Why start ranging here? It looks like this is controlled during buffer
> >> enable/disable.
> >>
> > The VL53L1X (unlike L0X) does not have a single-shot mode. So every
> > measurement requires the device
> > to be running (Autonomous mode according to the datasheet). Starting
> > ranging once
> > in probe allows the direct read path to work without any additional
> > start/stop logic inside read_raw().
> > This keeps that path simple and low-latency. The buffered/triggered
> > path independently controls
> > ranging via postenable/predisable, so there is no conflict.
>
> If you do a buffered read, which stop ranging when it is done,
> then how can the direct read work after that?
>
> Can we just start and stop ranging momentarily for a direct
> read?
If the latency is high, then worth considering whether autosuspend
and runtime pm can help. That way a burst of reads will see low
latency after the first one but we won't be wasting power when
no one cares.

J
>
> Otherwise, is seems like we would want to have ranging always
> enabled.
>
> >>
> >>
> > I will address the rest of your review in the next version.
> >
> > Thanks,
> > Sirat
>
>