]> git.ipfire.org Git - thirdparty/linux.git/commit
hwmon: (pmbus/max31785) use access_delay for PMBus-mediated accesses
authorSanman Pradhan <psanman@juniper.net>
Sat, 21 Mar 2026 18:11:47 +0000 (18:11 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 31 Mar 2026 02:45:06 +0000 (19:45 -0700)
commit6be9b04ef3fff87bf329fecae4647196ffefc539
tree1c8edc03c3c323045d07e1cc774d0378d75da144
parentdc4acb718ed9b292aec93b91ae95d71e85705c72
hwmon: (pmbus/max31785) use access_delay for PMBus-mediated accesses

The MAX31785 driver currently uses driver-local wrappers around PMBus
core accesses to enforce a 250us inter-access delay needed to work
around occasional NACKs from the device. This duplicates the PMBus
core delay mechanism already provided by pmbus_driver_info.access_delay
and adds unnecessary complexity.

Replace the PMBus wrapper approach with access_delay for normal
PMBus-mediated accesses, while keeping the minimal local delay handling
needed for raw pre-probe SMBus operations.

For the raw i2c_transfer() long-read path, use pmbus_wait() and
pmbus_update_ts() to keep the PMBus core timing state consistent with
the raw transfer.

Also:
- allow PMBUS_FAN_CONFIG_12 physical-page accesses to fall back to the
  PMBus core, while remapping only virtual pages
- use pmbus_update_fan() directly for fan configuration updates
- use the delayed raw read helper for MFR_REVISION during probe
- add a final max31785_wait() before pmbus_do_probe() to bridge the
  timing gap between pre-probe accesses and PMBus core registration
- rename 'virtual' to 'vpage', 'driver_data' to 'data', and drop the
  unused to_max31785_data() macro

Signed-off-by: Sanman Pradhan <psanman@juniper.net>
Link: https://lore.kernel.org/r/20260321181052.27129-3-sanman.pradhan@hpe.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/max31785.c