Re: [PATCH v6 2/2] iio: proximity: add driver for ST VL53L1X ToF sensor
From: David Lechner
Date: Sat Mar 21 2026 - 20:38:09 EST
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?
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