__i2c_transfer(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __i2c_transfer(9) β€” unlocked i2c_transfer, no cap πŸ’–

okay so welcome to the Kernel API Manual, bestie 🌸 β€” this is the page for __i2c_transfer, aka the unlocked flavor of i2c_transfer. It’s giving β€œI do the transfer, but you already brought the lock” energy πŸ¦‹βœ¨.


πŸ’… NAME πŸ’…

__i2c_transfer β€” unlocked flavor of i2c_transfer πŸ’–

✨ SYNOPSIS ✨

int __i2c_transfer (struct i2c_adapter *adap , struct i2c_msg *msgs ,
       int num );

πŸŽ€ ARGUMENTS πŸŽ€

  • adap β€” handle to the I2C bus. Like, your little bus portal πŸ”Œβœ¨
  • msgs β€” one or more messages to execute before STOP is issued to terminate the operation; each message begins with a START. So yes: plural messages, each one starts with START, and the whole thing gets terminated with STOP πŸ’…
  • num β€” number of messages to be executed. Count ’em, bestie πŸ”’πŸŒΈ

🌈 DESCRIPTION 🌈

Returns a negative errno, else the number of messages executed. So it’s either β€œnope, here’s an error” or β€œyep, here’s how many messages went through” 😭✨

πŸ”’ Lock check, bestie: the adapter lock must be held when calling this function. No cap β€” that’s the whole unlocked-but-not-really vibe. You hold the lock, then call this 🫢

No debug logging takes place. None. Zero. It’s not logging, it’s just doing the thing πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/i2c/i2c-core-base.c and all these iconic little functions:


xoxo, your kernel bestie πŸ’…βœ¨ this lil page lives in ./drivers/i2c, dated October 2026, and it’s literally __i2c_transfer(9). mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from