Skip to content

Commit a2d80de

Browse files
Michael Steckleinjic23
authored andcommitted
iio: humidity: hdc100x: add match table and device id's
Add of_match_table and point it to a list of compatible device tree device id's. Signed-off-by: Michael Stecklein <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 8f4c957 commit a2d80de

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/iio/humidity/hdc100x.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,20 @@ static const struct i2c_device_id hdc100x_id[] = {
429429
};
430430
MODULE_DEVICE_TABLE(i2c, hdc100x_id);
431431

432+
static const struct of_device_id hdc100x_dt_ids[] = {
433+
{ .compatible = "ti,hdc1000" },
434+
{ .compatible = "ti,hdc1008" },
435+
{ .compatible = "ti,hdc1010" },
436+
{ .compatible = "ti,hdc1050" },
437+
{ .compatible = "ti,hdc1080" },
438+
{ }
439+
};
440+
MODULE_DEVICE_TABLE(of, hdc100x_dt_ids);
441+
432442
static struct i2c_driver hdc100x_driver = {
433443
.driver = {
434444
.name = "hdc100x",
445+
.of_match_table = of_match_ptr(hdc100x_dt_ids),
435446
},
436447
.probe = hdc100x_probe,
437448
.remove = hdc100x_remove,

0 commit comments

Comments
 (0)