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

From: Sirat

Date: Thu Mar 12 2026 - 13:37:47 EST


On Thu, Mar 12, 2026 at 8:58 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxx> wrote:
>
> On Thu, Mar 12, 2026 at 04:40:37AM +0600, Siratul Islam wrote:
> > Add support for the STMicroelectronics VL53L1X Time-of-Flight
> > ranging sensor with I2C interface.
> ...
>
> > +static const struct regmap_config vl53l1x_regmap_config = {
> > + .reg_bits = 16,
> > + .val_bits = 8,
>
> No cache?
>
The result registers change on every measurement, so caching doesn't
apply well here.
Will add .cache_type = REGCACHE_NONE with a comment to clarify.
> > +};
>
> ...
> > +
> > + reinit_completion(&data->completion);
>
> > + wait_for_completion_timeout(&data->completion, HZ / 10);
>
> No error condition check?
>
This is only a short drain to make sure any pending IRQ has been
handled before we stop
the device and clear the interrupt line. A timeout here is not treated
as a failure and the device
is being shut down anyway, so I intentionally do not check the return value.
>
> ...
>
> > + data->xshut_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
> > + if (IS_ERR(data->xshut_gpio))
> > + return dev_err_probe(dev, PTR_ERR(data->xshut_gpio),
> > + "Cannot get reset GPIO\n");
>
> If it's a reset (semantically), use reset-gpio driver and reset APIs here.
>
The XSHUT pin is a shutdown/enable pin rather than a true reset line,
and the existing shared st,vl53l0x.yaml
binding already defines it as reset-gpios. So I am keeping the GPIO
consumer API here.
>
>

Sending v4 with all other fixes from your review, shortly.

Thanks,
Sirat