STRUCT I2C_BOARD_INFO(9)
πΈ NAME πΈ
okay so this is the struct i2c_board_info(9) page from the Kernel API Manual β and itβs literally the template for device creation, bestie. π«Ά
β¨ SYNOPSIS β¨
hereβs the struct in all its main-character glory:
struct i2c_board_info {
char type[I2C_NAME_SIZE];
unsigned short flags;
unsigned short addr;
const char *dev_name;
void *platform_data;
struct fwnode_handle *fwnode;
const struct software_node *swnode;
const struct resource *resources;
unsigned int num_resources;
int irq;
};
π«Ά Members π«Ά
typeβ chip type, to initializei2c_client.nameflagsβ to initializei2c_client.flagsaddrβ stored ini2c_client.addrdev_nameβ overrides the default<busnr>-<addr>dev_nameif itβs setplatform_dataβ stored ini2c_client.dev.platform_datafwnodeβ device node supplied by the platform firmwareswnodeβ software node for the deviceresourcesβ resources associated with the devicenum_resourcesβ number of resources in theresourcesarrayirqβ stored ini2c_client.irq
π Description π
no cap, 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_client_device does this dynamically with the adapter already known. slay. π
π SEE ALSO π
- Kernel file
./include/linux/i2c.h i2c_master_recv(9)i2c_master_recv_dmasafe(9)i2c_master_send(9)i2c_master_send_dmasafe(9)struct i2c_device_identity(9)enum i2c_driver_flags(9)struct i2c_driver(9)struct i2c_client(9)I2C_BOARD_INFO(9)struct i2c_algorithm(9)struct i2c_lock_operations(9)struct i2c_timings(9)struct i2c_bus_recovery_info(9)struct i2c_adapter_quirks(9)i2c_lock_bus(9)i2c_trylock_bus(9)i2c_unlock_bus(9)i2c_mark_adapter_suspended(9)i2c_mark_adapter_resumed(9)i2c_check_quirks(9)module_i2c_driver(9)builtin_i2c_driver(9)
mwah π β this cutie came from ./include/linux, dated October 2026, and the footer still whispers struct i2c_board_info(9). periodt. π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms