1STRUCT I2C_BOARD_INF(9) I2C and SMBus Subsystem STRUCT I2C_BOARD_INF(9)
2
3
4
6 struct_i2c_board_info - template for device creation
7
9 struct i2c_board_info {
10 char type[I2C_NAME_SIZE];
11 unsigned short flags;
12 unsigned short addr;
13 void * platform_data;
14 struct dev_archdata * archdata;
15 struct device_node * of_node;
16 struct fwnode_handle * fwnode;
17 int irq;
18 };
19
21 type[I2C_NAME_SIZE]
22 chip type, to initialize i2c_client.name
23
24 flags
25 to initialize i2c_client.flags
26
27 addr
28 stored in i2c_client.addr
29
30 platform_data
31 stored in i2c_client.dev.platform_data
32
33 archdata
34 copied into i2c_client.dev.archdata
35
36 of_node
37 pointer to OpenFirmware device node
38
39 fwnode
40 device node supplied by the platform firmware
41
42 irq
43 stored in i2c_client.irq
44
46 I2C doesn't actually support hardware probing, although controllers and
47 devices may be able to use I2C_SMBUS_QUICK to tell whether or not
48 there's a device at a given address. Drivers commonly need more
49 information than that, such as chip type, configuration, associated
50 IRQ, and so on.
51
52 i2c_board_info is used to build tables of information listing I2C
53 devices that are present. This information is used to grow the driver
54 model tree. For mainboards this is done statically using
55 i2c_register_board_info; bus numbers identify adapters that aren't yet
56 available. For add-on boards, i2c_new_device does this dynamically with
57 the adapter already known.
58
60Kernel Hackers Manual 3.10 June 2019 STRUCT I2C_BOARD_INF(9)