lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 4 Apr 2012 11:40:56 -0500
From:	"Jon Brenner" <jbrenner@...Sinc.com>
To:	<jic23@...nel.org>
Cc:	<linux-iio@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: tsl2x7x driver Sampling frequency

Jonathon,

You wrote;
<snip>
Units don't look right for sampling frequency.  Sorry, but that's an abi

issue so even if it is
fiddly to do the conversion to Hz it needs to be done.
</snip>

Need some help here.
In the tsl2x7x driver sampling frequency is being used for setting
"persistence register".
It's actually a H/W filter.
Here is an abstract from the data sheet:
--
Persistence Register (0x0C)
The persistence register controls the filtering interrupt capabilities
of the device. Configurable filtering is
provided to allow interrupts to be generated after each ADC integration
cycle or if the ADC integration has
produced a result that is outside of the values specified by threshold
register for some specified amount of time.
Separate filtering is provided for proximity and ALS functions. ALS
interrupts are generated using C0DATA.
--
The value provided here by the ABI is actually the number of
'consecutive values out of range'.

The H/W takes care of counting the consecutive values out of range and
issues and interrupt when reached.

The timing (or frequency) of these out of range values are based on the
ALS or Prox integration time (determined by that respective setting).
That being the case a fixed table of sampling "frequencies" cannot be
reasonably defined - as the frequency can vary widely, based on other
settings.

So the register really is set to the desired number of 'values out of
range'.  
To add another slight twist, the value (number of out of range)
increases by 1 until 5, then by 5 until 60 - with the caveat that a
value of 0 generates an interrupt every ALS or Prox integration cycle . 

Since the sysfs-bus-iio doc contained a close match with respect to the
operation:
Description:
		Some devices have internal clocks.  This parameter sets
the
		resulting sampling frequency.  In many devices this
		parameter has an effect on input filters etc rather than
		simply controlling when the input is sampled.  As this
		effects datardy triggers, hardware buffers and the sysfs
		direct access interfaces, it may be found in any of the
		relevant directories.  If it effects all of the above
		then it is to be found in the base device directory.

Thus we used "sampling_frequency" - but now I am wondering if it should
be something else. 

If this is better suited for a different ABI please tell me what that
would be. 

Please help!

Jon
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ