From cfb0884c6f941977db1e0ce53ac659a8428e4e48 Mon Sep 17 00:00:00 2001 From: Titus Rwantare Date: Mon, 23 Oct 2023 23:46:40 +0000 Subject: hw/i2c: pmbus add support for block receive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PMBus devices can send and receive variable length data using the block read and write format, with the first byte in the payload denoting the length. This is mostly used for strings and on-device logs. Devices can respond to a block read with an empty string. Reviewed-by: Hao Wu Acked-by: Corey Minyard Signed-off-by: Titus Rwantare Message-ID: <20231023-staging-pmbus-v3-v4-1-07a8cb7cd20a@google.com> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/i2c/pmbus_device.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/hw/i2c/pmbus_device.h b/include/hw/i2c/pmbus_device.h index 93f5d57..7dc00cc 100644 --- a/include/hw/i2c/pmbus_device.h +++ b/include/hw/i2c/pmbus_device.h @@ -502,6 +502,13 @@ void pmbus_send64(PMBusDevice *state, uint64_t data); void pmbus_send_string(PMBusDevice *state, const char *data); /** + * @brief Receive data sent with Block Write. + * @param dest - memory with enough capacity to receive the write + * @param len - the capacity of dest + */ +uint8_t pmbus_receive_block(PMBusDevice *pmdev, uint8_t *dest, size_t len); + +/** * @brief Receive data over PMBus * These methods help track how much data is being received over PMBus * Log to GUEST_ERROR if too much or too little is sent. -- cgit v1.1