Files
linux/drivers/hwmon
Fabio Baltieri 3c022c3888 hwmon: (ina2xx) Cast to s16 on shunt and current regs
commit c0214f9894 upstream.

All devices supported by ina2xx are bidirectional and report the
measured shunt voltage and power values as a signed 16 bit, but the
current driver implementation caches all registers as u16, leading
to an incorrect sign extension when reporting to userspace in
ina2xx_get_value().

This patch fixes the problem by casting the signed registers to s16.
Tested on an INA219.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 11:21:28 -07:00
..
2013-10-18 09:12:02 -07:00
2013-10-18 09:12:02 -07:00
2014-03-03 08:01:04 -08:00
2014-01-29 20:40:08 +01:00
2013-10-13 16:16:25 -07:00
2014-01-29 20:40:08 +01:00
2014-01-29 20:40:08 +01:00
2013-08-11 22:10:39 -07:00
2013-08-27 08:28:01 -07:00
2014-01-29 20:40:08 +01:00
2013-08-11 22:10:39 -07:00
2014-01-29 20:40:08 +01:00
2013-08-11 22:10:39 -07:00
2014-01-29 20:40:08 +01:00
2013-08-27 08:28:01 -07:00
2013-09-11 13:01:32 -07:00
2013-08-27 08:28:01 -07:00
2014-04-04 18:01:35 +02:00
2013-10-18 09:12:01 -07:00
2013-03-18 21:19:49 +01:00
2014-01-29 20:40:08 +01:00
2014-01-29 20:40:08 +01:00
2013-08-11 22:10:39 -07:00
2012-11-28 11:50:34 -08:00
2014-01-29 20:40:08 +01:00
2013-08-11 22:10:39 -07:00
2014-01-29 20:40:08 +01:00
2014-01-29 20:40:08 +01:00
2013-08-11 22:10:39 -07:00
2012-11-28 11:49:40 -08:00
2012-11-28 11:49:40 -08:00
2012-11-28 11:50:34 -08:00
2013-09-11 13:01:41 -07:00
2012-11-28 11:50:34 -08:00
2014-01-29 20:40:08 +01:00
2013-10-18 09:12:02 -07:00
2014-01-29 20:40:08 +01:00
2012-11-28 11:50:34 -08:00
2012-11-28 11:50:34 -08:00