i2c_new_dummy_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

  1. most I2C and SMBus calls except i2c_transfer need a client handle β€” and the dummy is gonna be that handle, periodt πŸ’…
  2. 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_PTR describing 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:


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