[PATCH 1/3] dt-bindings: iio: proximity: Add YAML binding for RFD77402 ToF sensor

Shrikant Raskar posted 3 patches 5 days, 20 hours ago
There is a newer version of this series
[PATCH 1/3] dt-bindings: iio: proximity: Add YAML binding for RFD77402 ToF sensor
Posted by Shrikant Raskar 5 days, 20 hours ago
The RFD77402 driver has existed without a formal device tree binding
description. With the recent addition of Device Tree support and
interrupt handling in the driver, it is now necessary to document
the DT properties used for configuring the device.

Since the binding introduces the compatible string "rfdigital,rfd77402",
the "rfdigital" vendor prefix is also added to vendor-prefixes.yaml.

Signed-off-by: Shrikant Raskar <raskar.shree97@gmail.com>
---
 .../iio/proximity/rfdigital,rfd77402.yaml     | 55 +++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
 2 files changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml

diff --git a/Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml b/Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml
new file mode 100644
index 000000000000..93deaa4e8b7a
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/proximity/rfdigital,rfd77402.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: RF Digital RFD77402 ToF sensor
+
+maintainers:
+  - Shrikant Raskar <raskar.shree97@gmail.com>
+
+description: |
+  The RF Digital RFD77402 is a Time-of-Flight (ToF) proximity and distance
+  sensor providing up to 200 mm range measurement over an I2C interface.
+
+properties:
+  compatible:
+    const: rfdigital,rfd77402
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+    description: |
+      Generated by the device to announce that a new
+      measurement data is ready in result register.
+
+  vdd-supply:
+    description: Regulator that provides power to the sensor
+
+  vddio-supply:
+    description: Regulator providing I/O interface voltage
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        proximity@4c {
+            compatible = "rfdigital,rfd77402";
+            reg = <0x4c>;
+            interrupt-parent = <&gpio>;
+            interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index f1d1882009ba..a2e113e29e37 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1341,6 +1341,8 @@ patternProperties:
     description: Revolution Robotics, Inc. (Revotics)
   "^rex,.*":
     description: iMX6 Rex Project
+  "^rfdigital,.*":
+    description: RF Digital Corporation
   "^richtek,.*":
     description: Richtek Technology Corporation
   "^ricoh,.*":
-- 
2.43.0
Re: [PATCH 1/3] dt-bindings: iio: proximity: Add YAML binding for RFD77402 ToF sensor
Posted by Krzysztof Kozlowski 5 days, 13 hours ago
On Wed, Nov 26, 2025 at 08:44:38AM +0530, Shrikant Raskar wrote:
> The RFD77402 driver has existed without a formal device tree binding
> description. With the recent addition of Device Tree support and
> interrupt handling in the driver, it is now necessary to document
> the DT properties used for configuring the device.

This is all irrelevant here. It does not matter for the bindings if the
driver existed or not.

Please rather document here the hardware.

A nit, subject: drop second/last, redundant "YAML binding for". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
For sure don't use "YAML binding" - there is no such thing.

> 
> Since the binding introduces the compatible string "rfdigital,rfd77402",
> the "rfdigital" vendor prefix is also added to vendor-prefixes.yaml.

Also redundant, we can see the diff.

> 
> Signed-off-by: Shrikant Raskar <raskar.shree97@gmail.com>
> ---
>  .../iio/proximity/rfdigital,rfd77402.yaml     | 55 +++++++++++++++++++
>  .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
>  2 files changed, 57 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml
> 
> diff --git a/Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml b/Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml
> new file mode 100644
> index 000000000000..93deaa4e8b7a
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml
> @@ -0,0 +1,55 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/proximity/rfdigital,rfd77402.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: RF Digital RFD77402 ToF sensor
> +
> +maintainers:
> +  - Shrikant Raskar <raskar.shree97@gmail.com>
> +
> +description: |

Do not need '|' unless you need to preserve formatting.

> +  The RF Digital RFD77402 is a Time-of-Flight (ToF) proximity and distance
> +  sensor providing up to 200 mm range measurement over an I2C interface.
> +
> +properties:
> +  compatible:
> +    const: rfdigital,rfd77402
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +    description: |

Same, also a bit odd wrapping of the text below

> +      Generated by the device to announce that a new
> +      measurement data is ready in result register.
> +
> +  vdd-supply:
> +    description: Regulator that provides power to the sensor
> +
> +  vddio-supply:
> +    description: Regulator providing I/O interface voltage
> +
> +required:
> +  - compatible
> +  - reg

supplies should be required, devices rarely work without power. If you
think hardware works without power, this is something unusual thus you
should explain it in the commit msg.

> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        proximity@4c {
> +            compatible = "rfdigital,rfd77402";
> +            reg = <0x4c>;
> +            interrupt-parent = <&gpio>;
> +            interrupts = <4 IRQ_TYPE_EDGE_FALLING>;

Supplies

Best regards,
Krzysztof
Re: [PATCH 1/3] dt-bindings: iio: proximity: Add YAML binding for RFD77402 ToF sensor
Posted by Shrikant 5 days, 5 hours ago
On Wed, Nov 26, 2025 at 3:23 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Wed, Nov 26, 2025 at 08:44:38AM +0530, Shrikant Raskar wrote:
> > The RFD77402 driver has existed without a formal device tree binding
> > description. With the recent addition of Device Tree support and
> > interrupt handling in the driver, it is now necessary to document
> > the DT properties used for configuring the device.
>
> This is all irrelevant here. It does not matter for the bindings if the
> driver existed or not.
>
> Please rather document here the hardware.
>
> A nit, subject: drop second/last, redundant "YAML binding for". The
> "dt-bindings" prefix is already stating that these are bindings.
> See also:
> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
> For sure don't use "YAML binding" - there is no such thing.
>
> >
> > Since the binding introduces the compatible string "rfdigital,rfd77402",
> > the "rfdigital" vendor prefix is also added to vendor-prefixes.yaml.
>
> Also redundant, we can see the diff.
>
> >
> > Signed-off-by: Shrikant Raskar <raskar.shree97@gmail.com>
> > ---
> >  .../iio/proximity/rfdigital,rfd77402.yaml     | 55 +++++++++++++++++++
> >  .../devicetree/bindings/vendor-prefixes.yaml  |  2 +
> >  2 files changed, 57 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml b/Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml
> > new file mode 100644
> > index 000000000000..93deaa4e8b7a
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/proximity/rfdigital,rfd77402.yaml
> > @@ -0,0 +1,55 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/iio/proximity/rfdigital,rfd77402.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: RF Digital RFD77402 ToF sensor
> > +
> > +maintainers:
> > +  - Shrikant Raskar <raskar.shree97@gmail.com>
> > +
> > +description: |
>
> Do not need '|' unless you need to preserve formatting.
>
> > +  The RF Digital RFD77402 is a Time-of-Flight (ToF) proximity and distance
> > +  sensor providing up to 200 mm range measurement over an I2C interface.
> > +
> > +properties:
> > +  compatible:
> > +    const: rfdigital,rfd77402
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +    description: |
>
> Same, also a bit odd wrapping of the text below
>
> > +      Generated by the device to announce that a new
> > +      measurement data is ready in result register.
> > +
> > +  vdd-supply:
> > +    description: Regulator that provides power to the sensor
> > +
> > +  vddio-supply:
> > +    description: Regulator providing I/O interface voltage
> > +
> > +required:
> > +  - compatible
> > +  - reg
>
> supplies should be required, devices rarely work without power. If you
> think hardware works without power, this is something unusual thus you
> should explain it in the commit msg.
>
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        proximity@4c {
> > +            compatible = "rfdigital,rfd77402";
> > +            reg = <0x4c>;
> > +            interrupt-parent = <&gpio>;
> > +            interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
>
> Supplies
Thank you for reviewing the patch. I will update the dt-binding as
per the feedback and will share the v2 of the patch.

Regards,
Shrikant