Skip to content

Commit ebd457d

Browse files
nytowljic23
authored andcommitted
iio: light: vcnl4000 add devicetree hooks
Add an of_match table for devicetree probing. Signed-off-by: Angus Ainslie (Purism) <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 78ed050 commit ebd457d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

drivers/iio/light/vcnl4000.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,31 @@ static int vcnl4000_probe(struct i2c_client *client,
363363
return devm_iio_device_register(&client->dev, indio_dev);
364364
}
365365

366+
static const struct of_device_id vcnl_4000_of_match[] = {
367+
{
368+
.compatible = "vishay,vcnl4000",
369+
.data = "VCNL4000",
370+
},
371+
{
372+
.compatible = "vishay,vcnl4010",
373+
.data = "VCNL4010",
374+
},
375+
{
376+
.compatible = "vishay,vcnl4010",
377+
.data = "VCNL4020",
378+
},
379+
{
380+
.compatible = "vishay,vcnl4200",
381+
.data = "VCNL4200",
382+
},
383+
{},
384+
};
385+
MODULE_DEVICE_TABLE(of, vcnl_4000_of_match);
386+
366387
static struct i2c_driver vcnl4000_driver = {
367388
.driver = {
368389
.name = VCNL4000_DRV_NAME,
390+
.of_match_table = vcnl_4000_of_match,
369391
},
370392
.probe = vcnl4000_probe,
371393
.id_table = vcnl4000_id,

0 commit comments

Comments
 (0)