iio: mma8452: add support for oversampling ratio
authorMartin Kepplinger <martink@posteo.de>
Mon, 25 Apr 2016 12:08:25 +0000 (14:08 +0200)
committerJonathan Cameron <jic23@kernel.org>
Wed, 4 May 2016 10:46:39 +0000 (11:46 +0100)
commited859fc17d67f4c0ade6f5a58365e621f88de3cf
treefe48dab9c9e9d23e26e719606fe0a8f30ef04971
parent6994aea7842d824a8cc38c950ddcab3f8a75c278
iio: mma8452: add support for oversampling ratio

This adds the following sysfs files according to the iio ABI:

-rw-r--r--    4096 in_accel_oversampling_ratio
-r--r--r--    4096 in_accel_oversampling_ratio_available

Internally, the device knows about 4 different power modes that differ
in oversampling ratio (and power consumption). We just show the user
what oversampling ratio(s) is/are available, depending on the current
frequency.

The referenced table in the datasheets makes it easier to understand.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/accel/mma8452.c