i2c_new_ancillary_device(9)
π¦ i2c_new_ancillary_device π¦
okay bestie, welcome to the Kernel API Manual page for i2c_new_ancillary_device(9) β that's the manual name, and we're about to make secondary addresses make sense π
β¨ NAME β¨
i2c_new_ancillary_device β helper to get the instantiated secondary address and create the associated device. periodt β¨
π SYNOPSIS π
struct i2c_client * i2c_new_ancillary_device (struct i2c_client *client
, const char *name , u16 default_addr );
π ARGUMENTS π
clientβ handle to the primary client, aka your main character here.nameβ handle to specify which secondary address to get. tell it which one you want, bestie.default_addrβ used as a fallback if no secondary address was specified.
πΈ CONTEXT πΈ
can sleep π΄ β yes, literally. this one can sleep.
π¦ DESCRIPTION π¦
okay so picture this: I2C clients can be composed of multiple I2C slaves bound together in a single component. The I2C client driver then binds to the master I2C slave, and it needs to create I2C dummy clients to communicate with all the other slaves. it's giving teamwork π€
This function makes an I2C dummy client and hands it back; its I2C address comes from the platform firmware based on the slave name you passed in. If no address is specified by the firmware, default_addr is used. fallback era β¨
On DT-based platforms the address is retrieved from the "reg" property entry cell whose "reg-names" value matches the slave name. cute, specific, iconic π
What you get back is the new i2c client, which should be saved for later use with i2c_unregister_device; or an ERR_PTR to describe the error. so like, keep track of it or you'll be sad π
π₯ SEE ALSO π₯
Kernel file ./drivers/i2c/i2c-core-base.c is the spot, and these are the related bbs:
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_verify_adapter(9)i2c_handle_smbus_host_notify(9)i2c_add_adapter(9)i2c_add_numbered_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)
mwah π source/version ./drivers/i2c, date October 2026, manual i2c_new_ancillary_device(9) β bye bestie, go slay those dummy clients π«Άβ¨
π¦ 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