Devicetree
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Sirat <email@sirat.me>
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
	andy@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] iio: proximity: add driver for ST VL53L1X ToF sensor
Date: Fri, 13 Mar 2026 11:35:37 +0200	[thread overview]
Message-ID: <abPaaSgJi6m6mch9@ashevche-desk.local> (raw)
In-Reply-To: <CANn+LW+mg9Ridm3aMrVhy7cgvmJO0JNV_s_myfRCW8gPv7Ggkg@mail.gmail.com>

On Thu, Mar 12, 2026 at 11:37:26PM +0600, Sirat wrote:
> On Thu, Mar 12, 2026 at 8:58 PM Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> > On Thu, Mar 12, 2026 at 04:40:37AM +0600, Siratul Islam wrote:

...

> > > +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.

OK!

> > > +};

...

> > > +     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.

Based on the above experience, you know how to improve this.

...

> > > +     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.

And? reset-gpio driver is exactly for those cases. Please, move your driver
code accordingly.

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

Please, take care of the comments first.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-03-13  9:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 22:40 [PATCH v3 0/2] iio: proximity: add driver for ST VL53L1X ToF sensor Siratul Islam
2026-03-11 22:40 ` [PATCH v3 1/2] dt-bindings: iio: proximity: add " Siratul Islam
2026-03-11 22:40 ` [PATCH v3 2/2] iio: proximity: add driver for " Siratul Islam
2026-03-12 14:58   ` Andy Shevchenko
2026-03-12 17:37     ` Sirat
2026-03-13  9:35       ` Andy Shevchenko [this message]
2026-03-13 10:55         ` Sirat
2026-03-14 12:27       ` Jonathan Cameron
2026-03-12 14:27 ` [PATCH v3 0/2] " Andy Shevchenko
2026-03-12 15:12   ` Sirat
2026-03-12 15:23     ` Andy Shevchenko
2026-03-14 14:39     ` David Lechner
2026-03-14 15:25       ` Sirat
2026-03-15 18:57         ` Jonathan Cameron
2026-03-15 23:20           ` Sirat
2026-03-22 11:57             ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abPaaSgJi6m6mch9@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=email@sirat.me \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox