+8
−4
Loading
Fix temperature channel not working due to gain and offset not being initialized. For channels other than the voltage ones calibration is skipped (which is OK). However that results in the calibration register values tracked in st->channels[i].cfg all being zero. These zeros are later written to hardware before a measurement is made which caused the raw temperature readings to be always 8388608 (0x800000). To fix it, we just make sure the gain and offset values are set to the default values and still return early without doing an internal calibration. While here, add a comment explaining why we don't bother calibrating the temperature channel. Fixes: 47036a03 ("iio: adc: ad7124: Implement internal calibration at probe time") Reviewed-by:Marcelo Schmitt <marcelo.schmitt@analog.com> Signed-off-by:
David Lechner <dlechner@baylibre.com> Reviewed-by:
Uwe Kleine-König <u.kleine-koenig@baylibre.com> Cc: <Stable@vger.kernel.org> Signed-off-by:
Jonathan Cameron <Jonathan.Cameron@huawei.com>