hwmon: (mr75203) add VM pre-scaler x2 support
authorEliav Farber <farbere@amazon.com>
Thu, 8 Sep 2022 15:24:42 +0000 (15:24 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 19 Sep 2022 13:17:06 +0000 (06:17 -0700)
commit430c0d7ff56b7e324eb36c490d513c0ef9c99860
tree23846145d571adfdf7131b320bb664cf483c3f5a
parent64a2486c392506fc14db843bbc5998d567f22c6f
hwmon: (mr75203) add VM pre-scaler x2 support

Add support for mr76006 pre-scaler which provides divide-by-2 scaling
of the input voltage, so that it can be  presented to the VM for
measurement within its range (the VM input range is limited from -0.1V
to 1V).

The driver reads from the device-tree all the channels that use the
mr76006 pre-scaler and multiplies the voltage result by a factor of 2,
to represent to the user with the actual voltage input source.

Channels that are not in the device-tree are multiplied by a factor
of 1.

Signed-off-by: Eliav Farber <farbere@amazon.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220908152449.35457-15-farbere@amazon.com
[groeck: Addressed conflicts against commit d59eacaac953]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/mr75203.c