STRUCT LINE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct line(9) ✨

okay bestie so this is a page from the Kernel API Manual and it's literally all about struct line β€” the little icon that holds the state of a requested line πŸ’… (yes that's the NAME section, we're doing this properly).


🌸 NAME 🌸

struct line β€” contains the state of a requested line

πŸ¦‹ SYNOPSIS πŸ¦‹

struct line {
    struct gpio_desc *desc;
    struct linereq *req;
    unsigned int irq;
    u64 edflags;
    u64 timestamp_ns;
    u32 req_seqno;
    u32 line_seqno;
    struct delayed_work work;
    unsigned int sw_debounced;
    unsigned int level;
  #ifdef CONFIG_HTE;
    struct hte_ts_desc hdesc;
    int raw_level;
    u32 total_discard_seq;
    u32 last_seqno;
  #endif ;
 };

no cap, that's the whole struct β€” every field, in order, exactly like that 🫢

πŸŽ€ Members πŸŽ€

(bestie this is the members section, we go field by field, no skipping πŸ‘‘)

  • desc β€” the GPIO descriptor for this line. it's giving "who am I really" energy ✨
  • req β€” the corresponding line request
  • irq β€” the interrupt triggered in response to events on this GPIO
  • edflags β€” the edge flags, GPIO_V2_LINE_FLAG_EDGE_RISING and/or GPIO_V2_LINE_FLAG_EDGE_FALLING, indicating the edge detection applied πŸ’…
  • timestamp_ns β€” cache for the timestamp, storing it between hardirq and IRQ thread, used to bring the timestamp close to the actual event. lowkey the whole point is keeping the timestamp near the event, iykyk
  • req_seqno β€” the seqno for the current edge event in the sequence of events for the corresponding line request. this is drawn from the req.
  • line_seqno β€” the seqno for the current edge event in the sequence of events for this line.
  • work β€” the worker that implements software debouncing 🧚
  • sw_debounced β€” flag indicating if the software debouncer is active
  • level β€” the current debounced physical level of the line
  • hdesc β€” the Hardware Timestamp Engine (HTE) descriptor πŸ”₯
  • raw_level β€” the line level at the time of event
  • total_discard_seq β€” the running counter of the discarded events πŸ’€
  • last_seqno β€” the last sequence number before debounce period expires
heads up: hdesc, raw_level, total_discard_seq and last_seqno only exist when CONFIG_HTE is defined β€” they're tucked inside that #ifdef, so don't come for them if they're not there πŸ™ˆ

🌈 SEE ALSO 🌈


and that's the whole vibe check πŸ’– this one lives under ./drivers/gpio, dated October 2026, and yeah β€” it's still called struct line(9). slay, go read the source bestie ⭐

πŸ“¦ where this page comes from