cros_ec_get_next_event(9)
π cros_ec_get_next_event(9) β the Kernel API Manual glow-up π¦
okay so bestie, welcome to the cros_ec_get_next_event(9) page from the Kernel API Manual. this is the one that grabs the next event off the ChromeOS EC, and honestly it's giving "small function, big responsibility". let's get into it β¨
πΈ NAME πΈ
cros_ec_get_next_event β fetch the next event from the ChromeOS EC. that's it, that's the whole vibe π«Ά
β¨ SYNOPSIS β¨
int cros_ec_get_next_event (struct cros_ec_device *ec_dev , bool
*wake_event , bool *has_more_events );
like, copy it exactly, don't @ me, the spacing is load-bearing (jk, but also fr don't retype it by hand) π
π ARGUMENTS π
ec_devβ the device you're fetching the event from. your main character device, basically πwake_eventβ pointer to aboolthat gets set totrueon return if the event might be treated as a wake event. lowkey important for power stuff. and if it's null? ignored. literally doesn't care πhas_more_eventsβ pointer to aboolset totrueif more than one event is pending. some ECs will set this flag to say "hey, you can callcros_ec_get_next_eventmultiple times in a row". it's an optimization, periodt β it stops you from issuing a EC command for nothing, or from waiting on another interrupt from the EC just to process the next message. also ignored if null π
ngl, that has_more_events one is the whole reason this is efficient. respect the flag π«‘
π₯ RETURN π₯
- negative error code on errors π
0for no data πΆ- or else the number of bytes received β i.e. an event was retrieved successfully, slay π
on success, event types are written out to ec_dev->event_data.event_type. yes, exactly that path, character for character, don't come for me π―
π SEE ALSO π
Kernel file: ./drivers/platform/chrome/cros_ec_proto.c β go read the source, it's iconic β
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_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_cmd_readmem(9)cros_ec_get_cmd_versions(9)cros_ec_device_registered(9)
that's the whole page bestie, go forth and fetch those events π this came from ./drivers/platform/chrome, dated October 2026, and it's cros_ec_get_next_event(9) forever and always π§π
π¦ 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