STRUCT CROS_EC_LPC(9)
π 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β copieslengthbytes from the EC addressoffsetinto the bufferdest. 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β copieslengthbytes from the buffermsginto the EC addressoffset. 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
- 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