hw/i2c: pmbus: reset page register for out of range reads
authorTitus Rwantare <titusr@google.com>
Mon, 23 Oct 2023 23:46:47 +0000 (23:46 +0000)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 7 Nov 2023 12:08:49 +0000 (13:08 +0100)
commitff0511282d406150984de1aaaaad451da8ad3a1c
tree1ce565441b2eb830629affd790c16229fae9197c
parent84db503e7c260ace0cf7267379955bbae77e85a4
hw/i2c: pmbus: reset page register for out of range reads

The linux pmbus driver scans all possible pages and does not reset the
current page after the scan, making all future page reads fail as out of range
on devices with a single page.

This change resets out of range pages immediately on write.

Also added a qtest for simultaneous writes to all pages.

Reviewed-by: Hao Wu <wuhaotsh@google.com>
Signed-off-by: Titus Rwantare <titusr@google.com>
Message-ID: <20231023-staging-pmbus-v3-v4-8-07a8cb7cd20a@google.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/i2c/pmbus_device.c
tests/qtest/max34451-test.c