[PATCH v2 2/4] iio: proximity: rfd77402: Add Device Tree support

Shrikant Raskar posted 4 patches 1 day, 7 hours ago
[PATCH v2 2/4] iio: proximity: rfd77402: Add Device Tree support
Posted by Shrikant Raskar 1 day, 6 hours ago
This patch enables seamless integration of the RFD77402 ToF sensor
on platforms that use Device Tree for hardware description.

Signed-off-by: Shrikant Raskar <raskar.shree97@gmail.com>
---
Changelog:
Changes since v1:
- Add period at the end of commit message.

Link to v1:https://lore.kernel.org/all/20251126031440.30065-3-raskar.shree97@gmail.com/
---
 drivers/iio/proximity/rfd77402.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/iio/proximity/rfd77402.c b/drivers/iio/proximity/rfd77402.c
index aff60a3c1a6f..3262af6f6882 100644
--- a/drivers/iio/proximity/rfd77402.c
+++ b/drivers/iio/proximity/rfd77402.c
@@ -313,10 +313,17 @@ static const struct i2c_device_id rfd77402_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, rfd77402_id);
 
+static const struct of_device_id rfd77402_of_match[] = {
+	{ .compatible = "rfdigital,rfd77402" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, rfd77402_of_match);
+
 static struct i2c_driver rfd77402_driver = {
 	.driver = {
 		.name   = RFD77402_DRV_NAME,
 		.pm     = pm_sleep_ptr(&rfd77402_pm_ops),
+		.of_match_table = rfd77402_of_match,
 	},
 	.probe = rfd77402_probe,
 	.id_table = rfd77402_id,
-- 
2.43.0
Re: [PATCH v2 2/4] iio: proximity: rfd77402: Add Device Tree support
Posted by Andy Shevchenko 1 day, 5 hours ago
On Sun, Nov 30, 2025 at 5:37 PM Shrikant Raskar
<raskar.shree97@gmail.com> wrote:
>
> This patch enables seamless integration of the RFD77402 ToF sensor

The Submitting Patch document suggests using imperative mode.

> on platforms that use Device Tree for hardware description.

The Subject is a bit misleading. This doesn't add a DT support (in
full meaning of it), this just adds an ID for enumeration via DT.

-- 
With Best Regards,
Andy Shevchenko