aboutsummaryrefslogtreecommitdiff
path: root/include/hw/i2c/smbus.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-03-31 18:26:30 +0200
committerMichael S. Tsirkin <mst@redhat.com>2014-05-07 19:14:46 +0300
commit046a1844142dc9ffa7c95f0761bfa11272480adf (patch)
tree280f41c1a069878353cd2b63ae607d19927b9a19 /include/hw/i2c/smbus.h
parent285364e96818c1a5f715fe256557b4a718222bc6 (diff)
smbus: return -1 if nothing found at the given address
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/i2c/smbus.h')
-rw-r--r--include/hw/i2c/smbus.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/hw/i2c/smbus.h b/include/hw/i2c/smbus.h
index 285d3b5de3..544bbc1957 100644
--- a/include/hw/i2c/smbus.h
+++ b/include/hw/i2c/smbus.h
@@ -66,16 +66,16 @@ struct SMBusDevice {
};
/* Master device commands. */
-void smbus_quick_command(I2CBus *bus, uint8_t addr, int read);
+int smbus_quick_command(I2CBus *bus, uint8_t addr, int read);
int smbus_receive_byte(I2CBus *bus, uint8_t addr);
-void smbus_send_byte(I2CBus *bus, uint8_t addr, uint8_t data);
+int smbus_send_byte(I2CBus *bus, uint8_t addr, uint8_t data);
int smbus_read_byte(I2CBus *bus, uint8_t addr, uint8_t command);
-void smbus_write_byte(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t data);
+int smbus_write_byte(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t data);
int smbus_read_word(I2CBus *bus, uint8_t addr, uint8_t command);
-void smbus_write_word(I2CBus *bus, uint8_t addr, uint8_t command, uint16_t data);
+int smbus_write_word(I2CBus *bus, uint8_t addr, uint8_t command, uint16_t data);
int smbus_read_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data);
-void smbus_write_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data,
- int len);
+int smbus_write_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data,
+ int len);
void smbus_eeprom_init(I2CBus *smbus, int nb_eeprom,
const uint8_t *eeprom_spd, int size);