sch_access(9)
β¨ 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 orI2C_CLIENT_PEC, fr fr, those are the two moods).read_writeβ0for read and1for 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:
- Kernel file
./drivers/i2c/busses/i2c-isch.c sch_transaction(9)
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
- 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