summaryrefslogtreecommitdiffstats
path: root/include/hw/i2c/smbus_slave.h
Commit message (Collapse)AuthorAgeFilesLines
* i2c:smbus_slave: Add an SMBus vmstate structureCorey Minyard2019-02-281-3/+21
| | | | | | | | | | | There is no vmstate handling for SMBus, so no device sitting on SMBus can have a state transfer that works reliably. So add it. Signed-off-by: Corey Minyard <cminyard@mvista.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
* i2c:smbus: Simplify read handlingCorey Minyard2019-02-281-7/+10
| | | | | | | | | There were two different read functions, and with the removal of the command passed in there is no functional difference. So remove one of them. With that you don't need one of the states, so that can be removed, too. Signed-off-by: Corey Minyard <cminyard@mvista.com>
* i2c:smbus: Simplify write operationCorey Minyard2019-02-281-8/+13
| | | | | | | | | | | | There were two different write functions and the SMBus code kept track of the command. Keeping track of the command wasn't useful, in fact it wasn't quite correct for the eeprom_smbus code. And there is no need for two write functions. Just have one write function and the first byte in the buffer is the command. Signed-off-by: Corey Minyard <cminyard@mvista.com>
* i2c:smbus: Correct the working of quick commandsCorey Minyard2019-02-281-0/+5
| | | | | | | | | The logic of handling quick SMBus commands was wrong. If you get a finish event with no data, that's a quick command. Document the quick command while we are at it. Signed-off-by: Corey Minyard <cminyard@mvista.com>
* i2c: Split smbus into partsCorey Minyard2019-02-281-0/+69
smbus.c and smbus.h had device side code, master side code, and smbus.h has some smbus_eeprom.c definitions. Split them into separate files. Signed-off-by: Corey Minyard <cminyard@mvista.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>