STRUCT I2C_BOARD_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 initialize i2c_client.name
  • flags β€” to initialize i2c_client.flags
  • addr β€” stored in i2c_client.addr
  • dev_name β€” overrides the default <busnr>-<addr> dev_name if it’s set
  • platform_data β€” stored in i2c_client.dev.platform_data
  • fwnode β€” device node supplied by the platform firmware
  • swnode β€” software node for the device
  • resources β€” resources associated with the device
  • num_resources β€” number of resources in the resources array
  • irq β€” stored in i2c_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 🌈


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