i2c_add_numbered_adapter(9)
i2c_add_numbered_adapter(9) β Kernel API Manual π β¨
β¨ NAME β¨
i2c_add_numbered_adapter β declare i2c adapter, use static bus number. bestie, this is the βmy bus number is not a vibe, itβs a fixed addressβ routine π
πΈ SYNOPSIS πΈ
int i2c_add_numbered_adapter (struct i2c_adapter *adap );
π ARGUMENTS π
adapβ the adapter to register, and yes, it has to haveadap->nrinitialized already. no cap, bestie, set that number first π
π΄ CONTEXT π΄
It can sleep π΄. Thatβs the whole context note, periodt.
π DESCRIPTION π
okay so this routine is used to declare an I2C adapter when its bus number matters. For example, use it for I2C adapters from system-on-chip CPUs, or otherwise built in to the systemβs mainboard, and where i2c_board_info is used to properly configure I2C devices. itβs giving βIβm built in and I know my numberβ π¦
If the requested bus number is set to -1, then this function will behave identically to i2c_add_adapter, and will dynamically assign a bus number. literally same behavior, it just picks one for you β¨
If no devices have pre-been declared for this bus, then be sure to register the adapter before any dynamically allocated ones. Otherwise the required bus ID may not be available. β οΈ like, do not skip this ordering step, bestie β itβs important.
When this returns zero, the specified adapter became available for clients using the bus number provided in adap->nr. Also, the table of I2C devices pre-declared using i2c_register_board_info is scanned, and the appropriate driver model device nodes are created. Otherwise, a negative errno value is returned. π«Ά
π SEE ALSO π
The kernel file is ./drivers/i2c/i2c-core-base.c, and the whole friend group is right here:
i2c_verify_client(9)i2c_adapter_lock_bus(9)i2c_adapter_trylock_bus(9)i2c_adapter_unlock_bus(9)i2c_new_client_device(9)i2c_unregister_device(9)i2c_find_device_by_fwnode(9)i2c_new_dummy_device(9)devm_i2c_new_dummy_device(9)i2c_new_ancillary_device(9)i2c_verify_adapter(9)i2c_handle_smbus_host_notify(9)i2c_add_adapter(9)i2c_del_adapter(9)devm_i2c_add_adapter(9)i2c_find_adapter_by_fwnode(9)i2c_get_adapter_by_fwnode(9)i2c_parse_fw_timings(9)i2c_del_driver(9)__i2c_transfer(9)i2c_transfer(9)i2c_transfer_buffer_flags(9)i2c_get_device_id(9)i2c_client_get_device_id(9)i2c_get_dma_safe_msg_buf(9)i2c_put_dma_safe_msg_buf(9)
xoxo, the ./drivers/i2c girlies β October 2026 ππ
π¦ 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