__i2c_transfer(9)
π __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 beforeSTOPis issued to terminate the operation; each message begins with aSTART. So yes: plural messages, each one starts withSTART, and the whole thing gets terminated withSTOPπ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:
i2c_verify_client(9)i2c_adapter_lock_bus(9)i2c_adapter_trylock_bus(9)i2c_adapter_unlock_bus(9)i2c_new_client_device(9)i2c_unregister_device(9)i2c_find_device_by_fwnode(9)i2c_new_dummy_device(9)devm_i2c_new_dummy_device(9)i2c_new_ancillary_device(9)i2c_verify_adapter(9)i2c_handle_smbus_host_notify(9)i2c_add_adapter(9)i2c_add_numbered_adapter(9)i2c_del_adapter(9)devm_i2c_add_adapter(9)i2c_find_adapter_by_fwnode(9)i2c_get_adapter_by_fwnode(9)i2c_parse_fw_timings(9)i2c_del_driver(9)i2c_transfer(9)i2c_transfer_buffer_flags(9)i2c_get_device_id(9)i2c_client_get_device_id(9)i2c_get_dma_safe_msg_buf(9)i2c_put_dma_safe_msg_buf(9)
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
- 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