1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _LINUX_I2C_H 20 #define _LINUX_I2C_H 21 #include <linux/types.h> 22 struct i2c_msg { 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 __u16 addr; 25 __u16 flags; 26 #define I2C_M_TEN 0x10 27 #define I2C_M_RD 0x01 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 #define I2C_M_NOSTART 0x4000 30 #define I2C_M_REV_DIR_ADDR 0x2000 31 #define I2C_M_IGNORE_NAK 0x1000 32 #define I2C_M_NO_RD_ACK 0x0800 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 __u16 len; 35 __u8 *buf; 36 }; 37 #define I2C_FUNC_I2C 0x00000001 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 #define I2C_FUNC_10BIT_ADDR 0x00000002 40 #define I2C_FUNC_PROTOCOL_MANGLING 0x00000004 41 #define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008 42 #define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 #define I2C_FUNC_SMBUS_QUICK 0x00010000 45 #define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 46 #define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 47 #define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 #define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 50 #define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 51 #define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 52 #define I2C_FUNC_SMBUS_PROC_CALL 0x00800000 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 #define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 55 #define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 56 #define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000 57 #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 #define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000 60 #define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000 61 #define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE) 62 #define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA | I2C_FUNC_SMBUS_WRITE_BYTE_DATA) 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 #define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA | I2C_FUNC_SMBUS_WRITE_WORD_DATA) 65 #define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA) 66 #define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK) 67 #define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 | I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2) 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 #define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_PROC_CALL | I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | I2C_FUNC_SMBUS_I2C_BLOCK) 70 #define I2C_SMBUS_BLOCK_MAX 32 71 union i2c_smbus_data { 72 __u8 byte; 73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74 __u16 word; 75 __u8 block[I2C_SMBUS_BLOCK_MAX + 2]; 76 }; 77 #define I2C_SMBUS_READ 1 78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79 #define I2C_SMBUS_WRITE 0 80 #define I2C_SMBUS_QUICK 0 81 #define I2C_SMBUS_BYTE 1 82 #define I2C_SMBUS_BYTE_DATA 2 83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84 #define I2C_SMBUS_WORD_DATA 3 85 #define I2C_SMBUS_PROC_CALL 4 86 #define I2C_SMBUS_BLOCK_DATA 5 87 #define I2C_SMBUS_I2C_BLOCK_DATA 6 88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89 #define I2C_SMBUS_BLOCK_PROC_CALL 7 90 #define I2C_RETRIES 0x0701 91 #define I2C_TIMEOUT 0x0702 92 #define I2C_SLAVE 0x0703 93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 94 #define I2C_SLAVE_FORCE 0x0706 95 #define I2C_TENBIT 0x0704 96 #define I2C_FUNCS 0x0705 97 #define I2C_RDWR 0x0707 98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 99 #define I2C_PEC 0x0708 100 #define I2C_SMBUS 0x0720 101 #endif 102