[PATCH] w1: ds2482: add OF device match table

From: Kryštof Černý via B4 Relay

Date: Fri Jun 12 2026 - 03:59:48 EST


From: Kryštof Černý <cleverline1mc@xxxxxxxxx>

Add an of_device_id table and hook it into the i2c driver so the
ds2482/ds2484 can be matched and auto-probed from Device Tree.

This allows automatic module loading when instantiated via DT.

Signed-off-by: Kryštof Černý <cleverline1mc@xxxxxxxxx>
---
The ds2482 driver currently lacks an OF match table, which prevents
automatic driver binding and module autoload when the device is
described via Device Tree using compatible strings defined in the
binding.

Even with a correct "maxim,ds2482" compatible, the driver is not
matched because no of_device_id table is registered.

Add OF match support for ds2482/ds2484 and hook it into the i2c driver
to enable proper Device Tree based probing and autoloading.
---
drivers/w1/masters/ds2482.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c
index 0069e6f854d7..9e57c6e487d1 100644
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -545,9 +545,17 @@ static const struct i2c_device_id ds2482_id[] = {
};
MODULE_DEVICE_TABLE(i2c, ds2482_id);

+static const struct of_device_id ds2482_of_match[] = {
+ { .compatible = "maxim,ds2482", },
+ { .compatible = "maxim,ds2484", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, ds2482_of_match);
+
static struct i2c_driver ds2482_driver = {
.driver = {
.name = "ds2482",
+ .of_match_table = ds2482_of_match,
},
.probe = ds2482_probe,
.remove = ds2482_remove,

---
base-commit: 53371dcd31b8899d851a169cc2a432f62baa9d54
change-id: 20260611-w1-of-autoload-17e05bdc4eef

Best regards,
--
Kryštof Černý <cleverline1mc@xxxxxxxxx>