]> git.itanic.dy.fi Git - linux-stable/commit
hwmon: (mr75203) fix multi-channel voltage reading
authorEliav Farber <farbere@amazon.com>
Thu, 8 Sep 2022 15:24:33 +0000 (15:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 08:47:19 +0000 (10:47 +0200)
commitad460e86ad864023a6e1d4f67bf51caceb66d1f9
tree9d9adba67f21f2e089a08bacaa311dc558186292
parent7055f297801f645b6c2d6997dbda005f0ccacbd4
hwmon: (mr75203) fix multi-channel voltage reading

[ Upstream commit 91a9e063cdcfca8fe642b078d6fae4ce49187975 ]

Fix voltage allocation and reading to support all channels in all VMs.
Prior to this change allocation and reading were done only for the first
channel in each VM.
This change counts the total number of channels for allocation, and takes
into account the channel offset when reading the sample data register.

Fixes: 9d823351a337 ("hwmon: Add hardware monitoring driver for Moortec MR75203 PVT controller")
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-6-farbere@amazon.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/mr75203.c