1 #ifndef __MINIX_I2C_H 2 #define __MINIX_I2C_H 3 4 /* 5 * Minix I2C /dev Interface. 6 * 7 * Same as NetBSD/OpenBSD interface but with a flat struct (i.e. no pointers). 8 * The NetBSD/OpenBSD interface can still be used on i2c device files. The 9 * ioctl(2) function will translate to/from the Minix version of the struct. 10 */ 11 12 #include <sys/types.h> 13 #include <dev/i2c/i2c_io.h> 14 #include <minix/ioctl.h> 15 16 typedef struct minix_i2c_ioctl_exec { 17 i2c_op_t iie_op; /* operation to perform */ 18 i2c_addr_t iie_addr; /* address of device */ 19 uint8_t iie_cmd[I2C_EXEC_MAX_CMDLEN]; /* pointer to command */ 20 size_t iie_cmdlen; /* length of command */ 21 uint8_t iie_buf[I2C_EXEC_MAX_BUFLEN]; /* pointer to data buffer */ 22 size_t iie_buflen; /* length of data buffer */ 23 } minix_i2c_ioctl_exec_t; 24 25 #define MINIX_I2C_IOCTL_EXEC _IOWR('I', 1, minix_i2c_ioctl_exec_t) 26 27 #endif /* __MINIX_I2C_H */ 28