Skip to content

Commit 50c50b9

Browse files
stoupa-czjic23
authored andcommitted
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 <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 1ebc787 commit 50c50b9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/iio/light/vcnl4000.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
enum vcnl4000_device_ids {
5050
VCNL4000,
51+
VCNL4010,
5152
};
5253

5354
struct vcnl4000_data {
@@ -68,6 +69,8 @@ struct vcnl4000_chip_spec {
6869

6970
static const struct i2c_device_id vcnl4000_id[] = {
7071
{ "vcnl4000", VCNL4000 },
72+
{ "vcnl4010", VCNL4010 },
73+
{ "vcnl4020", VCNL4010 },
7174
{ }
7275
};
7376
MODULE_DEVICE_TABLE(i2c, vcnl4000_id);
@@ -157,6 +160,12 @@ static const struct vcnl4000_chip_spec vcnl4000_chip_spec_cfg[] = {
157160
.measure_light = vcnl4000_measure_light,
158161
.measure_proximity = vcnl4000_measure_proximity,
159162
},
163+
[VCNL4010] = {
164+
.prod = "VCNL4010/4020",
165+
.init = vcnl4000_init,
166+
.measure_light = vcnl4000_measure_light,
167+
.measure_proximity = vcnl4000_measure_proximity,
168+
},
160169
};
161170

162171
static const struct iio_chan_spec vcnl4000_channels[] = {

0 commit comments

Comments
 (0)