linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: light: as73211: Increase measurement timeout
@ 2020-09-09 15:44 Christian Eggers
  2020-09-09 16:58 ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Eggers @ 2020-09-09 15:44 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Andy Shevchenko, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-kernel,
	Christian Eggers

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: light: as73211: Increase measurement timeout
  2020-09-09 15:44 [PATCH] iio: light: as73211: Increase measurement timeout Christian Eggers
@ 2020-09-09 16:58 ` Andy Shevchenko
  2020-09-09 18:04   ` Christian Eggers
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2020-09-09 16:58 UTC (permalink / raw)
  To: Christian Eggers
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, Linux Kernel Mailing List

On Wed, Sep 9, 2020 at 6:45 PM Christian Eggers <ceggers@arri.de> wrote:
>
> 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.

I'm wondering if this is a function of temperature.
And if that has an actual thermistor inside...

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: light: as73211: Increase measurement timeout
  2020-09-09 16:58 ` Andy Shevchenko
@ 2020-09-09 18:04   ` Christian Eggers
  2020-09-13  9:39     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Eggers @ 2020-09-09 18:04 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, Linux Kernel Mailing List

On Wednesday, 9 September 2020, 18:58:39 CEST, Andy Shevchenko wrote:
> On Wed, Sep 9, 2020 at 6:45 PM Christian Eggers <ceggers@arri.de> wrote:
> > 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.
> 
> I'm wondering if this is a function of temperature.
> And if that has an actual thermistor inside...
 I haven't designed the hardware, but I guess that clock generation is done 
using an RC oscillator which depends on temperature. Temperature measurement 
is possible, but I think the recommended way is to externally control the 
integration time using the SYN pin and to get the actual number of RC cycles 
from a register. But generating the required waveform for the SYN pin using a 
uC general purpose timer seems challenging.

I wouldn't be surprised if the measurement results also depend on the exact 
value of the supply voltage.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iio: light: as73211: Increase measurement timeout
  2020-09-09 18:04   ` Christian Eggers
@ 2020-09-13  9:39     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2020-09-13  9:39 UTC (permalink / raw)
  To: Christian Eggers
  Cc: Andy Shevchenko, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, Linux Kernel Mailing List

On Wed, 9 Sep 2020 20:04:24 +0200
Christian Eggers <ceggers@arri.de> wrote:

> On Wednesday, 9 September 2020, 18:58:39 CEST, Andy Shevchenko wrote:
> > On Wed, Sep 9, 2020 at 6:45 PM Christian Eggers <ceggers@arri.de> wrote:  
> > > 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.  
> >
> > I'm wondering if this is a function of temperature.
> > And if that has an actual thermistor inside...  
>  I haven't designed the hardware, but I guess that clock generation is done
> using an RC oscillator which depends on temperature. Temperature measurement
> is possible, but I think the recommended way is to externally control the
> integration time using the SYN pin and to get the actual number of RC cycles
> from a register. But generating the required waveform for the SYN pin using a
> uC general purpose timer seems challenging.
> 
> I wouldn't be surprised if the measurement results also depend on the exact
> value of the supply voltage.
Applied to the togreg branch of iio.git and added a fixes tag to the patch
that introduced the driver.  Note, please try to provide me with one of those
even if the patch hasn't yet gotten into mainline.  It makes life a little
easier for the stable maintainers etc.  I don't always remember to add one
at point of applying the patch.

Thanks,

Jonathan

> 
> 
> ________________________________
>  [http://assets.arri.com/media/sign/2020-04-03-E-mail-signature-Stellar2_V1.jpg] <https://microsites.arri.com/stellar/>
> 
> Get all the latest information from www.arri.com<https://www.arri.com/>, Facebook<https://www.facebook.com/TeamARRI>, Twitter<https://twitter.com/ARRIChannel>, Instagram<https://instagram.com/arri> and YouTube<https://www.youtube.com/user/ARRIChannel>.
> 
> Arnold & Richter Cine Technik GmbH & Co. Betriebs KG
> Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRA 57918
> Persönlich haftender Gesellschafter: Arnold & Richter Cine Technik GmbH
> Sitz: München - Registergericht: Amtsgericht München - Handelsregisternummer: HRB 54477
> Geschäftsführer: Dr. Michael Neuhäuser; Stephan Schenk; Walter Trauninger; Markus Zeiler


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-13  9:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09 15:44 [PATCH] iio: light: as73211: Increase measurement timeout Christian Eggers
2020-09-09 16:58 ` Andy Shevchenko
2020-09-09 18:04   ` Christian Eggers
2020-09-13  9:39     ` Jonathan Cameron

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).