STRUCT EVENT_DEVICE_DATA(9)
πΈ struct event_device_data(9) πΈ
okay bestie, so this one lives in the Kernel API Manual β it's a kernel struct page, and honestly? it's giving "the whole personality of a Wilco EC device in one little bundle." Let's get into it π
β¨ NAME β¨
struct event_device_data β the data for a Wilco EC device that responds to ACPI. literally the whole vibe of the device, packaged up π
π¦ SYNOPSIS π¦
struct event_device_data {
struct ec_event_queue *events;
spinlock_t queue_lock;
wait_queue_head_t wq;
struct device dev;
struct cdev cdev;
bool exist;
atomic_t available;
};
no cap, that's the entire struct. every field is kind of a main character in its own right, so let's meet them π
π Members π
eventsβ a circular queue of EC events, just sitting there waiting to be handed over to userspace. it's the little conveyor belt of event lore πqueue_lockβ a spinlock that protects the queue from simultaneous reads and writes. one at a time, bestie, we do NOT do chaos here π₯wqβ a wait queue used to notify processes when events are available or when the device has been removed. it's the group-chat ping for "something changed" β¨devβ the device associated with thecdev. they're a package deal π«Άcdevβ the char dev that userspace reads from and polls from. this is the one your program actually talks to πexistβ has the device not been removed? once a device has been removed, writes, reads, and new opens will all fail. so like, once it's gone, it's gone bestie πavailableβ guarantees only one client can open the file and read from the queue. exclusive access, periodt π
π« Description π«
so there will be, like, one of these structs for each ACPI device registered. that's the rule, that's the law π
and what's actually in it? it's the queue of events that came in from ACPI and still need to be read from userspace, plus the device and the char device that userspace is using, plus a wait queue that's there to notify different threads when something has changed, plus a flag telling you whether the ACPI device has been removed. it's basically the ACPI device's entire memory and social life in one struct π
πΈ SEE ALSO πΈ
kernel file ./drivers/platform/chrome/wilco_ec/event.c β and all of these faves:
struct ec_event(9)struct ec_event_queue(9)enqueue_events(9)event_device_notify(9)event_read(9)free_device_data(9)event_device_probe(9)
a lil warning from me to you: if exist is false, reads, writes, and new opens will fail. no cap, don't fight it π
okay that's the page!! mwah π this came from ./drivers/platform/chrome/wilco_ec/event.c, dated October 2026, and it's page struct event_device_data(9) of the Kernel API Manual. slay, go read the source, ilysm π§ββοΈππ
π¦ 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