builtin_i2c_driver(9)
π 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β ani2c_driverstruct. 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 π:
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)struct i2c_board_info(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)
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
- 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