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)
committerJonathan Cameron <jic23@kernel.org>
Sun, 29 May 2016 14:48:54 +0000 (15:48 +0100)
commitd43a41152f8e9e4c0d19850884d1fada076dee10
tree777f99636f04437df85119a9283020e382b4ca1f
parent37b1ba2c68cfbe37f5f45bb91bcfaf2b016ae6a1
iio:st_pressure: fix sampling gains (bring inline with ABI)

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>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/pressure/st_pressure_core.c