]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (ucd90320) Add minimum delay between bus accesses
authorLars-Peter Clausen <lars@metafoo.de>
Sun, 12 Mar 2023 16:03:12 +0000 (09:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:33:52 +0000 (13:33 +0100)
commitf467b3ffe87d20a490e435f36733fdeffab4a04b
treebd40d3dfad7c65c9e4866b04a464cd8cf849840b
parent7f377870c6a77d3e9a2b861b92185bcd9f3f60af
hwmon: (ucd90320) Add minimum delay between bus accesses

[ Upstream commit 8fd8713061c5bea9a2404d5434141e4065d9500f ]

When probing the ucd90320 access to some of the registers randomly fails.
Sometimes it NACKs a transfer, sometimes it returns just random data and
the PEC check fails.

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.

Fixes: 8c2d01088b85 ("hwmon: (pmbus/ucd9000) Add support for UCD90320 Power Sequencer")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20230312160312.2227405-1-lars@metafoo.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/pmbus/ucd9000.c