STRUCT IMG_IR_DECODER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct img_ir_decoder(9) β€” the kernel API manual, bestie edition

okay so listen up 🫢 this one's from the Kernel API Manual and it's literally the whole scoop on struct img_ir_decoder β€” the decoder settings for an IR protocol. yes, that IR. remotes. the lil guy on your couch. let's get into it ✨


✨ NAME ✨

struct img_ir_decoder β€” the decoder settings for an IR protocol, periodt πŸ’…


🌸 SYNOPSIS 🌸

struct img_ir_decoder {
    u64 type;
    unsigned int                    tolerance;
    unsigned int                    unit;
    struct img_ir_timings           timings;
    struct img_ir_timings           rtimings;
    unsigned int                    repeat;
    struct img_ir_control           control;
    int (*scancode)(int len, u64 raw, u64 enabled_protocols, struct
img_ir_scancode_req *request);
    int (*filter)(const struct rc_scancode_filter *in, struct
img_ir_filter *out, u64 protocols);
 };

look at her. iconic. a whole struct just vibing there 🌈


πŸŽ€ Members πŸŽ€

time for the member-by-member vibe check, iykyk πŸ‘‘

  • type β€” a bitmap of the protocol types. yes, plural, she's multifaceted πŸ’–
  • tolerance β€” timing tolerance, expressed as a percentage (the default is 10% β€” she's generous but not too generous).
  • unit β€” the unit that timings are measured in, in nanoseconds (default is 1 us, so don't come at her with anything else without reading the docs first).
  • timings β€” the primary timings. the main character timings, if you will ⭐
  • rtimings β€” additional override timings, used while she's waiting for repeats. like a special little outfit change πŸ”₯
  • repeat β€” the maximum repeat interval (always in milliseconds β€” not nanoseconds, not vibes, milliseconds πŸ’€).
  • control β€” the control flags.
  • scancode β€” a pointer to a function that converts the IR data into a scancode. and listen β€” it must be safe to execute in interrupt context πŸ™ˆ that's not optional, that's the rule. she returns IMG_IR_SCANCODE to emit a new scancode, returns IMG_IR_REPEATCODE to repeat the previous code, and returns -errno (e.g. -EINVAL) on error. so like, three whole moods πŸ’…
  • filter β€” a pointer to a function that converts a scancode filter into a raw hardware filter. heads up: the minlen and maxlen fields will have already been initialised to the maximum range before your function even gets to peek at them πŸ‘€

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, bestie, they're all in the family 🫢 β€” the kernel file ./drivers/media/rc/img-ir/img-ir-hw.h, plus:


and that's the whole page, no notes πŸ’œ this lil beauty ships out of ./drivers/media/rc/img-ir and the manual's dated October 2026 β€” go off, king πŸ‘‘βœ¨

πŸ“¦ where this page comes from