iio: Add a logarithmic fractional value type
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 16 Oct 2012 16:29:00 +0000 (17:29 +0100)
committerJonathan Cameron <jic23@kernel.org>
Fri, 19 Oct 2012 17:46:51 +0000 (18:46 +0100)
For ADCs or DACs the denominator for fractional types often is a power of two.
In this case we can use a shift operation instead of the rather expensive 64 bit
division. This patch adds a new fractional type which expects the denominator to
be specified as the log2 of the actual denominator. E.g. for ADCs and DACs this
will usually be the number of significant bits.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

No differences found