1STRUCT I2C_ADAPTER_Q(9) I2C and SMBus Subsystem STRUCT I2C_ADAPTER_Q(9)
2
3
4
6 struct_i2c_adapter_quirks - describe flaws of an i2c adapter
7
9 struct i2c_adapter_quirks {
10 u64 flags;
11 int max_num_msgs;
12 u16 max_write_len;
13 u16 max_read_len;
14 u16 max_comb_1st_msg_len;
15 u16 max_comb_2nd_msg_len;
16 };
17
19 flags
20 see I2C_AQ_* for possible flags and read below
21
22 max_num_msgs
23 maximum number of messages per transfer
24
25 max_write_len
26 maximum length of a write message
27
28 max_read_len
29 maximum length of a read message
30
31 max_comb_1st_msg_len
32 maximum length of the first msg in a combined message
33
34 max_comb_2nd_msg_len
35 maximum length of the second msg in a combined message
36
38 Some I2C controllers can only send one message per transfer, plus
39 something called combined message or write-then-read. This is (usually)
40 a small write message followed by a read message and barely enough to
41 access register based devices like EEPROMs. There is a flag to support
42 this mode. It implies max_num_msg = 2 and does the length checks with
43 max_comb_*_len because combined message mode usually has its own
44 limitations. Because of HW implementations, some controllers can
45 actually do write-then-anything or other variants. To support that,
46 write-then-read has been broken out into smaller bits like write-first
47 and read-second which can be combined as needed.
48
50Kernel Hackers Manual 3.10 June 2019 STRUCT I2C_ADAPTER_Q(9)