aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorTomas Novotny <tomas@novotny.cz>2018-07-25 17:18:19 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2018-07-29 09:41:53 +0100
commit50c50b975d566e9384c3ae84fc37a997ea18eedd (patch)
treec3e68cec88bf3918c4c7070009717ca4079fff57 /drivers/iio
parentiio: vcnl4000: make the driver extendable (diff)
downloadlinux-dev-50c50b975d566e9384c3ae84fc37a997ea18eedd.tar.xz
linux-dev-50c50b975d566e9384c3ae84fc37a997ea18eedd.zip
iio: vcnl4000: add VCNL4010 and VCNL4020 device id
The driver already supports VCNL4010/20 devices. The currently supported features and detectable product id are the same, so add shared id for them. This is a groundwork to extend the driver by detecting incorrectly specified device id. Signed-off-by: Tomas Novotny <tomas@novotny.cz> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/light/vcnl4000.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index 32c0b531395f..980eb3b77d5f 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -48,6 +48,7 @@
enum vcnl4000_device_ids {
VCNL4000,
+ VCNL4010,
};
struct vcnl4000_data {
@@ -68,6 +69,8 @@ struct vcnl4000_chip_spec {
static const struct i2c_device_id vcnl4000_id[] = {
{ "vcnl4000", VCNL4000 },
+ { "vcnl4010", VCNL4010 },
+ { "vcnl4020", VCNL4010 },
{ }
};
MODULE_DEVICE_TABLE(i2c, vcnl4000_id);
@@ -157,6 +160,12 @@ static const struct vcnl4000_chip_spec vcnl4000_chip_spec_cfg[] = {
.measure_light = vcnl4000_measure_light,
.measure_proximity = vcnl4000_measure_proximity,
},
+ [VCNL4010] = {
+ .prod = "VCNL4010/4020",
+ .init = vcnl4000_init,
+ .measure_light = vcnl4000_measure_light,
+ .measure_proximity = vcnl4000_measure_proximity,
+ },
};
static const struct iio_chan_spec vcnl4000_channels[] = {