• Home
  • Raw
  • Download

Lines Matching +full:stream +full:- +full:mode +full:- +full:support

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
96 * This provides basic debugging support.
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
170 * used to provide support for private ioctls used on the driver.
179 * @s_power: puts subdevice in power saving mode (on == 0) or normal operation
180 * mode (on == 1). DEPRECATED. See
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
183 * mode before s_stream is called.
223 * struct v4l2_subdev_tuner_ops - Callbacks used when v4l device was opened
224 * in radio mode.
226 * @standby: puts the tuner in standby mode. It will be woken up
229 * @s_radio: callback that switches the tuner to radio mode.
231 * operate on radio mode, before being able to handle it.
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
260 * radio mode, before handling other &struct v4l2_subdev_tuner_ops
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
309 * @s_stream: used to notify the audio code that stream will start or has
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
349 * @stream: stream in routing configuration
354 * @bus: Bus-specific frame descriptor parameters
355 * @bus.csi2: CSI-2-specific bus configuration
359 u32 stream; member
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
415 * in video mode.
423 * to 0. If the frequency is not supported, then -EINVAL is returned.
447 * sub-device. Failure on stop will remove any resources acquired in
449 * Also see call_s_stream wrapper in v4l2-subdev.c.
472 * initialising the bus. Current usage is to set a CSI-2 transmitter to
473 * LP-11 or LP-111 mode before streaming. See &enum
477 * indicated by the flags argument. In particular, -EACCES indicates lack
478 * of support for the operation. The caller shall call post_streamoff for
514 * struct v4l2_subdev_vbi_ops - Callbacks used when v4l device was opened
515 * in video mode via the vbi device node.
517 * @decode_vbi_line: video decoders that support sliced VBI need to implement
533 * Not all video decoders support this. If no data is available because
534 * the readback register contains invalid or erroneous data %-EIO is
559 * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations
564 * @g_skip_frames: number of frames to skip at stream start. This is needed for
574 * enum v4l2_subdev_ir_mode- describes the type of IR supported
583 * struct v4l2_subdev_ir_parameters - Parameters for IR TX or TX
587 * @mode: IR mode as defined by &enum v4l2_subdev_ir_mode.
590 * @shutdown: if true: set hardware to low/no power, false: normal mode
609 enum v4l2_subdev_ir_mode mode; member
632 * struct v4l2_subdev_ir_ops - operations for IR subdevices
635 * The semantics are similar to a non-blocking read() call.
644 * settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
651 * The semantics are similar to a non-blocking write() call.
660 * settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
687 * struct v4l2_subdev_pad_config - Used for storing subdev pad information.
707 * struct v4l2_subdev_stream_config - Used for storing stream configuration.
710 * @stream: stream number
711 * @enabled: has the stream been enabled with v4l2_subdev_enable_stream()
716 * This structure stores configuration for a stream.
720 u32 stream; member
729 * struct v4l2_subdev_stream_configs - A collection of stream configs.
740 * struct v4l2_subdev_krouting - subdev routing table
753 * struct v4l2_subdev_state - Used for storing subdev state information.
759 * @stream_configs: stream configurations (only for V4L2_SUBDEV_FL_STREAMS)
775 * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations
805 * that belongs to a pipeline can be used for stream.
812 * @get_mbus_config: get the media bus configuration of a remote sub-device.
814 * firmware interface at sub-device probe time, immediately
816 * driver. Remote sub-devices (usually video receivers) shall
819 * Callers should make sure they get the most up-to-date as
821 * this operation as close as possible to stream on time. The
894 * struct v4l2_subdev_ops - Subdev operations
917 * struct v4l2_subdev_internal_ops - V4L2 subdev internal ops
932 * filehandle to the v4l-subdevX device node was closed. If no device
933 * node was created for this sub-device, then the @release callback
937 * sub-device that sets the V4L2_SUBDEV_FL_HAS_DEVNODE flag.
967 * that the driver supports routing and handles the stream parameter in its
970 * - Centrally managed subdev active state is enabled
971 * - Legacy pad config is _not_ supported (state->pads is NULL)
972 * - Routing ioctls are available
973 * - Multiple streams per pad are supported
980 * struct v4l2_subdev_platform_data - regulators config struct
984 * @host_priv: Per-subdevice data, specific for a certain video host device
994 * struct v4l2_subdev - describes a V4L2 sub-device
997 * @list: List of sub-devices
999 * @owner_v4l2_dev: true if the &sd->owner matches the owner of @v4l2_dev->dev
1002 * %V4L2_SUBDEV_FL_IS_I2C - Set this flag if this subdev is a i2c device;
1003 * %V4L2_SUBDEV_FL_IS_SPI - Set this flag if this subdev is a spi device;
1004 * %V4L2_SUBDEV_FL_HAS_DEVNODE - Set this flag if this subdev needs a
1006 * %V4L2_SUBDEV_FL_HAS_EVENTS - Set this flag if this subdev generates
1014 * @name: Name of the sub-device. Please notice that the name must be unique.
1015 * @grp_id: can be used to group similar subdevs. Value is driver-specific
1022 * either dev->of_node->fwnode or dev->fwnode (whichever is non-NULL).
1024 * @notifier->done_list list.
1027 * @subdev_notifier: A sub-device notifier implicitly registered for the sub-
1045 * stand-alone or embedded in a larger struct.
1087 * doesn't support it.
1095 * media_entity_to_v4l2_subdev - Returns a &struct v4l2_subdev from
1110 * vdev_to_v4l2_subdev - Returns a &struct v4l2_subdev from
1119 * struct v4l2_subdev_fh - Used for storing subdev information per file handle
1136 * to_v4l2_subdev_fh - Returns a &struct v4l2_subdev_fh from
1147 * v4l2_subdev_get_pad_format - ancillary routine to call
1148 * &struct v4l2_subdev_pad_config->try_fmt
1152 * @pad: index of the pad in the &struct v4l2_subdev_state->pads array
1161 if (WARN_ON(pad >= sd->entity.num_pads)) in v4l2_subdev_get_pad_format()
1163 return &state->pads[pad].try_fmt; in v4l2_subdev_get_pad_format()
1167 * v4l2_subdev_get_pad_crop - ancillary routine to call
1168 * &struct v4l2_subdev_pad_config->try_crop
1172 * @pad: index of the pad in the &struct v4l2_subdev_state->pads array.
1181 if (WARN_ON(pad >= sd->entity.num_pads)) in v4l2_subdev_get_pad_crop()
1183 return &state->pads[pad].try_crop; in v4l2_subdev_get_pad_crop()
1187 * v4l2_subdev_get_pad_compose - ancillary routine to call
1188 * &struct v4l2_subdev_pad_config->try_compose
1192 * @pad: index of the pad in the &struct v4l2_subdev_state->pads array.
1201 if (WARN_ON(pad >= sd->entity.num_pads)) in v4l2_subdev_get_pad_compose()
1203 return &state->pads[pad].try_compose; in v4l2_subdev_get_pad_compose()
1224 * v4l2_set_subdevdata - Sets V4L2 dev private device data
1231 sd->dev_priv = p; in v4l2_set_subdevdata()
1235 * v4l2_get_subdevdata - Gets V4L2 dev private device data
1243 return sd->dev_priv; in v4l2_get_subdevdata()
1247 * v4l2_set_subdev_hostdata - Sets V4L2 dev private host data
1254 sd->host_priv = p; in v4l2_set_subdev_hostdata()
1258 * v4l2_get_subdev_hostdata - Gets V4L2 dev private data
1266 return sd->host_priv; in v4l2_get_subdev_hostdata()
1272 * v4l2_subdev_get_fwnode_pad_1_to_1 - Get pad number from a subdev fwnode
1289 * v4l2_subdev_link_validate_default - validates a media link
1305 * v4l2_subdev_link_validate - validates a media link
1318 * v4l2_subdev_has_pad_interdep - MC has_pad_interdep implementation for subdevs
1336 * __v4l2_subdev_state_alloc - allocate v4l2_subdev_state
1351 * __v4l2_subdev_state_free - free a v4l2_subdev_state
1360 * v4l2_subdev_init_finalize() - Finalizes the initialization of the subdevice
1377 ":" __stringify(__LINE__) ":sd->active_state->lock"; \
1385 * v4l2_subdev_cleanup() - Releases the resources allocated by the subdevice
1388 * Clean up a V4L2 async sub-device. Must be called for a sub-device as part of
1395 * v4l2_subdev_lock_state() - Locks the subdev state
1404 mutex_lock(state->lock); in v4l2_subdev_lock_state()
1408 * v4l2_subdev_unlock_state() - Unlocks the subdev state
1415 mutex_unlock(state->lock); in v4l2_subdev_unlock_state()
1419 * v4l2_subdev_get_unlocked_active_state() - Checks that the active subdev state
1424 * support active state. If the state is not NULL, calls
1433 if (sd->active_state) in v4l2_subdev_get_unlocked_active_state()
1434 lockdep_assert_not_held(sd->active_state->lock); in v4l2_subdev_get_unlocked_active_state()
1435 return sd->active_state; in v4l2_subdev_get_unlocked_active_state()
1439 * v4l2_subdev_get_locked_active_state() - Checks that the active subdev state
1445 * support active state. If the state is not NULL, calls lockdep_assert_held()
1454 if (sd->active_state) in v4l2_subdev_get_locked_active_state()
1455 lockdep_assert_held(sd->active_state->lock); in v4l2_subdev_get_locked_active_state()
1456 return sd->active_state; in v4l2_subdev_get_locked_active_state()
1460 * v4l2_subdev_lock_and_get_active_state() - Locks and returns the active subdev
1465 * does not support active state.
1472 if (sd->active_state) in v4l2_subdev_lock_and_get_active_state()
1473 v4l2_subdev_lock_state(sd->active_state); in v4l2_subdev_lock_and_get_active_state()
1474 return sd->active_state; in v4l2_subdev_lock_and_get_active_state()
1480 * v4l2_subdev_get_fmt() - Fill format based on state
1485 * Fill @format->format field based on the information in the @format struct.
1487 * This function can be used by the subdev drivers which support active state to
1497 * v4l2_subdev_set_routing() - Set given routing to subdev state
1517 * for_each_active_route - iterate on all active routes of a routing table
1526 * v4l2_subdev_set_routing_with_fmt() - Set given routing and format to subdev
1542 * v4l2_subdev_state_get_stream_format() - Get pointer to a stream format
1545 * @stream: stream id
1548 * stream in the subdev state.
1550 * If the state does not contain the given pad + stream, NULL is returned.
1554 unsigned int pad, u32 stream);
1557 * v4l2_subdev_state_get_stream_crop() - Get pointer to a stream crop rectangle
1560 * @stream: stream id
1562 * This returns a pointer to crop rectangle for the given pad + stream in the
1565 * If the state does not contain the given pad + stream, NULL is returned.
1569 unsigned int pad, u32 stream);
1572 * v4l2_subdev_state_get_stream_compose() - Get pointer to a stream compose
1576 * @stream: stream id
1578 * This returns a pointer to compose rectangle for the given pad + stream in the
1581 * If the state does not contain the given pad + stream, NULL is returned.
1585 unsigned int pad, u32 stream);
1588 * v4l2_subdev_routing_find_opposite_end() - Find the opposite stream
1591 * @stream: stream id
1593 * @other_stream: pointer used to return the opposite stream
1595 * This function uses the routing table to find the pad + stream which is
1596 * opposite the given pad + stream.
1601 * Returns 0 on success, or -EINVAL if no matching route is found.
1604 u32 pad, u32 stream, u32 *other_pad,
1608 * v4l2_subdev_state_get_opposite_stream_format() - Get pointer to opposite
1609 * stream format
1612 * @stream: stream id
1614 * This returns a pointer to &struct v4l2_mbus_framefmt for the pad + stream
1615 * that is opposite the given pad + stream in the subdev state.
1617 * If the state does not contain the given pad + stream, NULL is returned.
1621 u32 pad, u32 stream);
1624 * v4l2_subdev_state_xlate_streams() - Translate streams from one pad to another
1632 * the subdev state routing table. Stream numbers don't necessarily match on
1633 * the sink and source side of a route. This function translates stream numbers
1635 * on @pad1 using the routing table from the @state. It returns the stream mask
1647 * enum v4l2_subdev_routing_restriction - Subdevice internal routing restrictions
1650 * an input stream shall not be routed to multiple output streams (stream
1653 * multiple input streams shall not be routed to the same output stream
1654 * (stream merging)
1664 * only non-overlapping 1-to-1 stream routing is allowed (a combination of
1693 * v4l2_subdev_routing_validate() - Verify that routes comply with driver
1708 * v4l2_subdev_enable_streams() - Enable streams on a pad
1718 * Enabling a stream that is already enabled isn't allowed. If @streams_mask
1719 * contains an already enabled stream, this function returns -EALREADY without
1722 * Per-stream enable is only available for subdevs that implement the
1724 * function implements a best-effort compatibility by calling the .s_stream()
1729 * * -EALREADY: One of the streams in streams_mask is already enabled
1730 * * -EINVAL: The pad index is invalid, or doesn't correspond to a source pad
1731 * * -EOPNOTSUPP: Falling back to the legacy .s_stream() operation is
1738 * v4l2_subdev_disable_streams() - Disable streams on a pad
1749 * contains a disabled stream, this function returns -EALREADY without
1752 * Per-stream disable is only available for subdevs that implement the
1754 * function implements a best-effort compatibility by calling the .s_stream()
1759 * * -EALREADY: One of the streams in streams_mask is not enabled
1760 * * -EINVAL: The pad index is invalid, or doesn't correspond to a source pad
1761 * * -EOPNOTSUPP: Falling back to the legacy .s_stream() operation is
1768 * v4l2_subdev_s_stream_helper() - Helper to implement the subdev s_stream
1773 * Subdevice drivers that implement the streams-aware
1789 * v4l2_subdev_init - initializes the sub-device struct
1800 * v4l2_subdev_call - call an operation of a v4l2_subdev.
1817 __result = -ENODEV; \
1818 else if (!(__sd->ops->o && __sd->ops->o->f)) \
1819 __result = -ENOIOCTLCMD; \
1821 v4l2_subdev_call_wrappers.o->f) \
1822 __result = v4l2_subdev_call_wrappers.o->f( \
1825 __result = __sd->ops->o->f(__sd, ##args); \
1830 * v4l2_subdev_call_state_active - call an operation of a v4l2_subdev which
1860 * v4l2_subdev_call_state_try - call an operation of a v4l2_subdev which
1876 * Note: only legacy non-MC drivers may need this macro.
1883 ":" __stringify(__LINE__) ":state->lock"; \
1894 * v4l2_subdev_has_op - Checks if a subdev defines a certain operation.
1902 ((sd)->ops->o && (sd)->ops->o->f)
1905 * v4l2_subdev_notify_event() - Delivers event notification for subdevice