diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2016-10-25 21:20:10 +0200 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-11-01 18:49:53 +0000 |
commit | b0d801985418e0890adf14398373b9c4470911d1 (patch) | |
tree | 4ad29590110b2feaa9ef09d5e3fd6fcdaee0ebfd /drivers/iio | |
parent | d1c67534123d088289fa847809ba1a6fa11b1932 (diff) |
iio: si7020: Add devicetree support and trivial bindings
This adds devicetree support for the si7020 iio driver. Since it works
well without requiring any additional property, its compatible string is
added to the trivial i2c devices bindings list.
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/humidity/si7020.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/iio/humidity/si7020.c b/drivers/iio/humidity/si7020.c index ffc2ccf6374e..345a7656c5ef 100644 --- a/drivers/iio/humidity/si7020.c +++ b/drivers/iio/humidity/si7020.c @@ -154,8 +154,17 @@ static const struct i2c_device_id si7020_id[] = { }; MODULE_DEVICE_TABLE(i2c, si7020_id); +static const struct of_device_id si7020_dt_ids[] = { + { .compatible = "silabs,si7020" }, + { } +}; +MODULE_DEVICE_TABLE(of, si7020_dt_ids); + static struct i2c_driver si7020_driver = { - .driver.name = "si7020", + .driver = { + .name = "si7020", + .of_match_table = of_match_ptr(si7020_dt_ids), + }, .probe = si7020_probe, .id_table = si7020_id, }; |