STRUCT CX25840_STATE(9)
π 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β thei2c_clientstruct 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 thecx25840subdevice 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
- 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