• Gregor Boirie's avatar
    iio:st_pressure: fix sampling gains (bring inline with ABI) · d43a4115
    Gregor Boirie authored
    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: default avatarGregor Boirie <gregor.boirie@parrot.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
    d43a4115
st_pressure_core.c 14.4 KB