STRUCT CROS_EC_DEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct cros_ec_dev(9) ✨

okay so bestie, this is a page from the Kernel API Manual (yes, the ✨*Kernel API Manual*✨, we love a formal queen) and it's all about struct cros_ec_dev β€” the ChromeOS EC device entry point. that's it, that's the vibe. it's the lil' doorway your kernel knocks on to talk to the Embedded Controller. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the struct in all its glory, copy it exactly bestie, character for character, no freestyling:

struct cros_ec_dev {
    struct device class_dev;
    const struct attribute_group *group;
    struct cros_ec_device *ec_dev;
    struct device *dev;
    struct cros_ec_debugfs *debug_info;
    bool has_kb_wake_angle;
    u16 cmd_offset;
    struct ec_response_get_features features;
 };

πŸŽ€ Members πŸŽ€

okay so every field gets its moment, no one is getting skipped, we don't do that here πŸ’–

  • class_dev β€” the Device structure used in sysfs. it's giving "this is how I show up in sysfs" main character energy ✨
  • group β€” the sysfs attributes groups for this EC. your little collection of sysfs attrs, all bundled up 🎁
  • ec_dev β€” the cros_ec_device structure to talk to the physical device. this is the actual line to the hardware, the realness πŸ”₯
  • dev β€” pointer to the platform device. just a lil' pointer, keeping it lowkey πŸ™ˆ
  • debug_info β€” the cros_ec_debugfs structure for debugging information. for when something's acting sus and you need the receipts πŸ’€
  • has_kb_wake_angle β€” True if at least 2 accelerometer are connected to the EC. (yes, "accelerometer" is singular in the original and we are NOT correcting it, periodt πŸ‘‘)
  • cmd_offset β€” offset to apply for each command. every command gets this lil' shift applied, no cap πŸ“
  • features β€” features supported by the EC. it's the ec_response_get_features moment, iykyk ⭐

🌈 SEE ALSO 🌈

go read these next bestie, the lore is deep 🫢

  • Kernel file ./include/linux/platform_data/cros_ec_proto.h
  • struct cros_ec_command(9)
  • struct cros_ec_device(9)
  • struct cros_ec_platform(9)
  • cros_ec_get_time_ns(9)

and that's the whole page, you ate it up πŸ’…

little sign-off from the source: this page lives under ./include/linux/platform_data, dated October 2026, and it's literally titled struct cros_ec_dev(9). iconic. slay. bye bestie πŸ’–πŸŒΈ
πŸ“¦ where this page comes from