summaryrefslogtreecommitdiff
path: root/include/linux/iio/types.h
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-10-16 16:29:00 (GMT)
committerJonathan Cameron <jic23@kernel.org>2012-10-19 17:46:51 (GMT)
commit103d9fb907058e4eb052f4f7302d1b07eb6a7792 (patch)
tree8ab834da14137f068195eb30660ffdd19f41acdd /include/linux/iio/types.h
parent948ad20504894436c008c8a50f74e277edeff9a1 (diff)
downloadlinux-fsl-qoriq-103d9fb907058e4eb052f4f7302d1b07eb6a7792.tar.xz
iio: Add a logarithmic fractional value type
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>
Diffstat (limited to 'include/linux/iio/types.h')
-rw-r--r--include/linux/iio/types.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
index 5c647ec..87b196a 100644
--- a/include/linux/iio/types.h
+++ b/include/linux/iio/types.h
@@ -58,5 +58,6 @@ enum iio_modifier {
#define IIO_VAL_INT_PLUS_NANO 3
#define IIO_VAL_INT_PLUS_MICRO_DB 4
#define IIO_VAL_FRACTIONAL 10
+#define IIO_VAL_FRACTIONAL_LOG2 11
#endif /* _IIO_TYPES_H_ */