]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4af443f9a35a39f973c2fd8322fc5b2ae498031f
tree777f99636f04437df85119a9283020e382b4ca1f
parenteece7b9bffdf5cf9275604d85364dd05977f3d4a
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