Devicetree
 help / color / mirror / Atom feed
From: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
To: "Paweł Wiśniewski" <pawel.wis.me@gmail.com>
Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	ak@it-klinger.de, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 3/3] iio: proximity: srf04: Add Cytron HC-SR04 support
Date: Sat, 18 Jul 2026 23:47:28 +0100	[thread overview]
Message-ID: <20260718234717.6f361fb9@jic23-huawei> (raw)
In-Reply-To: <3fedc827a2581d61bef9ea639ed77cf90e80047a.1784221074.git.pawel.wis.me@gmail.com>

On Thu, 16 Jul 2026 19:35:56 +0200
Paweł Wiśniewski <pawel.wis.me@gmail.com> wrote:

> Tested on a Raspberry Pi 3 Model B+ running
> 6.18.34+rpt-rpi-v8. The sensor was instantiated using only the
> cytron,hc-sr04 compatible, with trigger connected to GPIO17 and echo
> connected to GPIO27 through a 5 V to 3.3 V resistor divider. The
> driver bound to the device, registered an IIO device, and returned
> changing distance readings through in_distance_raw.
> 
> Assisted-by: ChatGPT:GPT-5.6 Thinking
> Signed-off-by: Paweł Wiśniewski <pawel.wis.me@gmail.com>

This suggests that it is very much suited to a fallback compatible to the
Devantech SRF04 (see comment I made on the binding).

With that in place, we probably don't need a driver change.

Thanks,

Jonathan

> ---
>  drivers/iio/proximity/Kconfig | 1 +
>  drivers/iio/proximity/srf04.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/iio/proximity/Kconfig b/drivers/iio/proximity/Kconfig
> index bb77fad2a1b3..89e9d57ceba6 100644
> --- a/drivers/iio/proximity/Kconfig
> +++ b/drivers/iio/proximity/Kconfig
> @@ -139,6 +139,7 @@ config SRF04
>  	  ranger sensor. This driver can be used to measure the distance
>  	  of objects. It is using two GPIOs.
>  	  Actually Supported types are:
> +	  - Cytron HC-SR04
>  	  - Devantech SRF04
>  	  - Maxbotix mb1000
>  	  - Maxbotix mb1010
> diff --git a/drivers/iio/proximity/srf04.c b/drivers/iio/proximity/srf04.c
> index 7be50bdebfcb..f5ee7d6572b5 100644
> --- a/drivers/iio/proximity/srf04.c
> +++ b/drivers/iio/proximity/srf04.c
> @@ -231,6 +231,7 @@ static const struct iio_chan_spec srf04_chan_spec[] = {
>  };
>  
>  static const struct of_device_id of_srf04_match[] = {
> +	{ .compatible = "cytron,hc-sr04", .data = &srf04_cfg },
>  	{ .compatible = "devantech,srf04", .data = &srf04_cfg },
>  	{ .compatible = "maxbotix,mb1000", .data = &mb_lv_cfg },
>  	{ .compatible = "maxbotix,mb1010", .data = &mb_lv_cfg },


  parent reply	other threads:[~2026-07-18 22:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 17:35 [RFC PATCH 0/3] iio: proximity: Add Cytron HC-SR04 support Paweł Wiśniewski
2026-07-16 17:35 ` [RFC PATCH 1/3] dt-bindings: vendor-prefixes: Add Cytron Technologies Paweł Wiśniewski
2026-07-16 17:35 ` [RFC PATCH 2/3] dt-bindings: iio: proximity: Add Cytron HC-SR04 Paweł Wiśniewski
2026-07-16 17:45   ` sashiko-bot
2026-07-18 22:45   ` Jonathan Cameron
2026-07-16 17:35 ` [RFC PATCH 3/3] iio: proximity: srf04: Add Cytron HC-SR04 support Paweł Wiśniewski
2026-07-16 17:46   ` sashiko-bot
2026-07-18 22:47   ` Jonathan Cameron [this message]
2026-07-16 18:22 ` [RFC PATCH 0/3] iio: proximity: " 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=20260718234717.6f361fb9@jic23-huawei \
    --to=jonathan.cameron@oss.qualcomm.com \
    --cc=ak@it-klinger.de \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=pawel.wis.me@gmail.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