From: Christian Eggers <ceggers@arri.de>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
"Peter Meerwald-Stadler" <pmeerw@pmeerw.net>,
<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Christian Eggers <ceggers@arri.de>
Subject: [PATCH] iio: light: as73211: Increase measurement timeout
Date: Wed, 9 Sep 2020 17:44:39 +0200 [thread overview]
Message-ID: <20200909154439.10308-1-ceggers@arri.de> (raw)
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>
---
drivers/iio/light/as73211.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/light/as73211.c b/drivers/iio/light/as73211.c
index 25e5c386d678..457bf7f4b1f4 100644
--- a/drivers/iio/light/as73211.c
+++ b/drivers/iio/light/as73211.c
@@ -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) {
--
Christian Eggers
Embedded software developer
Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRA 57918
Persoenlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
Sitz: Muenchen - Registergericht: Amtsgericht Muenchen - Handelsregisternummer: HRB 54477
Geschaeftsfuehrer: Dr. Michael Neuhaeuser; Stephan Schenk; Walter Trauninger; Markus Zeiler
next reply other threads:[~2020-09-09 15:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 15:44 Christian Eggers [this message]
2020-09-09 16:58 ` [PATCH] iio: light: as73211: Increase measurement timeout Andy Shevchenko
2020-09-09 18:04 ` Christian Eggers
2020-09-13 9:39 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200909154439.10308-1-ceggers@arri.de \
--to=ceggers@arri.de \
--cc=andy.shevchenko@gmail.com \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).