Skip to content

Commit

Permalink
iio: humidity: hdc100x: add match table and device id's
Browse files Browse the repository at this point in the history
Add of_match_table and point it to a list of compatible device tree
device id's.

Signed-off-by: Michael Stecklein <m-stecklein@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Michael Stecklein authored and Jonathan Cameron committed Jul 1, 2017
1 parent 8f4c957 commit a2d80de
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/iio/humidity/hdc100x.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,20 @@ static const struct i2c_device_id hdc100x_id[] = {
};
MODULE_DEVICE_TABLE(i2c, hdc100x_id);

static const struct of_device_id hdc100x_dt_ids[] = {
{ .compatible = "ti,hdc1000" },
{ .compatible = "ti,hdc1008" },
{ .compatible = "ti,hdc1010" },
{ .compatible = "ti,hdc1050" },
{ .compatible = "ti,hdc1080" },
{ }
};
MODULE_DEVICE_TABLE(of, hdc100x_dt_ids);

static struct i2c_driver hdc100x_driver = {
.driver = {
.name = "hdc100x",
.of_match_table = of_match_ptr(hdc100x_dt_ids),
},
.probe = hdc100x_probe,
.remove = hdc100x_remove,
Expand Down

0 comments on commit a2d80de

Please sign in to comment.