Skip to content

RFC iio: proximity: Add Cytron HC-SR04 support

Paweł Wiśniewski linux-devicetree linux-iio lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3dt-bindings: vendor-prefixes: Add Cytron TechnologiesDocumentation/devicetree/bindings/vendor-prefixes.yaml+2 -00 replies
2/3dt-bindings: iio: proximity: Add Cytron HC-SR04Documentation/devicetree/bindings/iio/proximity/devantech-srf04.yaml+4 -11 reply
3/3iio: proximity: srf04: Add Cytron HC-SR04 supportdrivers/iio/proximity/Kconfig drivers/iio/proximity/srf04.c+2 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] iio: proximity: Add Cytron HC-SR04 support

Add Device Tree binding and driver match support for the Cytron HC-SR04 ultrasonic distance sensor.

The HC-SR04 uses separate trigger and echo GPIOs. A trigger pulse of at least 10 us starts a measurement, and the echo pulse width reports the ultrasonic round-trip time. This matches the protocol already implemented by the SRF04 IIO driver.

The series adds the Cytron vendor prefix, documents the cytron,hc-sr04 compatible, and uses the existing SRF04 configuration in the driver.

The Cytron vendor attribution is based on the HC-SR04 Product User's Manual V1.0 supplied by the retailer. The manual was prepared by Cytron Technologies Sdn. Bhd. and contains Cytron warranty and support information.

This is sent as an RFC because the vendor attribution and compatible name should be reviewed.

Testing:
- make dt_binding_check: PASS
- srf04 module build: PASS
- Tested on Raspberry Pi 3 Model B+
- Kernel: 6.18.34+rpt-rpi-v8
- Device instantiated using only cytron,hc-sr04
- Trigger connected to GPIO17
- Echo connected to GPIO27 through a 5 V to 3.3 V resistor divider
- Driver bound and registered an IIO device
- in_distance_raw returned changing distance readings

Paweł Wiśniewski (3):
dt-bindings: vendor-prefixes: Add Cytron Technologies
dt-bindings: iio: proximity: Add Cytron HC-SR04
iio: proximity: srf04: Add Cytron HC-SR04 support

 .../devicetree/bindings/iio/proximity/devantech-srf04.yaml   | 5 ++++-
 Documentation/devicetree/bindings/vendor-prefixes.yaml       | 2 ++
 drivers/iio/proximity/Kconfig                                | 1 +
 drivers/iio/proximity/srf04.c                                | 1 +
 4 files changed, 8 insertions(+), 1 deletion(-)

base-commit: 37e2f878a7a660a216cc7a60459995fefd150f25

Signature · 1 line
2.47.3