~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to include/hw/i2c/i2c.h

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    /* Callbacks provided by the device.  */
33
33
    int (*init)(I2CSlave *dev);
34
34
 
35
 
    /* Master to slave.  */
 
35
    /* Master to slave. Returns non-zero for a NAK, 0 for success. */
36
36
    int (*send)(I2CSlave *s, uint8_t data);
37
37
 
38
 
    /* Slave to master.  */
 
38
    /*
 
39
     * Slave to master.  This cannot fail, the device should always
 
40
     * return something here.  Negative values probably result in 0xff
 
41
     * and a possible log from the driver, and shouldn't be used.
 
42
     */
39
43
    int (*recv)(I2CSlave *s);
40
44
 
41
 
    /* Notify the slave of a bus state change.  */
42
 
    void (*event)(I2CSlave *s, enum i2c_event event);
 
45
    /*
 
46
     * Notify the slave of a bus state change.  For start event,
 
47
     * returns non-zero to NAK an operation.  For other events the
 
48
     * return code is not used and should be zero.
 
49
     */
 
50
    int (*event)(I2CSlave *s, enum i2c_event event);
43
51
} I2CSlaveClass;
44
52
 
45
53
struct I2CSlave