Lines Matching +full:capture +full:- +full:sd +full:- +full:lines
2 * V4L2 sub-device support header.
21 #include <linux/v4l2-subdev.h>
22 #include <media/media-entity.h>
23 #include <media/v4l2-async.h>
24 #include <media/v4l2-common.h>
25 #include <media/v4l2-dev.h>
26 #include <media/v4l2-fh.h>
27 #include <media/v4l2-mediabus.h>
52 * struct v4l2_decode_vbi_line - used to decode_vbi_line
58 * @line: Line number of the sliced VBI data (1-23)
69 * Sub-devices are devices that are connected somehow to the main bridge
77 * generic manner. Most operations that these sub-devices support fall in
106 * The ioctl ops is meant for generic ioctl-like commands. Depending on
107 * the use-case it might be better to use subdev-specific ops (currently
108 * not yet implemented) since ops provide proper type-checking.
112 * enum v4l2_subdev_io_pin_bits - Subdevice external IO pin configuration
119 * &struct v4l2_subdev_io_pin_config->value.
132 * struct v4l2_subdev_io_pin_config - Subdevice external IO pin configuration
138 * @value: Initial value for pin - e.g. GPIO output value
150 * struct v4l2_subdev_core_ops - Define core ops callbacks for subdevs
168 * drivers without discussing this first on the linux-media mailinglist.
198 int (*log_status)(struct v4l2_subdev *sd);
199 int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n,
201 int (*init)(struct v4l2_subdev *sd, u32 val);
202 int (*load_fw)(struct v4l2_subdev *sd);
203 int (*reset)(struct v4l2_subdev *sd, u32 val);
204 int (*s_gpio)(struct v4l2_subdev *sd, u32 val);
205 long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
207 long (*compat_ioctl32)(struct v4l2_subdev *sd, unsigned int cmd,
211 int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
212 int (*s_register)(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg);
214 int (*s_power)(struct v4l2_subdev *sd, int on);
215 int (*interrupt_service_routine)(struct v4l2_subdev *sd,
217 int (*subscribe_event)(struct v4l2_subdev *sd, struct v4l2_fh *fh,
219 int (*unsubscribe_event)(struct v4l2_subdev *sd, struct v4l2_fh *fh,
224 * struct v4l2_subdev_tuner_ops - Callbacks used when v4l device was opened
238 * freq->type must be filled in. Normally done by video_ioctl2()
245 * @s_tuner: callback for VIDIOC_S_TUNER() ioctl handler code. @vt->type must be
274 int (*standby)(struct v4l2_subdev *sd);
275 int (*s_radio)(struct v4l2_subdev *sd);
276 int (*s_frequency)(struct v4l2_subdev *sd, const struct v4l2_frequency *freq);
277 int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
278 int (*enum_freq_bands)(struct v4l2_subdev *sd, struct v4l2_frequency_band *band);
279 int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
280 int (*s_tuner)(struct v4l2_subdev *sd, const struct v4l2_tuner *vt);
281 int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
282 int (*s_modulator)(struct v4l2_subdev *sd, const struct v4l2_modulator *vm);
283 int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
284 int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config);
288 * struct v4l2_subdev_audio_ops - Callbacks used for audio-related settings
294 * -EINVAL is returned.
299 * If the frequency is not supported, then %-EINVAL is returned.
303 * Never attempt to use user-level input IDs (e.g. Composite, S-Video,
307 * The calling driver is responsible for mapping a user-level input to
314 int (*s_clock_freq)(struct v4l2_subdev *sd, u32 freq);
315 int (*s_i2s_clock_freq)(struct v4l2_subdev *sd, u32 freq);
316 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
317 int (*s_stream)(struct v4l2_subdev *sd, int enable);
321 * enum v4l2_mbus_frame_desc_entry - media bus frame description flags
324 * Indicates that &struct v4l2_mbus_frame_desc_entry->length field
336 * struct v4l2_mbus_frame_desc_entry - media bus frame description structure
353 * struct v4l2_mbus_frame_desc - media bus data frame description
363 * struct v4l2_subdev_video_ops - Callbacks used when v4l device was opened
372 * to 0. If the frequency is not supported, then -EINVAL is returned.
387 * CAPTURE device. This is ignored by video output devices.
390 * OUTPUT device. This is ignored by video capture devices.
417 * for compatibility with soc-camera drivers and should not be used by new
425 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
426 int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags);
427 int (*g_std)(struct v4l2_subdev *sd, v4l2_std_id *norm);
428 int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm);
429 int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std);
430 int (*g_std_output)(struct v4l2_subdev *sd, v4l2_std_id *std);
431 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std);
432 int (*g_tvnorms)(struct v4l2_subdev *sd, v4l2_std_id *std);
433 int (*g_tvnorms_output)(struct v4l2_subdev *sd, v4l2_std_id *std);
434 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status);
435 int (*s_stream)(struct v4l2_subdev *sd, int enable);
436 int (*g_pixelaspect)(struct v4l2_subdev *sd, struct v4l2_fract *aspect);
437 int (*g_frame_interval)(struct v4l2_subdev *sd,
439 int (*s_frame_interval)(struct v4l2_subdev *sd,
441 int (*s_dv_timings)(struct v4l2_subdev *sd,
443 int (*g_dv_timings)(struct v4l2_subdev *sd,
445 int (*query_dv_timings)(struct v4l2_subdev *sd,
447 int (*g_mbus_config)(struct v4l2_subdev *sd,
449 int (*s_mbus_config)(struct v4l2_subdev *sd,
451 int (*s_rx_buffer)(struct v4l2_subdev *sd, void *buf,
456 * struct v4l2_subdev_vbi_ops - Callbacks used when v4l device was opened
476 * the readback register contains invalid or erroneous data %-EIO is
491 int (*decode_vbi_line)(struct v4l2_subdev *sd, struct v4l2_decode_vbi_line *vbi_line);
492 int (*s_vbi_data)(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *vbi_data);
493 int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data);
494 int (*g_sliced_vbi_cap)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_cap *cap);
495 int (*s_raw_fmt)(struct v4l2_subdev *sd, struct v4l2_vbi_format *fmt);
496 int (*g_sliced_fmt)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt);
497 int (*s_sliced_fmt)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt);
501 * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations
502 * @g_skip_top_lines: number of lines at the top of the image to be skipped.
504 * several top lines of the output image, or which send their
511 int (*g_skip_top_lines)(struct v4l2_subdev *sd, u32 *lines);
512 int (*g_skip_frames)(struct v4l2_subdev *sd, u32 *frames);
516 * enum v4l2_subdev_ir_mode- describes the type of IR supported
525 * struct v4l2_subdev_ir_parameters - Parameters for IR TX or TX
574 * struct v4l2_subdev_ir_ops - operations for IR subdevices
577 * The semantics are similar to a non-blocking read() call.
586 * settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
593 * The semantics are similar to a non-blocking write() call.
602 * settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
610 int (*rx_read)(struct v4l2_subdev *sd, u8 *buf, size_t count,
613 int (*rx_g_parameters)(struct v4l2_subdev *sd,
615 int (*rx_s_parameters)(struct v4l2_subdev *sd,
619 int (*tx_write)(struct v4l2_subdev *sd, u8 *buf, size_t count,
622 int (*tx_g_parameters)(struct v4l2_subdev *sd,
624 int (*tx_s_parameters)(struct v4l2_subdev *sd,
629 * struct v4l2_subdev_pad_config - Used for storing subdev pad information.
646 * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations
684 int (*init_cfg)(struct v4l2_subdev *sd,
686 int (*enum_mbus_code)(struct v4l2_subdev *sd,
689 int (*enum_frame_size)(struct v4l2_subdev *sd,
692 int (*enum_frame_interval)(struct v4l2_subdev *sd,
695 int (*get_fmt)(struct v4l2_subdev *sd,
698 int (*set_fmt)(struct v4l2_subdev *sd,
701 int (*get_selection)(struct v4l2_subdev *sd,
704 int (*set_selection)(struct v4l2_subdev *sd,
707 int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
708 int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
709 int (*dv_timings_cap)(struct v4l2_subdev *sd,
711 int (*enum_dv_timings)(struct v4l2_subdev *sd,
714 int (*link_validate)(struct v4l2_subdev *sd, struct media_link *link,
718 int (*get_frame_desc)(struct v4l2_subdev *sd, unsigned int pad,
720 int (*set_frame_desc)(struct v4l2_subdev *sd, unsigned int pad,
725 * struct v4l2_subdev_ops - Subdev operations
748 * struct v4l2_subdev_internal_ops - V4L2 subdev internal ops
765 int (*registered)(struct v4l2_subdev *sd);
766 void (*unregistered)(struct v4l2_subdev *sd);
767 int (*open)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh);
768 int (*close)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh);
785 * struct v4l2_subdev_platform_data - regulators config struct
789 * @host_priv: Per-subdevice data, specific for a certain video host device
799 * struct v4l2_subdev - describes a V4L2 sub-device
802 * @list: List of sub-devices
804 * @owner_v4l2_dev: true if the &sd->owner matches the owner of @v4l2_dev->dev
807 * %V4L2_SUBDEV_FL_IS_I2C - Set this flag if this subdev is a i2c device;
808 * %V4L2_SUBDEV_FL_IS_SPI - Set this flag if this subdev is a spi device;
809 * %V4L2_SUBDEV_FL_HAS_DEVNODE - Set this flag if this subdev needs a
811 * %V4L2_SUBDEV_FL_HAS_EVENTS - Set this flag if this subdev generates
819 * @name: Name of the sub-device. Please notice that the name must be unique.
820 * @grp_id: can be used to group similar subdevs. Value is driver-specific
827 * either dev->of_node->fwnode or dev->fwnode (whichever is non-NULL).
828 * @async_list: Links this subdev to a global subdev_list or @notifier->done
832 * @subdev_notifier: A sub-device notifier implicitly registered for the sub-
837 * stand-alone or embedded in a larger struct.
870 * media_entity_to_v4l2_subdev - Returns a &struct v4l2_subdev from
885 * vdev_to_v4l2_subdev - Returns a &struct v4l2_subdev from
894 * struct v4l2_subdev_fh - Used for storing subdev information per file handle
907 * to_v4l2_subdev_fh - Returns a &struct v4l2_subdev_fh from
918 * v4l2_subdev_get_try_format - ancillary routine to call
919 * &struct v4l2_subdev_pad_config->try_fmt
921 * @sd: pointer to &struct v4l2_subdev
926 *v4l2_subdev_get_try_format(struct v4l2_subdev *sd, in v4l2_subdev_get_try_format() argument
930 if (WARN_ON(pad >= sd->entity.num_pads)) in v4l2_subdev_get_try_format()
936 * v4l2_subdev_get_try_crop - ancillary routine to call
937 * &struct v4l2_subdev_pad_config->try_crop
939 * @sd: pointer to &struct v4l2_subdev
944 *v4l2_subdev_get_try_crop(struct v4l2_subdev *sd, in v4l2_subdev_get_try_crop() argument
948 if (WARN_ON(pad >= sd->entity.num_pads)) in v4l2_subdev_get_try_crop()
954 * v4l2_subdev_get_try_crop - ancillary routine to call
955 * &struct v4l2_subdev_pad_config->try_compose
957 * @sd: pointer to &struct v4l2_subdev
962 *v4l2_subdev_get_try_compose(struct v4l2_subdev *sd, in v4l2_subdev_get_try_compose() argument
966 if (WARN_ON(pad >= sd->entity.num_pads)) in v4l2_subdev_get_try_compose()
975 * v4l2_set_subdevdata - Sets V4L2 dev private device data
977 * @sd: pointer to &struct v4l2_subdev
980 static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p) in v4l2_set_subdevdata() argument
982 sd->dev_priv = p; in v4l2_set_subdevdata()
986 * v4l2_get_subdevdata - Gets V4L2 dev private device data
988 * @sd: pointer to &struct v4l2_subdev
992 static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd) in v4l2_get_subdevdata() argument
994 return sd->dev_priv; in v4l2_get_subdevdata()
998 * v4l2_set_subdev_hostdata - Sets V4L2 dev private host data
1000 * @sd: pointer to &struct v4l2_subdev
1003 static inline void v4l2_set_subdev_hostdata(struct v4l2_subdev *sd, void *p) in v4l2_set_subdev_hostdata() argument
1005 sd->host_priv = p; in v4l2_set_subdev_hostdata()
1009 * v4l2_get_subdev_hostdata - Gets V4L2 dev private data
1011 * @sd: pointer to &struct v4l2_subdev
1015 static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd) in v4l2_get_subdev_hostdata() argument
1017 return sd->host_priv; in v4l2_get_subdev_hostdata()
1023 * v4l2_subdev_link_validate_default - validates a media link
1025 * @sd: pointer to &struct v4l2_subdev
1033 int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd,
1039 * v4l2_subdev_link_validate - validates a media link
1052 * v4l2_subdev_alloc_pad_config - Allocates memory for pad config
1054 * @sd: pointer to struct v4l2_subdev
1057 v4l2_subdev_pad_config *v4l2_subdev_alloc_pad_config(struct v4l2_subdev *sd);
1060 * v4l2_subdev_free_pad_config - Frees memory allocated by
1069 * v4l2_subdev_init - initializes the sub-device struct
1071 * @sd: pointer to the &struct v4l2_subdev to be initialized
1074 void v4l2_subdev_init(struct v4l2_subdev *sd,
1078 * v4l2_subdev_call - call an operation of a v4l2_subdev.
1080 * @sd: pointer to the &struct v4l2_subdev
1088 * Example: err = v4l2_subdev_call(sd, video, s_std, norm);
1090 #define v4l2_subdev_call(sd, o, f, args...) \ argument
1093 if (!(sd)) \
1094 __result = -ENODEV; \
1095 else if (!((sd)->ops->o && (sd)->ops->o->f)) \
1096 __result = -ENOIOCTLCMD; \
1098 __result = (sd)->ops->o->f((sd), ##args); \
1103 * v4l2_subdev_has_op - Checks if a subdev defines a certain operation.
1105 * @sd: pointer to the &struct v4l2_subdev
1110 #define v4l2_subdev_has_op(sd, o, f) \ argument
1111 ((sd)->ops->o && (sd)->ops->o->f)
1114 * v4l2_subdev_notify_event() - Delivers event notification for subdevice
1115 * @sd: The subdev for which to deliver the event
1123 void v4l2_subdev_notify_event(struct v4l2_subdev *sd,