i2c: pm_smbus: Add block transfer capability
[qemu/ar7.git] / include / hw / i2c / pm_smbus.h
blob99d5489e1b089d456afeb94e4136142aa78d3b73
1 #ifndef PM_SMBUS_H
2 #define PM_SMBUS_H
4 #define PM_SMBUS_MAX_MSG_SIZE 32
6 typedef struct PMSMBus {
7 I2CBus *smbus;
8 MemoryRegion io;
10 uint8_t smb_stat;
11 uint8_t smb_ctl;
12 uint8_t smb_cmd;
13 uint8_t smb_addr;
14 uint8_t smb_data0;
15 uint8_t smb_data1;
16 uint8_t smb_data[PM_SMBUS_MAX_MSG_SIZE];
17 uint8_t smb_blkdata;
18 uint8_t smb_auxctl;
19 uint32_t smb_index;
21 /* Set by pm_smbus.c */
22 void (*reset)(struct PMSMBus *s);
24 /* Set by the user. */
25 bool i2c_enable;
27 /* Internally used by pm_smbus. */
29 /* Set on block transfers after the last byte has been read, so the
30 INTR bit can be set at the right time. */
31 bool op_done;
32 } PMSMBus;
34 void pm_smbus_init(DeviceState *parent, PMSMBus *smb);
36 #endif /* PM_SMBUS_H */