mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
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>
This commit is contained in:
parent
dc59e4fea9
commit
53f33fd74d
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user