summaryrefslogtreecommitdiff
path: root/include/xen
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2018-09-26 11:19:24 +0800
committerPeng Fan <peng.fan@nxp.com>2019-11-28 16:27:52 +0800
commitdda4dde724422c2e8082ffd83d3ea3b3ffb82d06 (patch)
tree9c468359243492da53f367772e799376e0526902 /include/xen
parent1990cee78d609db6696182755e58b934754ae7c5 (diff)
LF-191-2 i2c: introduce xen i2c paravirtualization driver
Add i2c backend frontend support. The transaction only support one msg each time. The frontend sends a request to backend, backend use i2c_transfer to do real transaction to hardware and return the results to frontend. Now i2cdump/get/set works. In domu cfg file, use "vi2c = ['backend=0,be-adapter=5a800000.i2c,addr=0x51;0x44']" to create a dummy controller in frontend and allowed slaves in backend. Currently the slave address check not added, it will be supported in furture patch. Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Leonard Crestez <leonard.crestez@nxp.com>
Diffstat (limited to 'include/xen')
-rw-r--r--include/xen/interface/io/i2cif.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/xen/interface/io/i2cif.h b/include/xen/interface/io/i2cif.h
index b9542722f77d..c504670429d0 100644
--- a/include/xen/interface/io/i2cif.h
+++ b/include/xen/interface/io/i2cif.h
@@ -32,7 +32,7 @@
#include <xen/interface/io/ring.h>
#include <xen/interface/grant_table.h>
-#define I2CIF_BUF_LEN 32
+#define I2CIF_BUF_LEN I2C_SMBUS_BLOCK_MAX + 2
#define I2CIF_MAX_MSG 2
#define I2CIF_M_RD 0x0001 /* read data, from slave to master */
@@ -76,6 +76,13 @@ struct i2cif_request {
} msg[I2CIF_MAX_MSG];
int num_msg;
__u8 write_buf[I2CIF_BUF_LEN];
+
+ bool is_smbus;
+ __u16 addr;
+ __u16 flags;
+ __u8 read_write;
+ __u8 command;
+ int protocol;
};
struct i2cif_response {