struct i2c_board_info { char type[I2C_NAME_SIZE]; unsigned short flags; unsigned short addr; void * platform_data; struct dev_archdata * archdata; #ifdef CONFIG_OF struct device_node * of_node; #endif int irq; };
type[I2C_NAME_SIZE]
flags
addr
platform_data
archdata
of_node
irq
I2C doesn't actually support hardware probing, although controllers and devices may be able to use I2C_SMBUS_QUICK to tell whether or not there's a device at a given address. Drivers commonly need more information than that, such as chip type, configuration, associated IRQ, and so on.
i2c_board_info is used to build tables of information listing I2C devices that are present. This information is used to grow the driver model tree. For mainboards this is done statically using i2c_register_board_info; bus numbers identify adapters that aren't yet available. For add-on boards, i2c_new_device does this dynamically with the adapter already known.