summaryrefslogtreecommitdiffstats
path: root/drivers/iio/light
diff options
context:
space:
mode:
authorAngus Ainslie (Purism) <angus@akkea.ca>2019-03-21 08:40:44 -0700
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2019-04-04 20:20:43 +0100
commitebd457d55911b5b5bc79404d460e1b72df806dea (patch)
tree2f310daa8abaad904d1ba2efee065c9137dcc7aa /drivers/iio/light
parent78ed050dd2962560d01ce8ee7b011bb7ccc3f502 (diff)
downloadlinux-ebd457d55911b5b5bc79404d460e1b72df806dea.tar.gz
linux-ebd457d55911b5b5bc79404d460e1b72df806dea.tar.bz2
linux-ebd457d55911b5b5bc79404d460e1b72df806dea.zip
iio: light: vcnl4000 add devicetree hooks
Add an of_match table for devicetree probing. Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/light')
-rw-r--r--drivers/iio/light/vcnl4000.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index 5e0a8eb83ebc..9ccb99c85ee9 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -363,9 +363,31 @@ static int vcnl4000_probe(struct i2c_client *client,
return devm_iio_device_register(&client->dev, indio_dev);
}
+static const struct of_device_id vcnl_4000_of_match[] = {
+ {
+ .compatible = "vishay,vcnl4000",
+ .data = "VCNL4000",
+ },
+ {
+ .compatible = "vishay,vcnl4010",
+ .data = "VCNL4010",
+ },
+ {
+ .compatible = "vishay,vcnl4010",
+ .data = "VCNL4020",
+ },
+ {
+ .compatible = "vishay,vcnl4200",
+ .data = "VCNL4200",
+ },
+ {},
+};
+MODULE_DEVICE_TABLE(of, vcnl_4000_of_match);
+
static struct i2c_driver vcnl4000_driver = {
.driver = {
.name = VCNL4000_DRV_NAME,
+ .of_match_table = vcnl_4000_of_match,
},
.probe = vcnl4000_probe,
.id_table = vcnl4000_id,