diff options
| author | Vidhu Sarwal <vidhu.linux@gmail.com> | 2026-09-28 19:54:50 +0530 |
|---|---|---|
| committer | Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> | 2026-11-02 00:39:02 +0000 |
| commit | 0a570feeca37d85fbfd6b4f6e3d9f33e1461c634 (patch) | |
| tree | 343ebd957c4b3badc51f3cba300d6d51e6759bd6 /tools/perf/scripts/python | |
| parent | dff701806ab6252f6a0fccba880c47cd09602625 (diff) | |
iio: humidity: am2315: fix negative temperature decoding
The AM2315/AM2320 report temperature as a sign-magnitude value,
with bit 15 as the sign and bits 14-0 as the magnitude.
am2315_read_data() stores the raw value directly in an s16, causing
negative temperatures to be interpreted as two's complement. Both the
read_raw and the triggered buffer paths are affected.
Decode the sign bit before storing the temperature value. Positive
readings are unaffected.
Fixes: 366a3270c1c5 ("iio: humidity: Add support for AM2315")
Signed-off-by: Vidhu Sarwal <vidhu.linux@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
