linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RFC: integration time, tsl45315
@ 2013-07-07 21:25 Peter Meerwald
  2013-07-09 18:12 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Meerwald @ 2013-07-07 21:25 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron

Hello,

I'm trying to address the review comment regarding the proposed tsl45315 
driver, http://permalink.gmane.org/gmane.linux.kernel.iio/7535

the following drivers make use of integration time: tsl2x7x, tsl2583 
(staging) and adjd_s311 (mainline), tsl45315 (proposed)

integration time is documented in staging/iio/Documentation/sysfs-bus-iio-light: 
What:		/sys/bus/iio/devices/device[n]/in_illuminance0_integration_time
KernelVersion:	2.6.37
Contact:	linux-iio@vger.kernel.org
Description:
		This property gets/sets the sensors ADC analog integration time.

this doesn't reveal much information


tsl2x7x says possible values are ".00272 - .696" -- I suppose seconds
tsl2583 wants values in "50 100 150 200 250 300 350 400 450 500 550 600 
650" -- I suppose milliseconds
adjd_s311's datasheet talks about integration time slots -- whatever that 
is
tsl45315 allows "400, 200, 100" milliseconds integration time by
setting a register to 0, 1, 2


so use of integration time is not consistent and the documentation is 
about as precise as it can get

I think integration_time should specify that the value is milliseconds 
(what to do with fractions of milliseconds?)
I think integration_time is better than just a scale factor since the 
time gives a hint how often the sensor can be polled in a meaningful way

so what to do?
for the tsl45315 I'd just go with _integration_time with milliseconds...

thanks, regards, p.

-- 

Peter Meerwald
+43-664-2444418 (mobile)

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

* Re: RFC: integration time, tsl45315
  2013-07-07 21:25 RFC: integration time, tsl45315 Peter Meerwald
@ 2013-07-09 18:12 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2013-07-09 18:12 UTC (permalink / raw)
  To: Peter Meerwald; +Cc: linux-iio, Jon Brenner - TAOS

On 07/07/2013 10:25 PM, Peter Meerwald wrote:
> Hello,
> 
> I'm trying to address the review comment regarding the proposed tsl45315 
> driver, http://permalink.gmane.org/gmane.linux.kernel.iio/7535
> 
> the following drivers make use of integration time: tsl2x7x, tsl2583 
> (staging) and adjd_s311 (mainline), tsl45315 (proposed)
> 
> integration time is documented in staging/iio/Documentation/sysfs-bus-iio-light: 
> What:		/sys/bus/iio/devices/device[n]/in_illuminance0_integration_time
> KernelVersion:	2.6.37
> Contact:	linux-iio@vger.kernel.org
> Description:
> 		This property gets/sets the sensors ADC analog integration time.
> 
> this doesn't reveal much information
> 
> 
> tsl2x7x says possible values are ".00272 - .696" -- I suppose seconds
> tsl2583 wants values in "50 100 150 200 250 300 350 400 450 500 550 600 
> 650" -- I suppose milliseconds
> adjd_s311's datasheet talks about integration time slots -- whatever that 
> is
> tsl45315 allows "400, 200, 100" milliseconds integration time by
> setting a register to 0, 1, 2
> 
> 
> so use of integration time is not consistent and the documentation is 
> about as precise as it can get
> 
> I think integration_time should specify that the value is milliseconds 
> (what to do with fractions of milliseconds?)

Ideally this would be in seconds and use the relevant return type to do
the decimal parts (in using as I'm about to suggest we add this to the
info_mask set of channel 'attributes'.)  Otherwise, 'floating point'
outputs are fine throughout IIO so lets use the base unit.  The only
time we don't do this (more or less) is when we are trying (perhaps foolishly)
to match hwmon units.

This is common enough that I'm beginning to think we want this in info_mask
rather than as an 'added bonus' to the abi.  What do others think?

> I think integration_time is better than just a scale factor since the 
> time gives a hint how often the sensor can be polled in a meaningful way
Agreed. That is the only reason I can see for explicitly exposing these.

> so what to do?
> for the tsl45315 I'd just go with _integration_time with milliseconds...
Fix them all up ;)  The adjd_s311 is the only one out of staging so we'll need
some input from you on that...  Jon, do you mind this change to the TAOS parts?

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

end of thread, other threads:[~2013-07-09 18:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-07 21:25 RFC: integration time, tsl45315 Peter Meerwald
2013-07-09 18:12 ` 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).