i2c:pm_smbus: Fix pm_smbus handling of I2C block read
commit52cc6a492b6c6e668f99e13d3cfad5caf7fbfd1c
authorCorey Minyard <cminyard@mvista.com>
Wed, 14 Nov 2018 20:41:01 +0000 (14 14:41 -0600)
committerCorey Minyard <cminyard@mvista.com>
Thu, 28 Feb 2019 03:06:08 +0000 (27 21:06 -0600)
treeff033e8f508dcf2b31fbd9107df569488ce51462
parent7fccf2a06890e3bc3b30e29827ad3fb93fe88fea
i2c:pm_smbus: Fix pm_smbus handling of I2C block read

The I2C block read function of pm_smbus was completely broken.  It
required doing some direct I2C handling because it didn't have a
defined size, the OS code just reads bytes until it marks the
transaction finished.

This also required adjusting how the AMIBIOS workaround code worked,
the I2C block mode was setting STS_HOST_BUSY during a transaction,
so that bit could no longer be used to inform the host status read
code to start the transaction.  Create a explicit bool for that
operation.

Also, don't read the next byte from the device in byte-by-byte
mode unless the OS is actually clearing the byte done bit.  Just
assuming that's what the OS is doing is a bad idea.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
hw/i2c/pm_smbus.c
include/hw/i2c/pm_smbus.h