Skip to content

Commit b42aa97

Browse files
stoupa-czjic23
authored andcommitted
iio: light: vcnl4000: update sampling periods for vcnl4200
Vishay has published a new version of "Designing the VCNL4200 Into an Application" application note in October 2019. The new version specifies that there is +-20% of part to part tolerance. This explains the drift seen during experiments. The proximity pulse width is also changed from 32us to 30us. According to the support, the tolerance also applies to ambient light. So update the sampling periods. As the reading is blocking, current users may notice slightly longer response time. Fixes: be38866 ("iio: vcnl4000: add support for VCNL4200") Reviewed-by: Guido Günther <[email protected]> Signed-off-by: Tomas Novotny <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent cb2116f commit b42aa97

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/iio/light/vcnl4000.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ static int vcnl4200_init(struct vcnl4000_data *data)
167167
data->vcnl4200_ps.reg = VCNL4200_PS_DATA;
168168
switch (id) {
169169
case VCNL4200_PROD_ID:
170-
/* Integration time is 50ms, but the experiments */
171-
/* show 54ms in total. */
172-
data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000);
173-
data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000);
170+
/* Default wait time is 50ms, add 20% tolerance. */
171+
data->vcnl4200_al.sampling_rate = ktime_set(0, 60000 * 1000);
172+
/* Default wait time is 4.8ms, add 20% tolerance. */
173+
data->vcnl4200_ps.sampling_rate = ktime_set(0, 5760 * 1000);
174174
data->al_scale = 24000;
175175
break;
176176
case VCNL4040_PROD_ID:

0 commit comments

Comments
 (0)