Lines Matching +full:capture +full:- +full:sd +full:- +full:lines

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * V4L2 sub-device support header.
12 #include <linux/v4l2-subdev.h>
13 #include <media/media-entity.h>
14 #include <media/v4l2-async.h>
15 #include <media/v4l2-common.h>
16 #include <media/v4l2-dev.h>
17 #include <media/v4l2-fh.h>
18 #include <media/v4l2-mediabus.h>
44 * struct v4l2_decode_vbi_line - used to decode_vbi_line
50 * @line: Line number of the sliced VBI data (1-23)
61 * Sub-devices are devices that are connected somehow to the main bridge
69 * generic manner. Most operations that these sub-devices support fall in
98 * The ioctl ops is meant for generic ioctl-like commands. Depending on
99 * the use-case it might be better to use subdev-specific ops (currently
100 * not yet implemented) since ops provide proper type-checking.
104 * enum v4l2_subdev_io_pin_bits - Subdevice external IO pin configuration
111 * &struct v4l2_subdev_io_pin_config->value.
124 * struct v4l2_subdev_io_pin_config - Subdevice external IO pin configuration
130 * @value: Initial value for pin - e.g. GPIO output value
142 * struct v4l2_subdev_core_ops - Define core ops callbacks for subdevs
160 * drivers without discussing this first on the linux-media mailinglist.
166 * @command: called by in-kernel drivers in order to call functions internal
181 * Documentation/driver-api/media/camera-sensor.rst . pre_streamon and
182 * post_streamoff callbacks can be used for e.g. setting the bus to LP-11
196 int (*log_status)(struct v4l2_subdev *sd);
197 int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n,
199 int (*init)(struct v4l2_subdev *sd, u32 val);
200 int (*load_fw)(struct v4l2_subdev *sd);
201 int (*reset)(struct v4l2_subdev *sd, u32 val);
202 int (*s_gpio)(struct v4l2_subdev *sd, u32 val);
203 long (*command)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
204 long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
206 long (*compat_ioctl32)(struct v4l2_subdev *sd, unsigned int cmd,
210 int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
211 int (*s_register)(struct v4l2_subdev *sd, const struct v4l2_dbg_register *reg);
213 int (*s_power)(struct v4l2_subdev *sd, int on);
214 int (*interrupt_service_routine)(struct v4l2_subdev *sd,
216 int (*subscribe_event)(struct v4l2_subdev *sd, struct v4l2_fh *fh,
218 int (*unsubscribe_event)(struct v4l2_subdev *sd, struct v4l2_fh *fh,
223 * struct v4l2_subdev_tuner_ops - Callbacks used when v4l device was opened
237 * freq->type must be filled in. Normally done by video_ioctl2()
244 * @s_tuner: callback for VIDIOC_S_TUNER() ioctl handler code. @vt->type must be
273 int (*standby)(struct v4l2_subdev *sd);
274 int (*s_radio)(struct v4l2_subdev *sd);
275 int (*s_frequency)(struct v4l2_subdev *sd, const struct v4l2_frequency *freq);
276 int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
277 int (*enum_freq_bands)(struct v4l2_subdev *sd, struct v4l2_frequency_band *band);
278 int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
279 int (*s_tuner)(struct v4l2_subdev *sd, const struct v4l2_tuner *vt);
280 int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
281 int (*s_modulator)(struct v4l2_subdev *sd, const struct v4l2_modulator *vm);
282 int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
283 int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config);
287 * struct v4l2_subdev_audio_ops - Callbacks used for audio-related settings
293 * -EINVAL is returned.
298 * If the frequency is not supported, then %-EINVAL is returned.
302 * Never attempt to use user-level input IDs (e.g. Composite, S-Video,
306 * The calling driver is responsible for mapping a user-level input to
313 int (*s_clock_freq)(struct v4l2_subdev *sd, u32 freq);
314 int (*s_i2s_clock_freq)(struct v4l2_subdev *sd, u32 freq);
315 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
316 int (*s_stream)(struct v4l2_subdev *sd, int enable);
322 * @vc: CSI-2 virtual channel
323 * @dt: CSI-2 data type ID
331 * enum v4l2_mbus_frame_desc_flags - media bus frame description flags
334 * Indicates that &struct v4l2_mbus_frame_desc_entry->length field
346 * struct v4l2_mbus_frame_desc_entry - media bus frame description structure
354 * @bus: Bus-specific frame descriptor parameters
355 * @bus.csi2: CSI-2-specific bus configuration
374 * enum v4l2_mbus_frame_desc_type - media bus frame description type
382 * CSI-2 media bus. Frame desc parameters must be set in
383 * &struct v4l2_mbus_frame_desc_entry->csi2.
392 * struct v4l2_mbus_frame_desc - media bus data frame description
404 * enum v4l2_subdev_pre_streamon_flags - Flags for pre_streamon subdev core op
406 * @V4L2_SUBDEV_PRE_STREAMON_FL_MANUAL_LP: Set the transmitter to either LP-11
407 * or LP-111 mode before call to s_stream().
414 * struct v4l2_subdev_video_ops - Callbacks used when v4l device was opened
423 * to 0. If the frequency is not supported, then -EINVAL is returned.
438 * CAPTURE device. This is ignored by video output devices.
441 * OUTPUT device. This is ignored by video capture devices.
447 * sub-device. Failure on stop will remove any resources acquired in
451 * v4l2-subdev.c.
470 * initialising the bus. Current usage is to set a CSI-2 transmitter to
471 * LP-11 or LP-111 mode before streaming. See &enum
475 * indicated by the flags argument. In particular, -EACCES indicates lack
483 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
484 int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags);
485 int (*g_std)(struct v4l2_subdev *sd, v4l2_std_id *norm);
486 int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm);
487 int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std);
488 int (*g_std_output)(struct v4l2_subdev *sd, v4l2_std_id *std);
489 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std);
490 int (*g_tvnorms)(struct v4l2_subdev *sd, v4l2_std_id *std);
491 int (*g_tvnorms_output)(struct v4l2_subdev *sd, v4l2_std_id *std);
492 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status);
493 int (*s_stream)(struct v4l2_subdev *sd, int enable);
494 int (*g_pixelaspect)(struct v4l2_subdev *sd, struct v4l2_fract *aspect);
495 int (*s_rx_buffer)(struct v4l2_subdev *sd, void *buf,
497 int (*pre_streamon)(struct v4l2_subdev *sd, u32 flags);
498 int (*post_streamoff)(struct v4l2_subdev *sd);
502 * struct v4l2_subdev_vbi_ops - Callbacks used when v4l device was opened
522 * the readback register contains invalid or erroneous data %-EIO is
537 int (*decode_vbi_line)(struct v4l2_subdev *sd, struct v4l2_decode_vbi_line *vbi_line);
538 int (*s_vbi_data)(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *vbi_data);
539 int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data);
540 int (*g_sliced_vbi_cap)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_cap *cap);
541 int (*s_raw_fmt)(struct v4l2_subdev *sd, struct v4l2_vbi_format *fmt);
542 int (*g_sliced_fmt)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt);
543 int (*s_sliced_fmt)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt);
547 * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations
548 * @g_skip_top_lines: number of lines at the top of the image to be skipped.
550 * several top lines of the output image, or which send their
557 int (*g_skip_top_lines)(struct v4l2_subdev *sd, u32 *lines);
558 int (*g_skip_frames)(struct v4l2_subdev *sd, u32 *frames);
562 * enum v4l2_subdev_ir_mode- describes the type of IR supported
571 * struct v4l2_subdev_ir_parameters - Parameters for IR TX or TX
620 * struct v4l2_subdev_ir_ops - operations for IR subdevices
623 * The semantics are similar to a non-blocking read() call.
632 * settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
639 * The semantics are similar to a non-blocking write() call.
648 * settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
656 int (*rx_read)(struct v4l2_subdev *sd, u8 *buf, size_t count,
659 int (*rx_g_parameters)(struct v4l2_subdev *sd,
661 int (*rx_s_parameters)(struct v4l2_subdev *sd,
665 int (*tx_write)(struct v4l2_subdev *sd, u8 *buf, size_t count,
668 int (*tx_g_parameters)(struct v4l2_subdev *sd,
670 int (*tx_s_parameters)(struct v4l2_subdev *sd,
675 * struct v4l2_subdev_pad_config - Used for storing subdev pad information.
690 * struct v4l2_subdev_stream_config - Used for storing stream configuration.
714 * struct v4l2_subdev_stream_configs - A collection of stream configs.
725 * struct v4l2_subdev_krouting - subdev routing table
740 * struct v4l2_subdev_state - Used for storing subdev state information.
744 * @sd: the sub-device which the state is related to
757 struct v4l2_subdev *sd; member
764 * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations
814 * @get_mbus_config: get the media bus configuration of a remote sub-device.
816 * firmware interface at sub-device probe time, immediately
818 * driver. Remote sub-devices (usually video receivers) shall
821 * Callers should make sure they get the most up-to-date as
838 * V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask
848 * V4L2_SUBDEV_CAP_STREAMS sub-device capability flag can ignore the mask
852 int (*enum_mbus_code)(struct v4l2_subdev *sd,
855 int (*enum_frame_size)(struct v4l2_subdev *sd,
858 int (*enum_frame_interval)(struct v4l2_subdev *sd,
861 int (*get_fmt)(struct v4l2_subdev *sd,
864 int (*set_fmt)(struct v4l2_subdev *sd,
867 int (*get_selection)(struct v4l2_subdev *sd,
870 int (*set_selection)(struct v4l2_subdev *sd,
873 int (*get_frame_interval)(struct v4l2_subdev *sd,
876 int (*set_frame_interval)(struct v4l2_subdev *sd,
879 int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
880 int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
881 int (*s_dv_timings)(struct v4l2_subdev *sd, unsigned int pad,
883 int (*g_dv_timings)(struct v4l2_subdev *sd, unsigned int pad,
885 int (*query_dv_timings)(struct v4l2_subdev *sd, unsigned int pad,
887 int (*dv_timings_cap)(struct v4l2_subdev *sd,
889 int (*enum_dv_timings)(struct v4l2_subdev *sd,
892 int (*link_validate)(struct v4l2_subdev *sd, struct media_link *link,
896 int (*get_frame_desc)(struct v4l2_subdev *sd, unsigned int pad,
898 int (*set_frame_desc)(struct v4l2_subdev *sd, unsigned int pad,
900 int (*get_mbus_config)(struct v4l2_subdev *sd, unsigned int pad,
902 int (*set_routing)(struct v4l2_subdev *sd,
906 int (*enable_streams)(struct v4l2_subdev *sd,
909 int (*disable_streams)(struct v4l2_subdev *sd,
915 * struct v4l2_subdev_ops - Subdev operations
938 * struct v4l2_subdev_internal_ops - V4L2 subdev internal ops
955 * filehandle to the v4l-subdevX device node was closed. If no device
956 * node was created for this sub-device, then the @release callback
960 * sub-device that sets the V4L2_SUBDEV_FL_HAS_DEVNODE flag.
967 int (*init_state)(struct v4l2_subdev *sd,
969 int (*registered)(struct v4l2_subdev *sd);
970 void (*unregistered)(struct v4l2_subdev *sd);
971 int (*open)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh);
972 int (*close)(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh);
973 void (*release)(struct v4l2_subdev *sd);
993 * - Centrally managed subdev active state is enabled
994 * - Legacy pad config is _not_ supported (state->pads is NULL)
995 * - Routing ioctls are available
996 * - Multiple streams per pad are supported
1003 * struct v4l2_subdev_platform_data - regulators config struct
1007 * @host_priv: Per-subdevice data, specific for a certain video host device
1017 * struct v4l2_subdev - describes a V4L2 sub-device
1020 * @list: List of sub-devices
1022 * @owner_v4l2_dev: true if the &sd->owner matches the owner of @v4l2_dev->dev
1025 * %V4L2_SUBDEV_FL_IS_I2C - Set this flag if this subdev is a i2c device;
1026 * %V4L2_SUBDEV_FL_IS_SPI - Set this flag if this subdev is a spi device;
1027 * %V4L2_SUBDEV_FL_HAS_DEVNODE - Set this flag if this subdev needs a
1029 * %V4L2_SUBDEV_FL_HAS_EVENTS - Set this flag if this subdev generates
1037 * @name: Name of the sub-device. Please notice that the name must be unique.
1038 * @grp_id: can be used to group similar subdevs. Value is driver-specific
1045 * either dev->of_node->fwnode or dev->fwnode (whichever is non-NULL).
1047 * @notifier->done_list list.
1050 * @subdev_notifier: A sub-device notifier implicitly registered for the sub-
1069 * stand-alone or embedded in a larger struct.
1120 * media_entity_to_v4l2_subdev - Returns a &struct v4l2_subdev from
1135 * vdev_to_v4l2_subdev - Returns a &struct v4l2_subdev from
1144 * struct v4l2_subdev_fh - Used for storing subdev information per file handle
1161 * to_v4l2_subdev_fh - Returns a &struct v4l2_subdev_fh from
1172 * v4l2_set_subdevdata - Sets V4L2 dev private device data
1174 * @sd: pointer to &struct v4l2_subdev
1177 static inline void v4l2_set_subdevdata(struct v4l2_subdev *sd, void *p) in v4l2_set_subdevdata() argument
1179 sd->dev_priv = p; in v4l2_set_subdevdata()
1183 * v4l2_get_subdevdata - Gets V4L2 dev private device data
1185 * @sd: pointer to &struct v4l2_subdev
1189 static inline void *v4l2_get_subdevdata(const struct v4l2_subdev *sd) in v4l2_get_subdevdata() argument
1191 return sd->dev_priv; in v4l2_get_subdevdata()
1195 * v4l2_set_subdev_hostdata - Sets V4L2 dev private host data
1197 * @sd: pointer to &struct v4l2_subdev
1200 static inline void v4l2_set_subdev_hostdata(struct v4l2_subdev *sd, void *p) in v4l2_set_subdev_hostdata() argument
1202 sd->host_priv = p; in v4l2_set_subdev_hostdata()
1206 * v4l2_get_subdev_hostdata - Gets V4L2 dev private data
1208 * @sd: pointer to &struct v4l2_subdev
1212 static inline void *v4l2_get_subdev_hostdata(const struct v4l2_subdev *sd) in v4l2_get_subdev_hostdata() argument
1214 return sd->host_priv; in v4l2_get_subdev_hostdata()
1220 * v4l2_subdev_get_fwnode_pad_1_to_1 - Get pad number from a subdev fwnode
1237 * v4l2_subdev_link_validate_default - validates a media link
1239 * @sd: pointer to &struct v4l2_subdev
1247 int v4l2_subdev_link_validate_default(struct v4l2_subdev *sd,
1253 * v4l2_subdev_link_validate - validates a media link
1263 * The function can be used as a drop-in &media_entity_ops.link_validate
1272 * v4l2_subdev_has_pad_interdep - MC has_pad_interdep implementation for subdevs
1290 * __v4l2_subdev_state_alloc - allocate v4l2_subdev_state
1292 * @sd: pointer to &struct v4l2_subdev for which the state is being allocated.
1300 struct v4l2_subdev_state *__v4l2_subdev_state_alloc(struct v4l2_subdev *sd,
1305 * __v4l2_subdev_state_free - free a v4l2_subdev_state
1314 * v4l2_subdev_init_finalize() - Finalizes the initialization of the subdevice
1315 * @sd: The subdev
1327 #define v4l2_subdev_init_finalize(sd) \ argument
1331 ":" __stringify(__LINE__) ":sd->active_state->lock"; \
1332 __v4l2_subdev_init_finalize(sd, name, &__key); \
1335 int __v4l2_subdev_init_finalize(struct v4l2_subdev *sd, const char *name,
1339 * v4l2_subdev_cleanup() - Releases the resources allocated by the subdevice
1340 * @sd: The subdevice
1342 * Clean up a V4L2 async sub-device. Must be called for a sub-device as part of
1346 void v4l2_subdev_cleanup(struct v4l2_subdev *sd);
1349 * A macro to generate the macro or function name for sub-devices state access
1366 * v4l2_subdev_state_get_format() - Get pointer to a stream format
1374 * For stream-unaware drivers the format for the corresponding pad is returned.
1385 * const-correctness in all cases.
1401 * v4l2_subdev_state_get_crop() - Get pointer to a stream crop rectangle
1409 * For stream-unaware drivers the crop rectangle for the corresponding pad is
1423 * v4l2_subdev_state_get_compose() - Get pointer to a stream compose rectangle
1431 * For stream-unaware drivers the compose rectangle for the corresponding pad is
1445 * v4l2_subdev_state_get_interval() - Get pointer to a stream frame interval
1453 * For stream-unaware drivers the frame interval for the corresponding pad is
1469 * v4l2_subdev_get_fmt() - Fill format based on state
1470 * @sd: subdevice
1474 * Fill @format->format field based on the information in the @format struct.
1482 int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state,
1486 * v4l2_subdev_get_frame_interval() - Fill frame interval based on state
1487 * @sd: subdevice
1491 * Fill @fi->interval field based on the information in the @fi struct.
1499 int v4l2_subdev_get_frame_interval(struct v4l2_subdev *sd,
1504 * v4l2_subdev_set_routing() - Set given routing to subdev state
1505 * @sd: The subdevice
1515 int v4l2_subdev_set_routing(struct v4l2_subdev *sd,
1524 * for_each_active_route - iterate on all active routes of a routing table
1533 * v4l2_subdev_set_routing_with_fmt() - Set given routing and format to subdev
1535 * @sd: The subdevice
1543 int v4l2_subdev_set_routing_with_fmt(struct v4l2_subdev *sd,
1549 * v4l2_subdev_routing_find_opposite_end() - Find the opposite stream
1562 * Returns 0 on success, or -EINVAL if no matching route is found.
1569 * v4l2_subdev_state_get_opposite_stream_format() - Get pointer to opposite
1585 * v4l2_subdev_state_xlate_streams() - Translate streams from one pad to another
1608 * enum v4l2_subdev_routing_restriction - Subdevice internal routing restrictions
1625 * only non-overlapping 1-to-1 stream routing is allowed (a combination of
1654 * v4l2_subdev_routing_validate() - Verify that routes comply with driver
1656 * @sd: The subdevice
1664 int v4l2_subdev_routing_validate(struct v4l2_subdev *sd,
1669 * v4l2_subdev_enable_streams() - Enable streams on a pad
1670 * @sd: The subdevice
1680 * contains an already enabled stream, this function returns -EALREADY without
1683 * Per-stream enable is only available for subdevs that implement the
1685 * function implements a best-effort compatibility by calling the .s_stream()
1688 * Drivers that are not stream-aware shall set @streams_mask to BIT_ULL(0).
1692 * * -EALREADY: One of the streams in streams_mask is already enabled
1693 * * -EINVAL: The pad index is invalid, or doesn't correspond to a source pad
1694 * * -EOPNOTSUPP: Falling back to the legacy .s_stream() operation is
1697 int v4l2_subdev_enable_streams(struct v4l2_subdev *sd, u32 pad,
1701 * v4l2_subdev_disable_streams() - Disable streams on a pad
1702 * @sd: The subdevice
1712 * contains a disabled stream, this function returns -EALREADY without
1715 * Per-stream disable is only available for subdevs that implement the
1717 * function implements a best-effort compatibility by calling the .s_stream()
1720 * Drivers that are not stream-aware shall set @streams_mask to BIT_ULL(0).
1724 * * -EALREADY: One of the streams in streams_mask is not enabled
1725 * * -EINVAL: The pad index is invalid, or doesn't correspond to a source pad
1726 * * -EOPNOTSUPP: Falling back to the legacy .s_stream() operation is
1729 int v4l2_subdev_disable_streams(struct v4l2_subdev *sd, u32 pad,
1733 * v4l2_subdev_s_stream_helper() - Helper to implement the subdev s_stream
1735 * @sd: The subdevice
1738 * Subdevice drivers that implement the streams-aware
1747 int v4l2_subdev_s_stream_helper(struct v4l2_subdev *sd, int enable);
1754 * v4l2_subdev_lock_state() - Locks the subdev state
1763 mutex_lock(state->lock); in v4l2_subdev_lock_state()
1767 * v4l2_subdev_unlock_state() - Unlocks the subdev state
1774 mutex_unlock(state->lock); in v4l2_subdev_unlock_state()
1778 * v4l2_subdev_lock_states - Lock two sub-device states
1782 * Locks the state of two sub-devices.
1794 mutex_lock(state1->lock); in v4l2_subdev_lock_states()
1795 if (state1->lock != state2->lock) in v4l2_subdev_lock_states()
1796 mutex_lock(state2->lock); in v4l2_subdev_lock_states()
1800 * v4l2_subdev_unlock_states() - Unlock two sub-device states
1804 * Unlocks the state of two sub-devices.
1812 mutex_unlock(state1->lock); in v4l2_subdev_unlock_states()
1813 if (state1->lock != state2->lock) in v4l2_subdev_unlock_states()
1814 mutex_unlock(state2->lock); in v4l2_subdev_unlock_states()
1818 * v4l2_subdev_get_unlocked_active_state() - Checks that the active subdev state
1820 * @sd: The subdevice
1830 v4l2_subdev_get_unlocked_active_state(struct v4l2_subdev *sd) in v4l2_subdev_get_unlocked_active_state() argument
1832 if (sd->active_state) in v4l2_subdev_get_unlocked_active_state()
1833 lockdep_assert_not_held(sd->active_state->lock); in v4l2_subdev_get_unlocked_active_state()
1834 return sd->active_state; in v4l2_subdev_get_unlocked_active_state()
1838 * v4l2_subdev_get_locked_active_state() - Checks that the active subdev state
1841 * @sd: The subdevice
1851 v4l2_subdev_get_locked_active_state(struct v4l2_subdev *sd) in v4l2_subdev_get_locked_active_state() argument
1853 if (sd->active_state) in v4l2_subdev_get_locked_active_state()
1854 lockdep_assert_held(sd->active_state->lock); in v4l2_subdev_get_locked_active_state()
1855 return sd->active_state; in v4l2_subdev_get_locked_active_state()
1859 * v4l2_subdev_lock_and_get_active_state() - Locks and returns the active subdev
1861 * @sd: The subdevice
1869 v4l2_subdev_lock_and_get_active_state(struct v4l2_subdev *sd) in v4l2_subdev_lock_and_get_active_state() argument
1871 if (sd->active_state) in v4l2_subdev_lock_and_get_active_state()
1872 v4l2_subdev_lock_state(sd->active_state); in v4l2_subdev_lock_and_get_active_state()
1873 return sd->active_state; in v4l2_subdev_lock_and_get_active_state()
1877 * v4l2_subdev_init - initializes the sub-device struct
1879 * @sd: pointer to the &struct v4l2_subdev to be initialized
1882 void v4l2_subdev_init(struct v4l2_subdev *sd,
1888 * v4l2_subdev_call - call an operation of a v4l2_subdev.
1890 * @sd: pointer to the &struct v4l2_subdev
1898 * Example: err = v4l2_subdev_call(sd, video, s_std, norm);
1900 #define v4l2_subdev_call(sd, o, f, args...) \ argument
1902 struct v4l2_subdev *__sd = (sd); \
1905 __result = -ENODEV; \
1906 else if (!(__sd->ops->o && __sd->ops->o->f)) \
1907 __result = -ENOIOCTLCMD; \
1909 v4l2_subdev_call_wrappers.o->f) \
1910 __result = v4l2_subdev_call_wrappers.o->f( \
1913 __result = __sd->ops->o->f(__sd, ##args); \
1918 * v4l2_subdev_call_state_active - call an operation of a v4l2_subdev which
1922 * @sd: pointer to the &struct v4l2_subdev
1934 #define v4l2_subdev_call_state_active(sd, o, f, args...) \ argument
1938 state = v4l2_subdev_get_unlocked_active_state(sd); \
1941 __result = v4l2_subdev_call(sd, o, f, state, ##args); \
1948 * v4l2_subdev_call_state_try - call an operation of a v4l2_subdev which
1952 * @sd: pointer to the &struct v4l2_subdev
1964 * Note: only legacy non-MC drivers may need this macro.
1966 #define v4l2_subdev_call_state_try(sd, o, f, args...) \ argument
1971 ":" __stringify(__LINE__) ":state->lock"; \
1973 __v4l2_subdev_state_alloc(sd, name, &__key); \
1975 __result = v4l2_subdev_call(sd, o, f, state, ##args); \
1982 * v4l2_subdev_has_op - Checks if a subdev defines a certain operation.
1984 * @sd: pointer to the &struct v4l2_subdev
1989 #define v4l2_subdev_has_op(sd, o, f) \ argument
1990 ((sd)->ops->o && (sd)->ops->o->f)
1993 * v4l2_subdev_notify_event() - Delivers event notification for subdevice
1994 * @sd: The subdev for which to deliver the event
2002 void v4l2_subdev_notify_event(struct v4l2_subdev *sd,
2006 * v4l2_subdev_is_streaming() - Returns if the subdevice is streaming
2007 * @sd: The subdevice
2016 bool v4l2_subdev_is_streaming(struct v4l2_subdev *sd);