mirror_ubuntu-kernels/include/linux/iio
Lars-Peter Clausen 7985e7c100 iio: Introduce a new fractional value type
Currently IIO uses a decimal fixed point representations for real type numbers.
This patch introduces a new representation for rational type numbers. The number
will be expressed by specifying a numerator and denominator. For converting a
raw value to a processed value multiply it by the numerator and divide it by the
denominator.

The reasoning for introducing this new type is that for a lot of devices the
scale can be represented easily by a fractional number, but it is not possible
to represent it as fixed point number without rounding.  E.g. for a simple DAC
the scale is often the reference voltage divided by the number of possible
values (Usually 2**n_bits - 1). Each driver currently implements the conversion
of this fraction to a fixed point number on its own.

Also when it comes to the in-kernel interface this allows to directly use the
fractional factors to convert a raw value to a processed value. This should on
one hand require less instructions and on the other hand increase the
precision.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-15 10:12:22 +01:00
..
adc iio:adc: Add common code for ADI Sigma Delta devices 2012-08-27 17:53:12 +01:00
dac iio: add mcp4725 I2C DAC driver 2012-06-12 14:50:51 -07:00
frequency iio: frequency: ADF4350: Fix potential reference div factor overflow. 2012-08-16 20:24:33 +01:00
buffer.h iio: Drop timestamp parameter from buffer store_to callback 2012-09-08 10:14:34 +01:00
consumer.h iio:consumer.h: Fix include guard 2012-08-27 18:27:08 +01:00
driver.h
events.h iio: iio/events.h typos 2012-06-15 14:39:19 -07:00
iio.h iio: core: Add hysteresis in channel spec 2012-09-06 19:04:45 +01:00
kfifo_buf.h iio: Add missing include guards to headers 2012-08-27 18:57:56 +01:00
machine.h iio: Add missing include guards to headers 2012-08-27 18:57:56 +01:00
sysfs.h iio: correct documentation for IIO_CONST_ATTR_SAMP_FREQ_AVAIL, match name of #define 2012-06-18 17:31:42 -07:00
trigger_consumer.h iio:trigger_consumer.h: Add missing includes and forward declarations 2012-08-27 18:57:59 +01:00
trigger.h iio: whitespace cleanup and removal of semicolon after functions 2012-09-03 20:26:43 +01:00
triggered_buffer.h iio: Add helper function for initializing triggered buffers 2012-06-18 17:26:09 -07:00
types.h iio: Introduce a new fractional value type 2012-09-15 10:12:22 +01:00