All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: "Vidhu Sarwal via B4 Relay"
	<devnull+vidhu.linux.gmail.com@kernel.org>,
	vidhu.linux@gmail.com, "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-iio@vger.kernel.org,
	"Shuah Khan" <skhan@linuxfoundation.org>
Subject: Re: [PATCH 3/3] iio: proximity: Add Benewake TF-Luna LiDAR driver
Date: Tue, 20 Oct 2026 10:42:51 +0300	[thread overview]
Message-ID: <atcbe2O6REJqok2n@ashevche-desk.local> (raw)
In-Reply-To: <20261020092316.00003339@gmail.com>

On Tue, Oct 20, 2026 at 09:23:16AM +0200, Joshua Crofts wrote:
> On Tue, 20 Oct 2026 00:03:43 +0530
> Vidhu Sarwal via B4 Relay <devnull+vidhu.linux.gmail.com@kernel.org> wrote:

...

> > When the signal strength is too low the sensor reports a dummy distance
> > of 0, so such readings, as well as overexposed ones, return -ENODATA
> > instead of a distance.
> > 
> > The datasheet is available at:
> > https://en.benewake.com/uploadfiles/2025/04/20250430174501874.pdf

Make it Datasheet tag.

> > Signed-off-by: Vidhu Sarwal <vidhu.linux@gmail.com>

...

> > +/* A measurement takes 10-20 ms in trigger mode */
> > +#define TF_LUNA_POLL_US			(2 * USEC_PER_MSEC)
> > +#define TF_LUNA_TIMEOUT_US		(100 * USEC_PER_MSEC)
> 
> uS is better instead of US.

Currently _US is established suffix, unfortunately. But I have no strong
opinion here, I'm full to support _uS, but OTOH the _US will be consistent.

...

> > +static const struct regmap_config tf_luna_regmap_config = {
> > +	.reg_bits = 8,
> > +	.val_bits = 8,
> > +	.max_register = TF_LUNA_REG_SIGNATURE + 3,

No cache?

> > +};

...

> > +static int tf_luna_measure(struct tf_luna_data *data, int *dist)
> > +{
> > +	__le16 buf[2];	/* distance in cm, signal strength */
> > +	u16 old_tick, tick, amp;
> > +	int ret, err;
> > +
> > +	guard(mutex)(&data->lock);
> > +
> > +	ret = tf_luna_read_tick(data, &old_tick);
> > +	if (ret)
> > +		return ret;
> > +
> > +	ret = regmap_write(data->regmap, TF_LUNA_REG_TRIG_ONE_SHOT,
> > +			   TF_LUNA_TRIG_ONE_SHOT);

> Why not have a local variable for regmap? It would allow the previous call
> to fit on one line.

Almost, but I agree.

	ret = regmap_write(map, TF_LUNA_REG_TRIG_ONE_SHOT, TF_LUNA_TRIG_ONE_SHOT);

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-10-20  7:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 18:33 [PATCH 0/3] iio: proximity: Add Benewake TF-Luna LiDAR driver Vidhu Sarwal via B4 Relay
2026-10-19 18:33 ` Vidhu Sarwal
2026-10-19 18:33 ` [PATCH 1/3] dt-bindings: vendor-prefixes: Add Benewake Vidhu Sarwal via B4 Relay
2026-10-19 18:33   ` Vidhu Sarwal
2026-10-20  8:35   ` Krzysztof Kozlowski
2026-10-19 18:33 ` [PATCH 2/3] dt-bindings: iio: proximity: Add Benewake TF-Luna Vidhu Sarwal via B4 Relay
2026-10-19 18:33   ` Vidhu Sarwal
2026-10-20  8:38   ` Krzysztof Kozlowski
2026-10-19 18:33 ` [PATCH 3/3] iio: proximity: Add Benewake TF-Luna LiDAR driver Vidhu Sarwal via B4 Relay
2026-10-19 18:33   ` Vidhu Sarwal
2026-10-20  7:23   ` Joshua Crofts
2026-10-20  7:42     ` Andy Shevchenko [this message]
2026-10-20  8:10   ` Andy Shevchenko

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=atcbe2O6REJqok2n@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=devnull+vidhu.linux.gmail.com@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=joshua.crofts1@gmail.com \
    --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 \
    --cc=skhan@linuxfoundation.org \
    --cc=vidhu.linux@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.