builtin_i2c_driver(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ builtin_i2c_driver β€” the Kernel API Manual page you didn't know you needed

okay bestie, so this is builtin_i2c_driver(9) from the Kernel API Manual, and honestly? it's a tiny little macro that saves you so much typing. let's get into it ✨


🌸 NAME 🌸

builtin_i2c_driver β€” the helper macro for registering a builtin I2C driver, no cap πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

builtin_i2c_driver (__i2c_driver );

that's literally it. one macro, one argument, she's serving minimalism πŸ’…


⭐ ARGUMENTS ⭐

  • __i2c_driver β€” an i2c_driver struct. that's the whole thing. that's the argument. hand her the struct and she handles the rest 🫢

✨ DESCRIPTION ✨

okay so picture this: you're writing an I2C driver, and your init function does absolutely nothing special β€” it's just boilerplate city πŸ™οΈ. this macro is your girl. builtin_i2c_driver is a helper macro for I2C drivers which do not do anything special in their init, and the way that it eliminates a lot of boilerplate is genuinely iconic πŸ”₯

two things you gotta remember though, and i mean it:

  • each driver may only use this macro once. one and done. periodt πŸ’€
  • calling it replaces device_initcall β€” so like, don't go doubling up, iykyk πŸ™ˆ
bestie please respect the once-only rule. it's not a suggestion, it's the whole vibe check 🧚

πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file ./include/linux/i2c.h is where the magic lives, and here's the full squad she runs with β€” all of these, no skips, because they're all part of the family 🌈:


that's the whole page, bestie β€” short, sweet, and highkey a lifesaver πŸ’– this gem comes from the kernel source at ./include/linux, dated October 2026, and it's brought to you by the Kernel API Manual ✨ mwah, go register some drivers πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from