1 // SPDX-License-Identifier: GPL-2.0+
3 * VEML6030 Ambient Light Sensor
5 * Copyright (c) 2019, Rishi Gupta <gupt21@gmail.com>
7 * Datasheet: https://www.vishay.com/docs/84366/veml6030.pdf
8 * Appnote-84367: https://www.vishay.com/docs/84367/designingveml6030.pdf
11 #include <linux/module.h>
12 #include <linux/i2c.h>
13 #include <linux/err.h>
14 #include <linux/regmap.h>
15 #include <linux/interrupt.h>
16 #include <linux/pm_runtime.h>
17 #include <linux/iio/iio.h>
18 #include <linux/iio/sysfs.h>
19 #include <linux/iio/events.h>
21 /* Device registers */
22 #define VEML6030_REG_ALS_CONF 0x00
23 #define VEML6030_REG_ALS_WH 0x01
24 #define VEML6030_REG_ALS_WL 0x02
25 #define VEML6030_REG_ALS_PSM 0x03
26 #define VEML6030_REG_ALS_DATA 0x04
27 #define VEML6030_REG_WH_DATA 0x05
28 #define VEML6030_REG_ALS_INT 0x06
30 /* Bit masks for specific functionality */
31 #define VEML6030_ALS_IT GENMASK(9, 6)
32 #define VEML6030_PSM GENMASK(2, 1)
33 #define VEML6030_ALS_PERS GENMASK(5, 4)
34 #define VEML6030_ALS_GAIN GENMASK(12, 11)
35 #define VEML6030_PSM_EN BIT(0)
36 #define VEML6030_INT_TH_LOW BIT(15)
37 #define VEML6030_INT_TH_HIGH BIT(14)
38 #define VEML6030_ALS_INT_EN BIT(1)
39 #define VEML6030_ALS_SD BIT(0)
42 * The resolution depends on both gain and integration time. The
43 * cur_resolution stores one of the resolution mentioned in the
44 * table during startup and gets updated whenever integration time
47 * Table 'resolution and maximum detection range' in appnote 84367
48 * is visualized as a 2D array. The cur_gain stores index of gain
49 * in this table (0-3) while the cur_integration_time holds index
50 * of integration time (0-5).
52 struct veml6030_data
{
53 struct i2c_client
*client
;
54 struct regmap
*regmap
;
57 int cur_integration_time
;
60 /* Integration time available in seconds */
61 static IIO_CONST_ATTR(in_illuminance_integration_time_available
,
62 "0.025 0.05 0.1 0.2 0.4 0.8");
65 * Scale is 1/gain. Value 0.125 is ALS gain x (1/8), 0.25 is
66 * ALS gain x (1/4), 1.0 = ALS gain x 1 and 2.0 is ALS gain x 2.
68 static IIO_CONST_ATTR(in_illuminance_scale_available
,
69 "0.125 0.25 1.0 2.0");
71 static struct attribute
*veml6030_attributes
[] = {
72 &iio_const_attr_in_illuminance_integration_time_available
.dev_attr
.attr
,
73 &iio_const_attr_in_illuminance_scale_available
.dev_attr
.attr
,
77 static const struct attribute_group veml6030_attr_group
= {
78 .attrs
= veml6030_attributes
,
82 * Persistence = 1/2/4/8 x integration time
83 * Minimum time for which light readings must stay above configured
84 * threshold to assert the interrupt.
86 static const char * const period_values
[] = {
96 * Return list of valid period values in seconds corresponding to
97 * the currently active integration time.
99 static ssize_t
in_illuminance_period_available_show(struct device
*dev
,
100 struct device_attribute
*attr
, char *buf
)
103 struct iio_dev
*indio_dev
= i2c_get_clientdata(to_i2c_client(dev
));
104 struct veml6030_data
*data
= iio_priv(indio_dev
);
106 ret
= regmap_read(data
->regmap
, VEML6030_REG_ALS_CONF
, ®
);
108 dev_err(&data
->client
->dev
,
109 "can't read als conf register %d\n", ret
);
113 ret
= ((reg
>> 6) & 0xF);
131 return snprintf(buf
, PAGE_SIZE
, "%s\n", period_values
[x
]);
134 static IIO_DEVICE_ATTR_RO(in_illuminance_period_available
, 0);
136 static struct attribute
*veml6030_event_attributes
[] = {
137 &iio_dev_attr_in_illuminance_period_available
.dev_attr
.attr
,
141 static const struct attribute_group veml6030_event_attr_group
= {
142 .attrs
= veml6030_event_attributes
,
145 static int veml6030_als_pwr_on(struct veml6030_data
*data
)
147 return regmap_update_bits(data
->regmap
, VEML6030_REG_ALS_CONF
,
151 static int veml6030_als_shut_down(struct veml6030_data
*data
)
153 return regmap_update_bits(data
->regmap
, VEML6030_REG_ALS_CONF
,
157 static void veml6030_als_shut_down_action(void *data
)
159 veml6030_als_shut_down(data
);
162 static const struct iio_event_spec veml6030_event_spec
[] = {
164 .type
= IIO_EV_TYPE_THRESH
,
165 .dir
= IIO_EV_DIR_RISING
,
166 .mask_separate
= BIT(IIO_EV_INFO_VALUE
),
168 .type
= IIO_EV_TYPE_THRESH
,
169 .dir
= IIO_EV_DIR_FALLING
,
170 .mask_separate
= BIT(IIO_EV_INFO_VALUE
),
172 .type
= IIO_EV_TYPE_THRESH
,
173 .dir
= IIO_EV_DIR_EITHER
,
174 .mask_separate
= BIT(IIO_EV_INFO_PERIOD
) |
175 BIT(IIO_EV_INFO_ENABLE
),
185 static const struct iio_chan_spec veml6030_channels
[] = {
189 .info_mask_separate
= BIT(IIO_CHAN_INFO_RAW
) |
190 BIT(IIO_CHAN_INFO_PROCESSED
) |
191 BIT(IIO_CHAN_INFO_INT_TIME
) |
192 BIT(IIO_CHAN_INFO_SCALE
),
193 .event_spec
= veml6030_event_spec
,
194 .num_event_specs
= ARRAY_SIZE(veml6030_event_spec
),
197 .type
= IIO_INTENSITY
,
200 .channel2
= IIO_MOD_LIGHT_BOTH
,
201 .info_mask_separate
= BIT(IIO_CHAN_INFO_RAW
) |
202 BIT(IIO_CHAN_INFO_PROCESSED
),
206 static const struct regmap_config veml6030_regmap_config
= {
207 .name
= "veml6030_regmap",
210 .max_register
= VEML6030_REG_ALS_INT
,
211 .val_format_endian
= REGMAP_ENDIAN_LITTLE
,
214 static int veml6030_get_intgrn_tm(struct iio_dev
*indio_dev
,
218 struct veml6030_data
*data
= iio_priv(indio_dev
);
220 ret
= regmap_read(data
->regmap
, VEML6030_REG_ALS_CONF
, ®
);
222 dev_err(&data
->client
->dev
,
223 "can't read als conf register %d\n", ret
);
227 switch ((reg
>> 6) & 0xF) {
251 return IIO_VAL_INT_PLUS_MICRO
;
254 static int veml6030_set_intgrn_tm(struct iio_dev
*indio_dev
,
257 int ret
, new_int_time
, int_idx
;
258 struct veml6030_data
*data
= iio_priv(indio_dev
);
265 new_int_time
= 0x300;
269 new_int_time
= 0x200;
292 ret
= regmap_update_bits(data
->regmap
, VEML6030_REG_ALS_CONF
,
293 VEML6030_ALS_IT
, new_int_time
);
295 dev_err(&data
->client
->dev
,
296 "can't update als integration time %d\n", ret
);
301 * Cache current integration time and update resolution. For every
302 * increase in integration time to next level, resolution is halved
305 if (data
->cur_integration_time
< int_idx
)
306 data
->cur_resolution
<<= int_idx
- data
->cur_integration_time
;
307 else if (data
->cur_integration_time
> int_idx
)
308 data
->cur_resolution
>>= data
->cur_integration_time
- int_idx
;
310 data
->cur_integration_time
= int_idx
;
315 static int veml6030_read_persistence(struct iio_dev
*indio_dev
,
318 int ret
, reg
, period
, x
, y
;
319 struct veml6030_data
*data
= iio_priv(indio_dev
);
321 ret
= veml6030_get_intgrn_tm(indio_dev
, &x
, &y
);
325 ret
= regmap_read(data
->regmap
, VEML6030_REG_ALS_CONF
, ®
);
327 dev_err(&data
->client
->dev
,
328 "can't read als conf register %d\n", ret
);
331 /* integration time multiplied by 1/2/4/8 */
332 period
= y
* (1 << ((reg
>> 4) & 0x03));
334 *val
= period
/ 1000000;
335 *val2
= period
% 1000000;
337 return IIO_VAL_INT_PLUS_MICRO
;
340 static int veml6030_write_persistence(struct iio_dev
*indio_dev
,
343 int ret
, period
, x
, y
;
344 struct veml6030_data
*data
= iio_priv(indio_dev
);
346 ret
= veml6030_get_intgrn_tm(indio_dev
, &x
, &y
);
353 if ((val
== 1) && (val2
== 600000))
354 period
= 1600000 / y
;
355 else if ((val
== 3) && (val2
== 200000))
356 period
= 3200000 / y
;
357 else if ((val
== 6) && (val2
== 400000))
358 period
= 6400000 / y
;
363 if (period
<= 0 || period
> 8 || hweight8(period
) != 1)
366 ret
= regmap_update_bits(data
->regmap
, VEML6030_REG_ALS_CONF
,
367 VEML6030_ALS_PERS
, (ffs(period
) - 1) << 4);
369 dev_err(&data
->client
->dev
,
370 "can't set persistence value %d\n", ret
);
375 static int veml6030_set_als_gain(struct iio_dev
*indio_dev
,
378 int ret
, new_gain
, gain_idx
;
379 struct veml6030_data
*data
= iio_priv(indio_dev
);
381 if (val
== 0 && val2
== 125000) {
382 new_gain
= 0x1000; /* 0x02 << 11 */
384 } else if (val
== 0 && val2
== 250000) {
387 } else if (val
== 1 && val2
== 0) {
390 } else if (val
== 2 && val2
== 0) {
397 ret
= regmap_update_bits(data
->regmap
, VEML6030_REG_ALS_CONF
,
398 VEML6030_ALS_GAIN
, new_gain
);
400 dev_err(&data
->client
->dev
,
401 "can't set als gain %d\n", ret
);
406 * Cache currently set gain & update resolution. For every
407 * increase in the gain to next level, resolution is halved
410 if (data
->cur_gain
< gain_idx
)
411 data
->cur_resolution
<<= gain_idx
- data
->cur_gain
;
412 else if (data
->cur_gain
> gain_idx
)
413 data
->cur_resolution
>>= data
->cur_gain
- gain_idx
;
415 data
->cur_gain
= gain_idx
;
420 static int veml6030_get_als_gain(struct iio_dev
*indio_dev
,
424 struct veml6030_data
*data
= iio_priv(indio_dev
);
426 ret
= regmap_read(data
->regmap
, VEML6030_REG_ALS_CONF
, ®
);
428 dev_err(&data
->client
->dev
,
429 "can't read als conf register %d\n", ret
);
433 switch ((reg
>> 11) & 0x03) {
454 return IIO_VAL_INT_PLUS_MICRO
;
457 static int veml6030_read_thresh(struct iio_dev
*indio_dev
,
458 int *val
, int *val2
, int dir
)
461 struct veml6030_data
*data
= iio_priv(indio_dev
);
463 if (dir
== IIO_EV_DIR_RISING
)
464 ret
= regmap_read(data
->regmap
, VEML6030_REG_ALS_WH
, ®
);
466 ret
= regmap_read(data
->regmap
, VEML6030_REG_ALS_WL
, ®
);
468 dev_err(&data
->client
->dev
,
469 "can't read als threshold value %d\n", ret
);
477 static int veml6030_write_thresh(struct iio_dev
*indio_dev
,
478 int val
, int val2
, int dir
)
481 struct veml6030_data
*data
= iio_priv(indio_dev
);
483 if (val
> 0xFFFF || val
< 0 || val2
)
486 if (dir
== IIO_EV_DIR_RISING
) {
487 ret
= regmap_write(data
->regmap
, VEML6030_REG_ALS_WH
, val
);
489 dev_err(&data
->client
->dev
,
490 "can't set high threshold %d\n", ret
);
492 ret
= regmap_write(data
->regmap
, VEML6030_REG_ALS_WL
, val
);
494 dev_err(&data
->client
->dev
,
495 "can't set low threshold %d\n", ret
);
502 * Provide both raw as well as light reading in lux.
503 * light (in lux) = resolution * raw reading
505 static int veml6030_read_raw(struct iio_dev
*indio_dev
,
506 struct iio_chan_spec
const *chan
, int *val
,
507 int *val2
, long mask
)
510 struct veml6030_data
*data
= iio_priv(indio_dev
);
511 struct regmap
*regmap
= data
->regmap
;
512 struct device
*dev
= &data
->client
->dev
;
515 case IIO_CHAN_INFO_RAW
:
516 case IIO_CHAN_INFO_PROCESSED
:
517 switch (chan
->type
) {
519 ret
= regmap_read(regmap
, VEML6030_REG_ALS_DATA
, ®
);
521 dev_err(dev
, "can't read als data %d\n", ret
);
524 if (mask
== IIO_CHAN_INFO_PROCESSED
) {
525 *val
= (reg
* data
->cur_resolution
) / 10000;
526 *val2
= (reg
* data
->cur_resolution
) % 10000;
527 return IIO_VAL_INT_PLUS_MICRO
;
532 ret
= regmap_read(regmap
, VEML6030_REG_WH_DATA
, ®
);
534 dev_err(dev
, "can't read white data %d\n", ret
);
537 if (mask
== IIO_CHAN_INFO_PROCESSED
) {
538 *val
= (reg
* data
->cur_resolution
) / 10000;
539 *val2
= (reg
* data
->cur_resolution
) % 10000;
540 return IIO_VAL_INT_PLUS_MICRO
;
547 case IIO_CHAN_INFO_INT_TIME
:
548 if (chan
->type
== IIO_LIGHT
)
549 return veml6030_get_intgrn_tm(indio_dev
, val
, val2
);
551 case IIO_CHAN_INFO_SCALE
:
552 if (chan
->type
== IIO_LIGHT
)
553 return veml6030_get_als_gain(indio_dev
, val
, val2
);
560 static int veml6030_write_raw(struct iio_dev
*indio_dev
,
561 struct iio_chan_spec
const *chan
,
562 int val
, int val2
, long mask
)
565 case IIO_CHAN_INFO_INT_TIME
:
566 switch (chan
->type
) {
568 return veml6030_set_intgrn_tm(indio_dev
, val
, val2
);
572 case IIO_CHAN_INFO_SCALE
:
573 switch (chan
->type
) {
575 return veml6030_set_als_gain(indio_dev
, val
, val2
);
584 static int veml6030_read_event_val(struct iio_dev
*indio_dev
,
585 const struct iio_chan_spec
*chan
, enum iio_event_type type
,
586 enum iio_event_direction dir
, enum iio_event_info info
,
590 case IIO_EV_INFO_VALUE
:
592 case IIO_EV_DIR_RISING
:
593 case IIO_EV_DIR_FALLING
:
594 return veml6030_read_thresh(indio_dev
, val
, val2
, dir
);
599 case IIO_EV_INFO_PERIOD
:
600 return veml6030_read_persistence(indio_dev
, val
, val2
);
606 static int veml6030_write_event_val(struct iio_dev
*indio_dev
,
607 const struct iio_chan_spec
*chan
, enum iio_event_type type
,
608 enum iio_event_direction dir
, enum iio_event_info info
,
612 case IIO_EV_INFO_VALUE
:
613 return veml6030_write_thresh(indio_dev
, val
, val2
, dir
);
614 case IIO_EV_INFO_PERIOD
:
615 return veml6030_write_persistence(indio_dev
, val
, val2
);
621 static int veml6030_read_interrupt_config(struct iio_dev
*indio_dev
,
622 const struct iio_chan_spec
*chan
, enum iio_event_type type
,
623 enum iio_event_direction dir
)
626 struct veml6030_data
*data
= iio_priv(indio_dev
);
628 ret
= regmap_read(data
->regmap
, VEML6030_REG_ALS_CONF
, ®
);
630 dev_err(&data
->client
->dev
,
631 "can't read als conf register %d\n", ret
);
635 if (reg
& VEML6030_ALS_INT_EN
)
642 * Sensor should not be measuring light when interrupt is configured.
643 * Therefore correct sequence to configure interrupt functionality is:
644 * shut down -> enable/disable interrupt -> power on
646 * state = 1 enables interrupt, state = 0 disables interrupt
648 static int veml6030_write_interrupt_config(struct iio_dev
*indio_dev
,
649 const struct iio_chan_spec
*chan
, enum iio_event_type type
,
650 enum iio_event_direction dir
, int state
)
653 struct veml6030_data
*data
= iio_priv(indio_dev
);
655 if (state
< 0 || state
> 1)
658 ret
= veml6030_als_shut_down(data
);
660 dev_err(&data
->client
->dev
,
661 "can't disable als to configure interrupt %d\n", ret
);
665 /* enable interrupt + power on */
666 ret
= regmap_update_bits(data
->regmap
, VEML6030_REG_ALS_CONF
,
667 VEML6030_ALS_INT_EN
| VEML6030_ALS_SD
, state
<< 1);
669 dev_err(&data
->client
->dev
,
670 "can't enable interrupt & poweron als %d\n", ret
);
675 static const struct iio_info veml6030_info
= {
676 .read_raw
= veml6030_read_raw
,
677 .write_raw
= veml6030_write_raw
,
678 .read_event_value
= veml6030_read_event_val
,
679 .write_event_value
= veml6030_write_event_val
,
680 .read_event_config
= veml6030_read_interrupt_config
,
681 .write_event_config
= veml6030_write_interrupt_config
,
682 .attrs
= &veml6030_attr_group
,
683 .event_attrs
= &veml6030_event_attr_group
,
686 static const struct iio_info veml6030_info_no_irq
= {
687 .read_raw
= veml6030_read_raw
,
688 .write_raw
= veml6030_write_raw
,
689 .attrs
= &veml6030_attr_group
,
692 static irqreturn_t
veml6030_event_handler(int irq
, void *private)
694 int ret
, reg
, evtdir
;
695 struct iio_dev
*indio_dev
= private;
696 struct veml6030_data
*data
= iio_priv(indio_dev
);
698 ret
= regmap_read(data
->regmap
, VEML6030_REG_ALS_INT
, ®
);
700 dev_err(&data
->client
->dev
,
701 "can't read als interrupt register %d\n", ret
);
705 /* Spurious interrupt handling */
706 if (!(reg
& (VEML6030_INT_TH_HIGH
| VEML6030_INT_TH_LOW
)))
709 if (reg
& VEML6030_INT_TH_HIGH
)
710 evtdir
= IIO_EV_DIR_RISING
;
712 evtdir
= IIO_EV_DIR_FALLING
;
714 iio_push_event(indio_dev
, IIO_UNMOD_EVENT_CODE(IIO_INTENSITY
,
715 0, IIO_EV_TYPE_THRESH
, evtdir
),
716 iio_get_time_ns(indio_dev
));
722 * Set ALS gain to 1/8, integration time to 100 ms, PSM to mode 2,
723 * persistence to 1 x integration time and the threshold
724 * interrupt disabled by default. First shutdown the sensor,
725 * update registers and then power on the sensor.
727 static int veml6030_hw_init(struct iio_dev
*indio_dev
)
730 struct veml6030_data
*data
= iio_priv(indio_dev
);
731 struct i2c_client
*client
= data
->client
;
733 ret
= veml6030_als_shut_down(data
);
735 dev_err(&client
->dev
, "can't shutdown als %d\n", ret
);
739 ret
= regmap_write(data
->regmap
, VEML6030_REG_ALS_CONF
, 0x1001);
741 dev_err(&client
->dev
, "can't setup als configs %d\n", ret
);
745 ret
= regmap_update_bits(data
->regmap
, VEML6030_REG_ALS_PSM
,
746 VEML6030_PSM
| VEML6030_PSM_EN
, 0x03);
748 dev_err(&client
->dev
, "can't setup default PSM %d\n", ret
);
752 ret
= regmap_write(data
->regmap
, VEML6030_REG_ALS_WH
, 0xFFFF);
754 dev_err(&client
->dev
, "can't setup high threshold %d\n", ret
);
758 ret
= regmap_write(data
->regmap
, VEML6030_REG_ALS_WL
, 0x0000);
760 dev_err(&client
->dev
, "can't setup low threshold %d\n", ret
);
764 ret
= veml6030_als_pwr_on(data
);
766 dev_err(&client
->dev
, "can't poweron als %d\n", ret
);
770 /* Wait 4 ms to let processor & oscillator start correctly */
771 usleep_range(4000, 4002);
773 /* Clear stale interrupt status bits if any during start */
774 ret
= regmap_read(data
->regmap
, VEML6030_REG_ALS_INT
, &val
);
776 dev_err(&client
->dev
,
777 "can't clear als interrupt status %d\n", ret
);
781 /* Cache currently active measurement parameters */
783 data
->cur_resolution
= 4608;
784 data
->cur_integration_time
= 3;
789 static int veml6030_probe(struct i2c_client
*client
,
790 const struct i2c_device_id
*id
)
793 struct veml6030_data
*data
;
794 struct iio_dev
*indio_dev
;
795 struct regmap
*regmap
;
797 if (!i2c_check_functionality(client
->adapter
, I2C_FUNC_I2C
)) {
798 dev_err(&client
->dev
, "i2c adapter doesn't support plain i2c\n");
802 regmap
= devm_regmap_init_i2c(client
, &veml6030_regmap_config
);
803 if (IS_ERR(regmap
)) {
804 dev_err(&client
->dev
, "can't setup regmap\n");
805 return PTR_ERR(regmap
);
808 indio_dev
= devm_iio_device_alloc(&client
->dev
, sizeof(*data
));
812 data
= iio_priv(indio_dev
);
813 i2c_set_clientdata(client
, indio_dev
);
814 data
->client
= client
;
815 data
->regmap
= regmap
;
817 indio_dev
->dev
.parent
= &client
->dev
;
818 indio_dev
->name
= "veml6030";
819 indio_dev
->channels
= veml6030_channels
;
820 indio_dev
->num_channels
= ARRAY_SIZE(veml6030_channels
);
821 indio_dev
->modes
= INDIO_DIRECT_MODE
;
824 ret
= devm_request_threaded_irq(&client
->dev
, client
->irq
,
825 NULL
, veml6030_event_handler
,
826 IRQF_TRIGGER_LOW
| IRQF_ONESHOT
,
827 "veml6030", indio_dev
);
829 dev_err(&client
->dev
,
830 "irq %d request failed\n", client
->irq
);
833 indio_dev
->info
= &veml6030_info
;
835 indio_dev
->info
= &veml6030_info_no_irq
;
838 ret
= veml6030_hw_init(indio_dev
);
842 ret
= devm_add_action_or_reset(&client
->dev
,
843 veml6030_als_shut_down_action
, data
);
847 return devm_iio_device_register(&client
->dev
, indio_dev
);
850 static int __maybe_unused
veml6030_runtime_suspend(struct device
*dev
)
853 struct iio_dev
*indio_dev
= i2c_get_clientdata(to_i2c_client(dev
));
854 struct veml6030_data
*data
= iio_priv(indio_dev
);
856 ret
= veml6030_als_shut_down(data
);
858 dev_err(&data
->client
->dev
, "can't suspend als %d\n", ret
);
863 static int __maybe_unused
veml6030_runtime_resume(struct device
*dev
)
866 struct iio_dev
*indio_dev
= i2c_get_clientdata(to_i2c_client(dev
));
867 struct veml6030_data
*data
= iio_priv(indio_dev
);
869 ret
= veml6030_als_pwr_on(data
);
871 dev_err(&data
->client
->dev
, "can't resume als %d\n", ret
);
876 static const struct dev_pm_ops veml6030_pm_ops
= {
877 SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend
,
878 pm_runtime_force_resume
)
879 SET_RUNTIME_PM_OPS(veml6030_runtime_suspend
,
880 veml6030_runtime_resume
, NULL
)
883 static const struct of_device_id veml6030_of_match
[] = {
884 { .compatible
= "vishay,veml6030" },
887 MODULE_DEVICE_TABLE(of
, veml6030_of_match
);
889 static const struct i2c_device_id veml6030_id
[] = {
893 MODULE_DEVICE_TABLE(i2c
, veml6030_id
);
895 static struct i2c_driver veml6030_driver
= {
898 .of_match_table
= veml6030_of_match
,
899 .pm
= &veml6030_pm_ops
,
901 .probe
= veml6030_probe
,
902 .id_table
= veml6030_id
,
904 module_i2c_driver(veml6030_driver
);
906 MODULE_AUTHOR("Rishi Gupta <gupt21@gmail.com>");
907 MODULE_DESCRIPTION("VEML6030 Ambient Light Sensor");
908 MODULE_LICENSE("GPL v2");