STRUCT CROS_EC_LPC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct cros_ec_lpc(9) β€” like, the LPC device-specific data era πŸ’…

okay bestie, welcome to the Kernel API Manual ✨ β€” this one's all about struct cros_ec_lpc, which is literally just the LPC device-specific data and nothing more, no cap 🫢. Think of it as the little info packet that says "hey, here's where the EC lives and here's how we talk to it." 🌸


✨ NAME ✨

struct cros_ec_lpc β€” LPC device-specific data πŸŽ€ (yes that's the whole name, she's minimal, she's iconic)


πŸ¦‹ SYNOPSIS πŸ¦‹

struct cros_ec_lpc {
    u16 mmio_memory_base;
    void __iomem *base;
    struct acpi_resource_fixed_memory32 mem32;
    int (*read)(struct cros_ec_lpc *ec_lpc, unsigned int offset,
unsigned int length, u8 *dest);
    int (*write)(struct cros_ec_lpc *ec_lpc, unsigned int offset,
unsigned int length, const u8 *msg);
 };

like, look at her. five fields. every one of them pulling its weight πŸ’œ


🫢 Members 🫢

  • mmio_memory_base β€” the first I/O port addressing EC mapped memory. that's it, that's the vibe check πŸ‘‘
  • base β€” for EC supporting memory mapping, this is the base address of the mapped region. if your EC is a memory-mapping main character, this is her address 🏑
  • mem32 β€” the info about the memory mapped register region, if present. note the "if present," bestie β€” it might not be there πŸ™ˆ
  • read β€” copies length bytes from the EC address offset into the buffer dest. returns a negative error code on error, or the 8-bit checksum of all bytes read. so like, either it's mad 😭 or it hands you a checksum πŸ”₯
  • write β€” copies length bytes from the buffer msg into the EC address offset. returns a negative error code on error, or the 8-bit checksum of all bytes written. same deal, opposite direction, symmetry slay πŸ’…

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/platform/chrome/cros_ec_lpc.c
  • struct lpc_driver_data(9)

both linked from that kernel file, so go read them together, iykyk 🧚

ngl if you're poking at the EC without knowing which of these fields actually got filled in, that's giving "undefined behaviour energy" β€” check mem32 before you assume anything is present ⭐

aaand that's the page, bestie πŸ’– β€” straight from ./drivers/platform/chrome, October 2026, struct cros_ec_lpc(9) era. go forth and interrogate your embedded controller πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from