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 ****************************************************************************
11 ****************************************************************************/
12#ifndef _LINUX_I2C_H
13#define _LINUX_I2C_H
14
15#include <linux/types.h>
16
17struct i2c_msg {
18 __u16 addr;
19 __u16 flags;
20#define I2C_M_TEN 0x10
21#define I2C_M_RD 0x01
22#define I2C_M_NOSTART 0x4000
23#define I2C_M_REV_DIR_ADDR 0x2000
24#define I2C_M_IGNORE_NAK 0x1000
25#define I2C_M_NO_RD_ACK 0x0800
26 __u16 len;
27 __u8 *buf;
28};
29
30#define I2C_FUNC_I2C 0x00000001
31#define I2C_FUNC_10BIT_ADDR 0x00000002
32#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004
33#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008
34#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000
35#define I2C_FUNC_SMBUS_QUICK 0x00010000
36#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000
37#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000
38#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000
39#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000
40#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000
41#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000
42#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000
43#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000
44#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000
45#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000
46#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000
47#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000
48#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000
49
50#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE |   I2C_FUNC_SMBUS_WRITE_BYTE)
51#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA |   I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
52#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA |   I2C_FUNC_SMBUS_WRITE_WORD_DATA)
53#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA |   I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
54#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK |   I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
55#define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 |   I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2)
56
57#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)
58
59#define I2C_SMBUS_BLOCK_MAX 32
60union i2c_smbus_data {
61 __u8 byte;
62 __u16 word;
63 __u8 block[I2C_SMBUS_BLOCK_MAX + 2];
64
65};
66
67#define I2C_SMBUS_READ 1
68#define I2C_SMBUS_WRITE 0
69
70#define I2C_SMBUS_QUICK 0
71#define I2C_SMBUS_BYTE 1
72#define I2C_SMBUS_BYTE_DATA 2
73#define I2C_SMBUS_WORD_DATA 3
74#define I2C_SMBUS_PROC_CALL 4
75#define I2C_SMBUS_BLOCK_DATA 5
76#define I2C_SMBUS_I2C_BLOCK_DATA 6
77#define I2C_SMBUS_BLOCK_PROC_CALL 7
78
79#define I2C_RETRIES 0x0701
80
81#define I2C_TIMEOUT 0x0702
82
83#define I2C_SLAVE 0x0703
84
85#define I2C_SLAVE_FORCE 0x0706
86
87#define I2C_TENBIT 0x0704
88
89#define I2C_FUNCS 0x0705
90#define I2C_RDWR 0x0707
91#define I2C_PEC 0x0708
92
93#define I2C_SMBUS 0x0720
94
95#endif
96