i2c_smbus_xfer(9)
β¨ i2c_smbus_xfer β¨
okay bestie, welcome to the Kernel API Manual entry for i2c_smbus_xfer β it's giving "one function to rule all the SMBus protocols" and honestly? iconic. π
π NAME π
i2c_smbus_xfer β execute SMBus protocol operations. that's it, that's the whole job description, and she does it flawlessly. π
πΈ SYNOPSIS πΈ
s32 i2c_smbus_xfer (struct i2c_adapter *adapter , u16 addr , unsigned
short flags , char read_write , u8 command , int protocol , union
i2c_smbus_data *data );
like, look at all those parameters. she's high-maintenance but she's worth it. π₯
π¦ ARGUMENTS π¦
okay so here's the whole cast of characters, and every single one of them matters:
adapterβ your handle to the I2C bus. think of it as the group chat you're posting into. π«Άaddrβ the address of the SMBus slave on that bus. that's who you're @-ing. πflagsβI2C_CLIENT_*flags. usually zero orI2C_CLIENT_PEC. lowkey optional, highkey relevant. β¨read_writeβ eitherI2C_SMBUS_READorI2C_SMBUS_WRITE. pick a lane, bestie. πcommandβ a byte interpreted by the slave, for the protocols which use such bytes. iykyk. πprotocolβ the SMBus protocol operation you want to execute, such asI2C_SMBUS_PROC_CALL. this is the main character of the whole call, ngl. πdataβ the data to be read or written. the payload, the moment, the content. π
π DESCRIPTION π
so what does she actually do? this executes an SMBus protocol operation, and returns a negative errno code β else zero on success. that's the whole vibe check: negative errno = not slay, zero = slay. β
fr fr, watch that return value. a negative errno is the function telling you something went sideways, and zero is the green flag. π’
π SEE ALSO π
the whole squad, in order, no one left out:
- Kernel file
./drivers/i2c/i2c-core-smbus.c i2c_smbus_pec(9)i2c_smbus_read_byte(9)i2c_smbus_write_byte(9)i2c_smbus_read_byte_data(9)i2c_smbus_write_byte_data(9)i2c_smbus_read_word_data(9)i2c_smbus_write_word_data(9)i2c_smbus_read_block_data(9)i2c_smbus_write_block_data(9)i2c_smbus_read_i2c_block_data_or_emulated(9)i2c_new_smbus_alert_device(9)
and that's the page, bestie!! π§π brought to you by the fine folks over at ./drivers/i2c, stamped October 2026, and officially filed under i2c_smbus_xfer(9). mwah, go read your errno values, ily. ππ¦πΈ
π¦ 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