hwmon: (pmbus/bpa-rs600) Handle Vin readings >= 256V
authorChris Packham <chris.packham@alliedtelesis.co.nz>
Wed, 16 Jun 2021 03:42:18 +0000 (15:42 +1200)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 17 Jun 2021 11:21:25 +0000 (04:21 -0700)
commit6e9ef8ca687e69e9d4cc89033d98e06350b0f3e0
tree36606f32712c1b7371cf94b362d15e07814201e3
parent009c9aa5be652675a06d5211e1640e02bbb1c33d
hwmon: (pmbus/bpa-rs600) Handle Vin readings >= 256V

The BPA-RS600 doesn't follow the PMBus spec for linear data.
Specifically it treats the mantissa as an unsigned 11-bit value instead
of a two's complement 11-bit value. At this point it's unclear whether
this only affects Vin or if Pin/Pout1 are affected as well. Erring on
the side of caution only Vin is dealt with here.

Fixes: 15b2703e5e02 ("hwmon: (pmbus) Add driver for BluTek BPA-RS600")
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20210616034218.25821-1-chris.packham@alliedtelesis.co.nz
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/bpa-rs600.c