iio:st_pressure: fix sampling gains (bring inline with ABI)
authorGregor Boirie <gregor.boirie@parrot.com>
Tue, 19 Apr 2016 09:18:33 +0000 (11:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Jul 2016 16:47:36 +0000 (09:47 -0700)
commit923f209551914c4906fb78f4174470132ccf0947
treeaa94a2df0ec329b55940fc8629d7b79c86997d7e
parentdda5d00a2a7d988069f835bea9688be1ec1dd062
iio:st_pressure: fix sampling gains (bring inline with ABI)

commit d43a41152f8e9e4c0d19850884d1fada076dee10 upstream.

Temperature channels report scaled samples in Celsius although expected as
milli degree Celsius in Documentation/ABI/testing/sysfs-bus-iio.
Gains are not implemented at all for LPS001WP pressure and temperature
channels.

This patch ensures that proper offsets and scales are exposed to userpace
for both pressure and temperature channels.
Also fix a NULL pointer exception when userspace reads content of sysfs
scale attribute when gains are not defined.

Signed-off-by: Gregor Boirie <gregor.boirie@parrot.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/pressure/st_pressure_core.c