iio: light: as73211: Increase measurement timeout
authorChristian Eggers <ceggers@arri.de>
Wed, 9 Sep 2020 15:44:39 +0000 (17:44 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 13 Sep 2020 09:37:46 +0000 (10:37 +0100)
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: 403e5586b52e ("iio: light: as73211: New driver")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/as73211.c

index b1178df..7b32dfa 100644 (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) {