Skip to content

Commit

Permalink
iio: light: vcnl4000 add devicetree hooks
Browse files Browse the repository at this point in the history
Add an of_match table for devicetree probing.

Signed-off-by: Angus Ainslie (Purism) <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
  • Loading branch information
nytowl authored and jic23 committed Apr 4, 2019
1 parent 78ed050 commit ebd457d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions drivers/iio/light/vcnl4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ebd457d

Please sign in to comment.