diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-11-20 14:36:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-11-20 22:26:39 +0100 |
commit | 6807d7211327dbdd8df3692f3d26ca711514ba71 (patch) | |
tree | 3654bb4d0d6b2d9afd6534b3907f924c3d5e069d /include | |
parent | iio: Add pressure channel type (diff) | |
download | linux-6807d7211327dbdd8df3692f3d26ca711514ba71.tar.xz linux-6807d7211327dbdd8df3692f3d26ca711514ba71.zip |
iio: Factor out fixed point number parsing into its own function
Factor out the code for parsing fixed point numbers into its own function and
make this function globally available. This allows us to reuse the code to parse
fixed point numbers in individual IIO drivers.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/iio/iio.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index adca93a999a7..da8c776ba0bd 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -620,6 +620,9 @@ static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) }; #endif +int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer, + int *fract); + /** * IIO_DEGREE_TO_RAD() - Convert degree to rad * @deg: A value in degree |