STRUCT V4L2_SUBDEV_IR_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct v4l2_subdev_ir_ops(9) πŸŽ€

okay bestie, so this one's straight out of the Kernel API Manual and it's literally the whole vibe guide for IR subdevices β€” like, the function-pointer table that makes infrared stuff happen ✨ no cap, it's giving "small struct, huge responsibility" πŸ’…


✨ NAME ✨

struct v4l2_subdev_ir_ops β€” operations for IR subdevices πŸ¦‹


🌸 SYNOPSIS 🌸

struct v4l2_subdev_ir_ops {
    int (*rx_read)(struct v4l2_subdev *sd, u8 *buf, size_t count, ssize_t *num);
    int (*rx_g_parameters)(struct v4l2_subdev *sd, struct v4l2_subdev_ir_parameters *params);
    int (*rx_s_parameters)(struct v4l2_subdev *sd, struct v4l2_subdev_ir_parameters *params);
    int (*tx_write)(struct v4l2_subdev *sd, u8 *buf, size_t count, ssize_t *num);
    int (*tx_g_parameters)(struct v4l2_subdev *sd, struct v4l2_subdev_ir_parameters *params);
    int (*tx_s_parameters)(struct v4l2_subdev *sd, struct v4l2_subdev_ir_parameters *params);
};

🫢 Members 🫢

πŸ’– rx_read

Reads received codes or pulse width data. The semantics are similar to a non-blocking read call. iykyk 😌

πŸ’– rx_g_parameters

Get the current operating parameters and state of the IR receiver.

πŸ’– rx_s_parameters

Set the current operating parameters and state of the IR receiver.

okay so hear me out β€” it is recommended to call [rt]x_g_parameters first to fill out the current state, and only change the fields that need to be changed. Upon return, the actual device operating parameters and state will be returned.

and like, note that hardware limitations may prevent the actual settings from matching the requested settings β€” e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz was requested. your girl tried her best, the silicon said no 😭

one exception though: when the shutdown parameter is true. The last used operational parameters will be returned, but the actual state of the hardware be different to minimize power consumption and processing when shutdown is true. lowkey iconic efficiency move tbh πŸ”₯

πŸ’– tx_write

Writes codes or pulse width data for transmission. The semantics are similar to a non-blocking write call. periodt πŸ“‘

πŸ’– tx_g_parameters

Get the current operating parameters and state of the IR transmitter.

πŸ’– tx_s_parameters

Set the current operating parameters and state of the IR transmitter.

same deal as the receiver, bestie πŸ’« it is recommended to call [rt]x_g_parameters first to fill out the current state, and only change the fields that need to be changed. Upon return, the actual device operating parameters and state will be returned.

Note that hardware limitations may prevent the actual settings from matching the requested settings β€” e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz was requested. not the hardware being a little extra πŸ™ˆ

and again the exception: when the shutdown parameter is true. The last used operational parameters will be returned, but the actual state of the hardware be different to minimize power consumption and processing when shutdown is true. we love a power-conscious king πŸ‘‘


🌈 SEE ALSO 🌈

Kernel file ./include/media/v4l2-subdev.h β€” and yes, the girlies who wrote all this also wrote these, go say hi πŸ’œ


aaaand that's the whole page bestie, mwah πŸ’‹ this little number lives at ./include/media, it's dated October 2026, and it's filed under struct v4l2_subdev_ir_ops(9) β€” go off, infrared icon πŸ‘‘πŸ’…βœ¨

πŸ“¦ where this page comes from