The scale would result in uV instead of expected mV.
Mostly cosmetic, since the value of 'Power' was computed OK.
Signed-off-by: Marc Titinger <marc.titinger@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
The user (or an init script) may setup RShunt via sysfs after the
driver was initialized, for instance based on the EEPROM contents
of a modular probe. The calibration register must be set accordingly.
Signed-off-by: Marc Titinger <marc.titinger@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
These are generally for devlopment use only, remove these
from performance-critical code, convert to dev_dbg elswhere.
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Group of probably overly rigorous whitespace and code cleanups.
- Alphabetize includes
- Assign to variables in the order they are defined
- Alignment issues
- Group alike statements together
- Use helper macros
Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This was extracted from a reposting of the driver after it had been applied
to the IIO tree. I have fast tracked it as the driver will be in 4.5 and
it would be nice to fix this trivial issue before it is.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
POWER and CURRENT were swapped out in the buffer:
was current2 and power3, correct order is power2 and current3.
Signed-off-by: Marc Titinger <mtitinger@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Different probe modules use different resistor values. The front-end
application may read a probe ID (from eeprom) and set the shunt value
accordingly.
Signed-off-by: Marc Titinger <mtitinger@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This can lead to repeated or skipped samples depending on the clock beat
between the capture thread and the chip sampling clock, but will also spare
reading/waiting for the Capture Ready Flag and improve the available i2c
bandwidth for reading measurements.
Output of iio_info:
...snip...
4 device-specific attributes found:
attr 0: in_oversampling_ratio value: 4
attr 1: in_allow_async_readout value: 0
attr 2: integration_time_available value: 140 204 332 588 1100 2116...
attr 3: in_sampling_frequency value: 114
Signed-off-by: Marc Titinger <mtitinger@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
in SOFTWARE buffer mode, a kthread will capture the active scan_elements
into a kfifo, then compute the remaining time until the next capture tick
and do an active wait (udelay).
This will produce a stream of up to fours channels plus a 64bits
timestamps (ns).
Tested with ina226, on BeagleBoneBlack.
Datasheet: http://www.ti.com/lit/gpn/ina226
Signed-off-by: Marc Titinger <mtitinger@baylibre.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>