mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 06:43:53 -06:00
hw/i2c: pmbus: immediately clear faults on request
The probing process of the generic pmbus driver generates faults to determine if functions are available. These faults were not always cleared resulting in probe failures. Reviewed-by: Patrick Venture <venture@google.com> Signed-off-by: Titus Rwantare <titusr@google.com> Message-ID: <20231023-staging-pmbus-v3-v4-7-07a8cb7cd20a@google.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
5861f5abf4
commit
84db503e7c
1 changed files with 5 additions and 0 deletions
|
@ -1244,6 +1244,11 @@ static int pmbus_write_data(SMBusDevice *smd, uint8_t *buf, uint8_t len)
|
|||
pmdev->in_buf = buf;
|
||||
|
||||
pmdev->code = buf[0]; /* PMBus command code */
|
||||
|
||||
if (pmdev->code == PMBUS_CLEAR_FAULTS) {
|
||||
pmbus_clear_faults(pmdev);
|
||||
}
|
||||
|
||||
if (len == 1) { /* Single length writes are command codes only */
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue