STRUCT V4L2_SUBDEV_CORE_OPS(9)
π struct v4l2_subdev_core_ops(9) β from the Kernel API Manual, but make it fashion β¨
okay so picture this: you're writing a V4L2 subdev driver, and the kernel wants to know which core callbacks you're bringing to the function-pointer party. that's this struct, bestie. it's the ~core ops~ section of the whole subdev ops situation β let's get into it π
β¨ NAME β¨
struct v4l2_subdev_core_ops β literally the place where you define core ops callbacks for subdevs. no cap.
πΈ SYNOPSIS πΈ
struct v4l2_subdev_core_ops {
int (*log_status)(struct v4l2_subdev *sd);
int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n, struct
v4l2_subdev_io_pin_config *pincfg);
int (*init)(struct v4l2_subdev *sd, u32 val);
int (*load_fw)(struct v4l2_subdev *sd);
int (*reset)(struct v4l2_subdev *sd, u32 val);
int (*s_gpio)(struct v4l2_subdev *sd, u32 val);
long (*command)(struct v4l2_subdev *sd, unsigned int cmd, void
*arg);
long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
#ifdef CONFIG_COMPAT;
long (*compat_ioctl32)(struct v4l2_subdev *sd, unsigned int cmd,
unsigned long arg);
#endif;
#ifdef CONFIG_VIDEO_ADV_DEBUG;
int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register
*reg);
int (*s_register)(struct v4l2_subdev *sd, const struct
v4l2_dbg_register *reg);
#endif;
int (*s_power)(struct v4l2_subdev *sd, int on);
int (*interrupt_service_routine)(struct v4l2_subdev *sd, u32 status,
bool *handled);
int (*subscribe_event)(struct v4l2_subdev *sd, struct v4l2_fh *fh,
struct v4l2_event_subscription *sub);
int (*unsubscribe_event)(struct v4l2_subdev *sd, struct v4l2_fh *fh,
struct v4l2_event_subscription *sub);
};
yes the #ifdefs have semicolons after them, i don't make the rules, i just report them π
π¦ Members π¦
log_statusβ the callback that backs theVIDIOC_LOG_STATUSioctl handler code. your β¨status dumpβ¨ moment.s_io_pin_configβ configure one or more chip I/O pins, for chips that multiplex different internal signal pads out to IO pins. it takes a pointer to an array ofnpin configuration entries, one for each pin being configured. and heads up: this function could be called at times other than just subdevice initialization, so don't assume it's an init-only thing π«Άinitβ initialize the sensor registers to some sort of reasonable default values. π¨ but do not use for new drivers, and it should be removed in existing drivers. it's giving legacy, respectfully.load_fwβ load firmware. short, sweet, iconic. πresetβ the generic reset command. the argument selects which subsystems to reset, and passing0will always reset the whole chip. π¨ do not use for new drivers without discussing this first on the linux-media mailinglist. there should be no reason normally to reset a device. fr fr, like why are we resetting.s_gpioβ set GPIO pins. very simple right now; might need to be extended with a direction argument if needed. she's a work in progress and we love her πcommandβ called by in-kernel drivers in order to call functions internal to subdev drivers that have a separate callback.ioctlβ called at the end of the ioctl syscall handler at the V4L2 core. used to provide support for private ioctls used on the driver. private ioctls only, iykyk.compat_ioctl32β only shows up#ifdef CONFIG_COMPAT. called when a 32 bits application uses a 64 bits Kernel, in order to fix data passed from/to userspace. she's the compatibility icon πg_registerβ only shows up#ifdef CONFIG_VIDEO_ADV_DEBUG. callback forVIDIOC_DBG_G_REGISTERioctl handler code.s_registerβ same#ifdef CONFIG_VIDEO_ADV_DEBUGenergy. callback forVIDIOC_DBG_S_REGISTERioctl handler code.s_powerβ puts the subdevice in power saving mode (on == 0) or normal operation mode (on == 1). π¨ DEPRECATED, bestie. seeDocumentation/driver-api/media/camera-sensor.rst. thepre_streamonandpost_streamoffcallbacks can be used for e.g. setting the bus to LP-11 mode befores_streamis called.interrupt_service_routineβ called by the bridge chip's interrupt service handler, when an interrupt status has been raised due to this subdev, so that this subdev can handle the details. it may schedule work to be performed later. it must not sleep. π Called from an IRQ context. like, seriously, do not sleep in there.subscribe_eventβ used by the drivers to request the control framework that for it to be warned when the value of a control changes. bestie wants a notification and bestie shall receive one πunsubscribe_eventβ remove event subscription from the control framework. leaving the group chat, no hard feelings π
π SEE ALSO π
the entire extended fam, no gatekeeping π β Kernel file ./include/media/v4l2-subdev.h, struct v4l2_decode_vbi_line(9), enum v4l2_subdev_io_pin_bits(9), struct v4l2_subdev_io_pin_config(9), struct v4l2_subdev_tuner_ops(9), struct v4l2_subdev_audio_ops(9), struct v4l2_mbus_frame_desc_entry_csi2(9), enum v4l2_mbus_frame_desc_flags(9), struct v4l2_mbus_frame_desc_entry(9), enum v4l2_mbus_frame_desc_type(9), struct v4l2_mbus_frame_desc(9), enum v4l2_subdev_pre_streamon_flags(9), struct v4l2_subdev_video_ops(9), struct v4l2_subdev_vbi_ops(9), struct v4l2_subdev_sensor_ops(9), enum v4l2_subdev_ir_mode(9), struct v4l2_subdev_ir_parameters(9), struct v4l2_subdev_ir_ops(9), struct v4l2_subdev_pad_config(9), struct v4l2_subdev_stream_configs(9), struct v4l2_subdev_krouting(9), struct v4l2_subdev_state(9), struct v4l2_subdev_pad_ops(9), struct v4l2_subdev_ops(9), struct v4l2_subdev_internal_ops(9), struct v4l2_subdev_platform_data(9), struct v4l2_subdev(9), media_entity_to_v4l2_subdev(9), vdev_to_v4l2_subdev(9), struct v4l2_subdev_fh(9), to_v4l2_subdev_fh(9), v4l2_set_subdevdata(9), v4l2_get_subdevdata(9), v4l2_set_subdev_hostdata(9), v4l2_get_subdev_hostdata(9), v4l2_subdev_get_fwnode_pad_1_to_1(9), v4l2_subdev_link_validate_default(9), v4l2_subdev_link_validate(9), v4l2_subdev_has_pad_interdep(9), __v4l2_subdev_state_alloc(9), __v4l2_subdev_state_free(9), v4l2_subdev_init_finalize(9), v4l2_subdev_cleanup(9), v4l2_subdev_state_get_format(9), v4l2_subdev_state_get_crop(9), v4l2_subdev_state_get_compose(9), v4l2_subdev_state_get_interval(9), v4l2_subdev_get_fmt(9), v4l2_subdev_get_frame_interval(9), v4l2_subdev_set_routing(9), for_each_active_route(9), v4l2_subdev_set_routing_with_fmt(9), v4l2_subdev_routing_find_opposite_end(9), v4l2_subdev_state_get_opposite_stream_format(9), v4l2_subdev_state_xlate_streams(9), enum v4l2_subdev_routing_restriction(9), v4l2_subdev_routing_validate(9), v4l2_subdev_enable_streams(9), v4l2_subdev_disable_streams(9), v4l2_subdev_s_stream_helper(9), __v4l2_subdev_get_frame_desc_passthrough(9), v4l2_subdev_get_frame_desc_passthrough(9), v4l2_subdev_lock_state(9), v4l2_subdev_unlock_state(9), v4l2_subdev_lock_states(9), v4l2_subdev_unlock_states(9), v4l2_subdev_get_unlocked_active_state(9), v4l2_subdev_get_locked_active_state(9), v4l2_subdev_lock_and_get_active_state(9), v4l2_subdev_init(9), v4l2_subdev_call(9), v4l2_subdev_call_state_active(9), v4l2_subdev_call_state_try(9), v4l2_subdev_has_op(9), v4l2_subdev_notify_event(9), v4l2_subdev_is_streaming(9) π
okay that's the whole page, bestie, you ate that π«Ά β this came from the source ./include/media, version October 2026, and yeah, the header up there really is struct v4l2_subdev_core_ops(9) from the Kernel API Manual. go forth and be iconic, and please don't sleep in your IRQ handler π
β¨
π¦ 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