ec_i2c_construct_message(9)
π ec_i2c_construct_message(9) β from the Kernel API Manual, bestie π
Okay so picture this: you're deep in the kernel, you've got some i2c messages, and the EC is sitting there waiting for them in its own little language. This page is literally the translator. Let's get into it β¨
πΈ NAME πΈ
ec_i2c_construct_message β construct a message to go to the EC. That's it, that's the whole vibe. We're building a message. For the EC. Slay π
π¦ SYNOPSIS π¦
int ec_i2c_construct_message (u8 *buf , const struct i2c_msg i2c_msgs[]
, int num , u16 bus_num );
Yes the line break in the middle is real, no I did not do that, that's just how it's printed. Copy it exactly, periodt π
β¨ ARGUMENTS β¨
bufβ the buffer to fill, bestie. And likeβ¦ we assume the buffer is big enough. We do not check. We do not ask. We simply trust. πi2c_msgsβ the i2c messages to read. These are your raw materials, your main characters. πnumβ the number of i2c messages. Gotta know how many you're working with, obviously. π’bus_numβ the remote bus number we want to talk to. Which bus? That one. Over there. ππ¨
π DESCRIPTION π
Lowkey this function is just a translator with main character energy. It effectively stuffs the standard i2c_msg format of Linux into a format that the EC understands. Linux speaks one dialect, the EC speaks another, and this function is the friend who's fluent in both π§β¨
Returns 0 or a negative error number. So like, zero means we ate and left no crumbs, and negative means something went sideways π
π₯ SEE ALSO π₯
- Kernel file
./drivers/i2c/busses/i2c-cros-ec-tunnel.c struct ec_i2c_device(9)ec_i2c_count_message(9)ec_i2c_count_response(9)ec_i2c_parse_response(9)
The whole friend group, honestly π«Ά go say hi.
π A little sign-off π
This iconic little page lives in ./drivers/i2c/busses, and it's dated October 2026 β yes, the future, we're ahead of schedule, we're thriving. Go forth and construct those messages, bestie. You've got this ππβ
π¦ 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