Skip to content
Commit 827dca31 authored by Dimitri Fedrau's avatar Dimitri Fedrau Committed by Jonathan Cameron
Browse files

iio: temperature: mcp9600: Fix temperature reading for negative values

Temperature is stored as 16bit value in two's complement format. Current
implementation ignores the sign bit. Make it aware of the sign bit by
using sign_extend32.

Fixes: 3f6b9598

 ("iio: temperature: Add MCP9600 thermocouple EMF converter")
Signed-off-by: default avatarDimitri Fedrau <dima.fedrau@gmail.com>
Reviewed-by: default avatarMarcelo Schmitt <marcelo.schmitt1@gmail.com>
Tested-by: default avatarAndrew Hepp <andrew.hepp@ahepp.dev>
Link: https://lore.kernel.org/r/20240424185913.1177127-1-dima.fedrau@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 51fafb3c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment