diff options
author | Titus Rwantare <titusr@google.com> | 2023-10-23 23:46:46 +0000 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2023-11-07 13:08:49 +0100 |
commit | 84db503e7c260ace0cf7267379955bbae77e85a4 (patch) | |
tree | 3f26ff33c9055eb8da987e81fb6264d2480d1487 | |
parent | 5861f5abf408a4d9c03a827869bc42d2aae8976b (diff) | |
download | qemu-84db503e7c260ace0cf7267379955bbae77e85a4.zip qemu-84db503e7c260ace0cf7267379955bbae77e85a4.tar.gz qemu-84db503e7c260ace0cf7267379955bbae77e85a4.tar.bz2 |
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>
-rw-r--r-- | hw/i2c/pmbus_device.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c index 3bce39e..481e158 100644 --- a/hw/i2c/pmbus_device.c +++ b/hw/i2c/pmbus_device.c @@ -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; } |