]> www.infradead.org Git - users/dwmw2/qemu.git/commit
i2c: pm_smbus: Fix the semantics of block I2C transfers
authorCorey Minyard <cminyard@mvista.com>
Mon, 20 Aug 2018 20:26:02 +0000 (15:26 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Aug 2018 16:46:25 +0000 (18:46 +0200)
commit4b615be540d8566f4b981245b4d5401163c57ced
tree1e8c10900bbfb2d31909ad62c86909006abf1e5b
parentb8fb9043eb48ddc3dc80cf88def62ae0c7c57a69
i2c: pm_smbus: Fix the semantics of block I2C transfers

The I2C block transfer commands was not implemented correctly, it
read a length byte and such like it was an smbus transfer.

So fix the smbus_read_block() and smbus_write_block() functions
so they can properly handle I2C transfers, and normal SMBus
transfers (for upcoming changes).  Pass in a transfer size and
a bool to know whether to use the size byte (like SMBus) or use
the length given (like I2C).

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1534796770-10295-3-git-send-email-minyard@acm.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i2c/pm_smbus.c
hw/i2c/smbus.c
include/hw/i2c/smbus.h