hwmon: (pmbus/adm1275) Prepare for protected write to PMON_CONFIG
authorGuenter Roeck <linux@roeck-us.net>
Wed, 14 Jun 2023 16:36:04 +0000 (09:36 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 22 Jun 2023 17:39:41 +0000 (10:39 -0700)
commit98ac8af4e7b2f260236cf468762450630e73eb67
tree61a9dfe9165aceaffd53f51d6b426669d7fa5718
parent37f665ffa886ce49d1baaca1c3501ce93713b77e
hwmon: (pmbus/adm1275) Prepare for protected write to PMON_CONFIG

According to ADI, changing PMON_CONFIG while ADC is running can have
unexpected results. ADI recommends halting the ADC with PMON_CONTROL
before setting PMON_CONFIG and then resume after.

To prepare for this change, rename adm1275_read_pmon_config()
and adm1275_write_pmon_config() to adm1275_read_samples() and
adm1275_write_samples() to more accurately reflect the functionality
of the code. Introduce new function adm1275_write_pmon_config()
and use it for all code writing into the PMON_CONFIG register.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230614163605.3688964-2-linux@roeck-us.net
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/adm1275.c