STRUCT LINE(9)
β¨ 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 requestirqβ the interrupt triggered in response to events on this GPIOedflagsβ the edge flags,GPIO_V2_LINE_FLAG_EDGE_RISINGand/orGPIO_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, iykykreq_seqnoβ the seqno for the current edge event in the sequence of events for the corresponding line request. this is drawn from thereq.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 activelevelβ the current debounced physical level of the linehdescβ the Hardware Timestamp Engine (HTE) descriptor π₯raw_levelβ the line level at the time of eventtotal_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_seqandlast_seqnoonly exist whenCONFIG_HTEis defined β they're tucked inside that#ifdef, so don't come for them if they're not there π
π SEE ALSO π
- Kernel file
./drivers/gpio/gpiolib-cdev.c struct linehandle_state(9)struct linereq(9)struct lineevent_state(9)gpio_chrdev_open(9)gpio_chrdev_release(9)
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
- 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