sch_access(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ sch_access(9) β€” like, the main access entry for i2c-sch access ✨

okay bestie, welcome to the Kernel API Manual 🫢 this one's short and sweet ngl β€” it's literally the front door for i2c-sch access, so if you're touching this you're already kinda iconic πŸ’…


🌸 SYNOPSIS 🌸

the whole vibe, verbatim, do not touch a single character:

s32 sch_access (struct i2c_adapter *adap , u16 addr , unsigned short
flags , char read_write , u8 command , int size , union i2c_smbus_data
*data );

it returns an s32, it takes a whole little squad of args, and yes she's giving main character energy πŸ™ˆ


πŸŽ€ ARGUMENTS πŸŽ€

okay so here's the whole cast, one by one, no skipping:

  • adap β€” the i2c adapter pointer πŸ’« like, the actual adapter you're talking through.
  • addr β€” the i2c device bus address πŸ¦‹ where your little device lives on the bus.
  • flags β€” I2C_CLIENT_* flags 🌈 (usually zero or I2C_CLIENT_PEC, fr fr, those are the two moods).
  • read_write β€” 0 for read and 1 for write πŸ‘‘ honestly a vibe check in integer form: zero = listen, one = speak.
  • command β€” byte interpreted by slave πŸ“ for protocols which use such bytes. key phrase: for protocols which use such bytes, iykyk.
  • size β€” the i2c transaction type πŸ’€ tells everyone what kind of transaction this is.
  • data β€” the union of transaction for data to be transferred or data read from bus 🌸 so it's either carrying your data out, or carrying the bus's data back home. dual purpose queen.

πŸ”₯ RETURN πŸ”₯

0 for success and others for failure ✨

so real talk: zero is the slay. anything that is not zero means something went sideways β€” don't ignore it, bestie 😭

πŸ’œ SEE ALSO πŸ’œ

go look at these, they're literally right there:


and that's the whole page, periodt πŸ’…βœ¨

cute little sign-off before you go: this page lives in ./drivers/i2c/busses, dated October 2026 πŸŽ€ go forth and access your i2c bus responsibly, mwah πŸ«ΆπŸ’–

πŸ“¦ where this page comes from