STRUCT CEC_PIN_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct cec_pin_ops(9) πŸ’…

okay so this is from the Kernel API Manual, bestie β€” it's the page about struct cec_pin_ops, and it's literally the low-level CEC pin operations. no cap, this is the good stuff.


✨ NAME ✨

struct cec_pin_ops β€” low-level CEC pin operations πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole struct, exactly as it lives, don't touch a character:

struct cec_pin_ops {
    int (*read)(struct cec_adapter *adap);
    void (*low)(struct cec_adapter *adap);
    void (*high)(struct cec_adapter *adap);
    bool (*enable_irq)(struct cec_adapter *adap);
    void (*disable_irq)(struct cec_adapter *adap);
    void (*free)(struct cec_adapter *adap);
    void (*status)(struct cec_adapter *adap, struct seq_file *file);
    int (*read_hpd)(struct cec_adapter *adap);
    int (*read_5v)(struct cec_adapter *adap);
    int (*received)(struct cec_adapter *adap, struct cec_msg *msg);
};

🌸 Members 🌸

okay now let's meet the whole cast, one by one, main character energy only:

  • read β€” reads the CEC pin, iconic behaviour. it returns > 0 if the pin is high, 0 if it's low, or an error if the return is negative. 🫢
  • low β€” drives the CEC pin low. that's it, that's the job.
  • high β€” stops driving the CEC pin. then the pull-up drives the pin high β€” unless someone else is out here driving the pin low, in which case, not so much. πŸ’€
  • enable_irq β€” optional! turns on the interrupt so you can detect changes in pin voltage. ✨
  • disable_irq β€” optional! turns that interrupt back off.
  • free β€” optional. frees any allocated resources. it gets called when the adapter is deleted, so like, cleanup era. 🧹
  • status β€” optional, logs status information. very "let me tell you what's going on" of it.
  • read_hpd β€” optional. reads the HPD pin. returns > 0 if high, 0 if low, or an error if negative.
  • read_5v β€” optional. reads the 5V pin. returns > 0 if high, 0 if low, or an error if negative.
  • received β€” optional. the high-level CEC message callback, and it's the one that lets the driver process CEC messages. lowkey the moment of the whole struct. πŸ”₯

πŸ’œ Description πŸ’œ

so the tea is: these operations β€” except for the received op, bestie, pay attention β€” are used by the cec pin framework to manipulate the CEC pin. that's the whole vibe check. πŸ‘‘


🌈 SEE ALSO 🌈

go look at the kernel file ./include/media/cec-pin.h, plus:


and that's the page!! πŸŽ€ sign-off time: this one lives in ./include/media, dated October 2026 β€” mwah, slay, periodt. πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from