hwmon: (pmbus/max31785) Add delay between bus accesses
authorLakshmi Yadlapati <lakshmiy@us.ibm.com>
Fri, 27 Oct 2023 04:43:46 +0000 (23:43 -0500)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 28 Oct 2023 16:22:03 +0000 (09:22 -0700)
commit205e0c0577faec05f5a9b92349cfd3454f2b00ec
treea8ede931f3c51189f93c457f1dfb1a30075b7866
parent2358151bfb304aedda44348384557c161151bf57
hwmon: (pmbus/max31785) Add delay between bus accesses

The MAX31785 has shown erratic behaviour across multiple system
designs, unexpectedly clock stretching and NAKing transactions.

Experimentation shows that this seems to be triggered by a register access
directly back to back with a previous register write. Experimentation also
shows that inserting a small delay after register writes makes the issue go
away.

Use a similar solution to what the max15301 driver does to solve the same
problem. Create a custom set of bus read and write functions that make sure
that the delay is added.

Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
Link: https://lore.kernel.org/r/20231027044346.2167548-1-lakshmiy@us.ibm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/max31785.c