cros_ec_cmd_readmem(9)
π cros_ec_cmd_readmem(9) β Kernel API Manual π
okay so bestie, welcome to the cros_ec_cmd_readmem page from the Kernel API Manual β¨ this one's a little function that literally just reads stuff out of EC memory, and honestly? it ate. let's get into it π«Ά
πΈ NAME πΈ
cros_ec_cmd_readmem β Read from EC memory. that's it, that's the whole vibe. you want bytes out of the EC's memory, this is the girl for the job π
β¨ SYNOPSIS β¨
int cros_ec_cmd_readmem (struct cros_ec_device *ec_dev , u8 offset , u8
size , void *dest );
like, look at her. four little params, one int coming back. main character energy fr π
π ARGUMENTS π
ec_devβ the EC device π this is your whole context, your little guy, the device you're talking to.offsetβ this one's within theEC_LPC_ADDR_MEMMAPregion. so it's not some absolute address, it's an offset inside that memmap zone, iykyk π¦sizeβ number of bytes to read. how much you're grabbing. no cap, pick this carefully πdestβ the EC command output data. this is where the bytes land, bestie, so make sure it's pointing somewhere real π
π₯ RETURN π₯
>= 0on success β we love a win π- negative error number on failure β she'll tell you something went wrong by going negative, so check it!! π
ngl, always check the return value. negative means bad news, and it's giving "handle me" energy π
π SEE ALSO π
the kernel file lives at ./drivers/platform/chrome/cros_ec_proto.c β go say hi π§
and the whole friend group:
cros_ec_prepare_tx(9)cros_ec_check_result(9)cros_ec_get_host_event_wake_mask(9)cros_ec_get_host_command_version_mask(9)cros_ec_query_all(9)cros_ec_cmd_xfer(9)cros_ec_cmd_xfer_status(9)cros_ec_get_next_event(9)cros_ec_get_host_event(9)cros_ec_read_features(9)cros_ec_check_features(9)cros_ec_get_sensor_count(9)cros_ec_cmd(9)cros_ec_get_cmd_versions(9)cros_ec_device_registered(9)
like, that's the entire group chat, all linked up π β¨
and that's the page, bestie!! π shoutout to the ./drivers/platform/chrome directory and the October 2026 date stamp β that's the source/version and date, mwah π slay, go read some EC memory responsibly πΈπ
π¦ 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