summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKryštof Černý <cleverline1mc@gmail.com>2026-06-12 09:55:07 +0200
committerKrzysztof Kozlowski <krzk@kernel.org>2026-06-29 11:33:07 +0200
commit53f33fd74d3993af0fbb5494b5be709f6ca6b712 (patch)
treebb597cced37000cc5384c1f7c3c4a5df8f692bcb
parentdc59e4fea9d83f03bad6bddf3fa2e52491777482 (diff)
downloadlinux-next-53f33fd74d3993af0fbb5494b5be709f6ca6b712.tar.gz
linux-next-53f33fd74d3993af0fbb5494b5be709f6ca6b712.zip
w1: ds2482: add OF device match table
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@gmail.com> Link: https://patch.msgid.link/20260612-w1-of-autoload-v1-1-74e8a17626e6@gmail.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
-rw-r--r--drivers/w1/masters/ds2482.c8
1 files changed, 8 insertions, 0 deletions
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,