STRUCT CX25840_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

Okay so bestie, welcome to the Kernel API Manual β€” today's main character is struct cx25840_state, and it's literally the private-data glow-up for a device instance. Think of it as the chip's personal group chat: everything it needs to remember about itself lives right here. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

struct cx25840_state {
    struct i2c_client *c;
    struct v4l2_subdev sd;
    struct v4l2_ctrl_handler hdl;
    struct {
      struct v4l2_ctrl *volume;
      struct v4l2_ctrl *mute;
    };
    int pvr150_workaround;
    bool generic_mode;
    int radio;
    v4l2_std_id std;
    enum cx25840_video_input vid_input;
    u32 vid_config;
    enum cx25840_audio_input aud_input;
    u32 audclk_freq;
    int audmode;
    int vbi_line_offset;
    enum cx25840_model id;
    u32 rev;
    int is_initialized;
    unsigned int vbi_regs_offset;
    wait_queue_head_t fw_wait;
    struct work_struct fw_work;
    struct cx25840_ir_state *ir_state;
  #if defined(CONFIG_MEDIA_CONTROLLER);
    struct media_pad        pads[CX25840_NUM_PADS];
  #endif;
};

No cap, that's the whole struct, copy-paste sacred. 🫢


🌸 Members 🌸

  • c β€” the i2c_client struct that represents this device. it's giving "this is me" energy.
  • sd β€” our own V4L2 sub-device πŸŽ€
  • hdl β€” our V4L2 control handler, holding it down.
  • {unnamed_struct} β€” an anonymous struct, lowkey mysterious, we love a nameless icon.
    • volume β€” the audio volume V4L2 control (and ngl, it only exists on non-cx2583x devices).
    • mute β€” the audio mute V4L2 control (same deal, non-cx2583x devices only).
  • pvr150_workaround β€” whether we enable the workaround for that Hauppauge PVR150 hardware bug where audio just… drops out 😭 iconic flop behavior from the hardware, not us.
  • generic_mode β€” whether we disable the ivtv-specific hacks. this mode gets turned on when the bridge driver calls the cx25840 subdevice init core op.
  • radio β€” set if we're currently in radio mode; otherwise the current mode is non-radio (that is, video). pick a lane bestie πŸ“»
  • std β€” the currently set video standard.
  • vid_input β€” the currently set video input.
  • vid_config β€” the currently set video output configuration. heads up: this one is only used in generic mode.
  • aud_input β€” the currently set audio input.
  • audclk_freq β€” the currently set audio sample rate 🎡
  • audmode β€” the currently set audio mode (when in non-radio mode).
  • vbi_line_offset β€” the VBI line number offset.
  • id β€” the exact device model. the government name, fr fr.
  • rev β€” the raw device id read from the chip.
  • is_initialized β€” whether we've already loaded firmware into the chip and initialized it. basically the "have we done the thing yet" flag ✨
  • vbi_regs_offset β€” the offset of the VBI regs.
  • fw_wait β€” a wait queue that wakes an initialization function up when firmware loading (which happens on a separate workqueue) finishes. it's the "text me when you're done" queue 🫢
  • fw_work β€” the actual work that loads the firmware on a separate workqueue.
  • ir_state β€” a pointer to the chip's IR controller private data.
  • pads β€” array of supported chip pads (currently only a stub β€” she's a work in progress, we support her journey 🧚).

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./drivers/media/i2c/cx25840/cx25840-core.h

πŸ’€ friendly reminder: pads is literally just a stub right now. don't come for her.

and that's the whole vibe check, bestie β€” this page came from ./drivers/media/i2c/cx25840 and it's dated October 2026. slay, go read the kernel πŸ’…βœ¨

πŸ“¦ where this page comes from