Skip to content

Commit 2ca5a87

Browse files
stoupa-czjic23
authored andcommitted
iio: light: vcnl4000: update sampling periods for vcnl4040
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. Although the application note is related to vcnl4200, according to support the vcnl4040's "ASIC is quite similar to that one for the VCNL4200". So update the sampling periods (and comment), including the correct sampling period for proximity. Both sampling periods are lower. Users relying on the blocking behaviour of reading will get proximity measurements much earlier. Fixes: 5a441aa ("iio: light: vcnl4000 add support for the VCNL4040 proximity and light sensor") Reviewed-by: Guido Günther <[email protected]> Tested-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 b42aa97 commit 2ca5a87

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/iio/light/vcnl4000.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,10 @@ static int vcnl4200_init(struct vcnl4000_data *data)
174174
data->al_scale = 24000;
175175
break;
176176
case VCNL4040_PROD_ID:
177-
/* Integration time is 80ms, add 10ms. */
178-
data->vcnl4200_al.sampling_rate = ktime_set(0, 100000 * 1000);
179-
data->vcnl4200_ps.sampling_rate = ktime_set(0, 100000 * 1000);
177+
/* Default wait time is 80ms, add 20% tolerance. */
178+
data->vcnl4200_al.sampling_rate = ktime_set(0, 96000 * 1000);
179+
/* Default wait time is 5ms, add 20% tolerance. */
180+
data->vcnl4200_ps.sampling_rate = ktime_set(0, 6000 * 1000);
180181
data->al_scale = 120000;
181182
break;
182183
}

0 commit comments

Comments
 (0)