Re: [PATCH] hwmon: (ina2xx) Fix current value calculation

2018-11-14 Thread Guenter Roeck
On Tue, Nov 13, 2018 at 07:48:54PM -0800, Nicolin Chen wrote: > The current register (04h) has a sign bit at MSB. The comments > for this calculation also mention that it's a signed register. > > However, the regval is unsigned type so result of calculation > turns out to be an incorrect value

[PATCH] hwmon: (ina2xx) Fix current value calculation

2018-11-13 Thread Nicolin Chen
The current register (04h) has a sign bit at MSB. The comments for this calculation also mention that it's a signed register. However, the regval is unsigned type so result of calculation turns out to be an incorrect value when current is negative. This patch simply fixes this by adding a