iio: light: as73211: Increase measurement timeout

We found some sensors which are much slower (20% at room temperature)
than nominal. According to the data sheet, up to 27% is possible. Now I
add 33% to the nominal time out, hopefully this is enough.

Signed-off-by: Christian Eggers <ceggers@arri.de>
Link: https://lore.kernel.org/r/20200909154439.10308-1-ceggers@arri.de
Fixes: 403e5586b5 ("iio: light: as73211: New driver")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Christian Eggers 2020-09-09 17:44:39 +02:00 committed by Jonathan Cameron
parent dde8ceec9e
commit 23e0618ca0
1 changed files with 2 additions and 3 deletions

View File

@ -259,10 +259,9 @@ static int as73211_req_data(struct as73211_data *data)
data->osr &= ~AS73211_OSR_SS;
/*
* Add some extra margin for the timeout. sensor timing is not as precise
* as our one ...
* Add 33% extra margin for the timeout. fclk,min = fclk,typ - 27%.
*/
time_us += time_us / 8;
time_us += time_us / 3;
if (data->client->irq) {
ret = wait_for_completion_timeout(&data->completion, usecs_to_jiffies(time_us));
if (!ret) {