[PATCH 0/5] hw/i2c: PMBus updates

Titus Rwantare posted 5 patches 2 weeks, 5 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260706230056.1888992-1-titusr@google.com
Maintainers: Titus Rwantare <titusr@google.com>, Corey Minyard <cminyard@mvista.com>, Tyrone Ting <kfting@nuvoton.com>, Hao Wu <wuhaotsh@google.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
hw/i2c/pmbus_device.c         | 61 +++++++++++++++++++++++++++++++++
hw/i2c/smbus_slave.c          |  4 +--
include/hw/i2c/pmbus_device.h | 64 +++++++++++++++++++++++++++++++++++
include/hw/i2c/smbus_slave.h  |  2 +-
include/qemu/osdep.h          | 14 ++++++++
tests/qtest/adm1266-test.c    | 10 +++---
6 files changed, 148 insertions(+), 7 deletions(-)
[PATCH 0/5] hw/i2c: PMBus updates
Posted by Titus Rwantare 2 weeks, 5 days ago
This series adds various fixes to PMBus and SMBus support.

The maximum SMBus data length is increased to 257 bytes, (payload is 255 bytes) to support SMBus 3.0 block transfers. SMBus devices don’t have to report their specification version, and this change allows us to enable newer PMBus devices that are based on top of SMBus 3.0.

Additionally, this series:
  - Adds the `DIV_ROUND_CLOSEST` helper macro, lifted from the linux implementation, to match the rounding in linux drivers.
  - Adds PMBus helper functions to convert sensor values in milliunits to/from linear mode format (Linear16).
  - Adds helper functions for converting data to PMBus Linear11 format.
  - Adds a fix that the PMBus output buffer is cleared on new write transactions to prevent stale data reads, this resolves an issue with guests performing incomplete reads.

Changes to the adm1266 are in a separate patch series.

Titus Rwantare (3):
  osdep: add DIV_ROUND_CLOSEST
  hw/i2c: pmbus: add milliunits linear mode functions
  hw/i2c: pmbus: add Linear11 format helpers

titusr (2):
  hw/i2c: pmbus: clear output buffer on write
  hw/i2c: smbus: increase MAX_DATA_LEN

 hw/i2c/pmbus_device.c         | 61 +++++++++++++++++++++++++++++++++
 hw/i2c/smbus_slave.c          |  4 +--
 include/hw/i2c/pmbus_device.h | 64 +++++++++++++++++++++++++++++++++++
 include/hw/i2c/smbus_slave.h  |  2 +-
 include/qemu/osdep.h          | 14 ++++++++
 tests/qtest/adm1266-test.c    | 10 +++---
 6 files changed, 148 insertions(+), 7 deletions(-)

-- 
2.55.0.rc2.803.g1fd1e6609c-goog