i3c_bus_for_each_i2cdev(9)
π i3c_bus_for_each_i2cdev β a lil' field guide (from the Kernel API Manual, bestie) π
okay so picture this: you're deep in the kernel, you've got an I3C bus, and you need to walk every single I2C device chillin' on it. that's literally this macro. it's giving "loop, but make it official." β¨
πΈ NAME πΈ
i3c_bus_for_each_i2cdev β iterate over all I2C devices present on the bus π¦
like. all of them. no cap. you point it at the bus, it hands you each I2C device in turn, one at a time, no skipping, no shortcuts. main character iteration energy honestly π
β¨ SYNOPSIS β¨
i3c_bus_for_each_i2cdev (bus , dev );
yes the spacing is exactly like that, don't come for me, I don't make the rules π (okay the kernel makes the rules, but still)
π«Ά ARGUMENTS π«Ά
busβ the I3C bus π like, the actual bus you're walking through. this is the whole venue, the party you're doing the rounds at.devβ an I2C device descriptor pointer, and here's the cute part: it gets updated to point to the current slot at each iteration of the loop. so every trip around the loop,devis refreshed to whoever's up next. it's a little rotating spotlight, honestly. π₯
ngl, dev is doing the real work here β it's not just "a pointer", it's the pointer that moves. keep an eye on it. π
π DESCRIPTION π
Iterate over all I2C devs present on the bus.
that's it. that's the whole vibe. you loop, you get every I2C device on the bus, one by one, and dev keeps up with where you are. simple, iconic, does exactly what it says on the tin. π
π¦ SEE ALSO π¦
the kernel file to peek at is ./include/linux/i3c/master.h β that's where the magic lives, bestie π
and here's the whole friend group, all of them, in order, because we don't leave anyone out at this lunch table:
struct i3c_i2c_dev_desc(9)struct i2c_dev_boardinfo(9)struct i2c_dev_desc(9)struct i3c_ibi_slot(9)struct i3c_device_ibi_info(9)struct i3c_dev_boardinfo(9)struct i3c_dev_desc(9)struct i3c_device(9)enum i3c_bus_mode(9)enum i3c_open_drain_speed(9)enum i3c_addr_slot_status(9)struct i3c_bus(9)struct i3c_master_controller_ops(9)struct i3c_master_controller(9)i3c_bus_for_each_i3cdev(9)struct i3c_dma(9)i3c_dev_get_master_data(9)i3c_dev_set_master_data(9)i2c_dev_get_master_data(9)i2c_dev_set_master_data(9)i3c_dev_get_master(9)i2c_dev_get_master(9)i3c_master_get_bus(9)
π real talk: this is a kernel API page, so it's like the source of truth β but it only tells you what's documented here. don't go inventing behavior that isn't written down, that's not slay, that's just guessing π
and that's the page!! mwah π
so yeah, this lil' writeup came from the source file ./include/linux/i3c, and the version/date on it is October 2026. page title's i3c_bus_for_each_i2cdev(9), in case you forgot already (you didn't, you're doing amazing π«Ά). go iterate something. periodt. πβπ
π¦ 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