]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hwmon: (sht15) Fix sht15_calc_temp interpolation function
authorJerome Oufella <jerome.oufella@savoirfairelinux.com>
Wed, 14 Apr 2010 14:14:07 +0000 (16:14 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Apr 2010 14:41:26 +0000 (07:41 -0700)
commit7fc829f5018cc20e12d25811d15a2d171225a7da
treec9ba81c9b56ebaf4724218763deceafd77bb5029
parent8b49768d5fd8f4365fd9de0151c3c4190e9aa4e3
hwmon: (sht15) Fix sht15_calc_temp interpolation function

commit 328a2c22abd08911e37fa66f1358f829cecd72e9 upstream.

I discovered two issues.
First the previous sht15_calc_temp() loop did not iterate through the
temppoints array since the (data->supply_uV > temppoints[i - 1].vdd)
test is always true in this direction.

Also the two-points linear interpolation function was returning biased
values due to a stray division by 1000 which shouldn't be there.

[JD: Also change the default value for d1 from 0 to something saner.]

Signed-off-by: Jerome Oufella <jerome.oufella@savoirfairelinux.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hwmon/sht15.c