Re: [PATCH v6 2/2] iio: proximity: add driver for ST VL53L1X ToF sensor
From: Sirat
Date: Sat Mar 21 2026 - 18:40:22 EST
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_set_inter_measurement_ms(data, 50);
> > + if (ret)
> > + return ret;
>
> Could make sense to move these into vl53l1x_chip_init() so that probe isn't so long.
>
These are kept out of chip_init() to match the ST Ultra Lite Driver
init sequence.
Init only covers hardware init and VHV calibration, distance mode and
timing config
are separate user-facing calls made after it.
>
> > +
> > + 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.
>
>
I will address the rest of your review in the next version.
Thanks,
Sirat