i2c_new_dummy_device(9)
π i2c_new_dummy_device(9) β the Kernel API Manual glow-up π
okay so you're in the Kernel API Manual, section 9, and today's main character is i2c_new_dummy_device. she's not flashy, she's not doing the most, but bestie she is essential. let's get into it β¨
β¨ NAME β¨
i2c_new_dummy_device β returns you a brand new i2c device that's bound to a dummy driver. yeah, dummy. she's a stand-in and she KNOWS it π
πΈ SYNOPSIS πΈ
struct i2c_client * i2c_new_dummy_device (struct i2c_adapter *adapter ,
u16 address );
like... look at her. two args, one pointer out. clean. iconic. π«Ά
π¦ ARGUMENTS π¦
adapterβ the adapter that's managing the device, i.e. the boss of this whole situation β¨addressβ the seven bit address you want to use (seven bits, not eight, don't come for me)
π CONTEXT π
can sleep π΄ β yes bestie, this one's allowed to nap. schedule accordingly.
π₯ DESCRIPTION π₯
So what does she actually do? She returns you an I2C client that's bound to the "dummy" driver. and why would you want a dummy, you ask? because some devices out here are greedy and consume multiple addresses. examples of these chips include various EEPROMS β like the 24c04 and 24c08 models, iykyk π
These dummy devices have two main uses, and honestly both of them ate:
- most I2C and SMBus calls except
i2c_transferneed a client handle β and the dummy is gonna be that handle, periodt π - it stops that specified address from getting bound to a different driver. she's holding the spot. no cap. π«
And what do you get back? either:
- the new i2c client β and you should save it for later so you can use it with
i2c_unregister_device(don't lose her, she's yours now π), or - an
ERR_PTRdescribing the error π
fr fr: check that return value. ERR_PTR is out here and she is not subtle about it.
π SEE ALSO π
Kernel file ./drivers/i2c/i2c-core-base.c + the whole friend group:
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)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_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)
and that's the whole page bestie, you ate that π«Άπ
source location: ./drivers/i2c Β· date: October 2026 Β· manual: i2c_new_dummy_device(9) β mwah, see you in the next manpage ππ¦β¨
π¦ 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