Lines Matching +full:gpio +full:- +full:op +full:- +full:cfg
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>
43 * struct v4l2_decode_vbi_line - used to decode_vbi_line
49 * @line: Line number of the sliced VBI data (1-23)
60 * Sub-devices are devices that are connected somehow to the main bridge
68 * generic manner. Most operations that these sub-devices support fall in
97 * The ioctl ops is meant for generic ioctl-like commands. Depending on
98 * the use-case it might be better to use subdev-specific ops (currently
99 * not yet implemented) since ops provide proper type-checking.
103 * enum v4l2_subdev_io_pin_bits - Subdevice external IO pin configuration
110 * &struct v4l2_subdev_io_pin_config->value.
123 * struct v4l2_subdev_io_pin_config - Subdevice external IO pin configuration
129 * @value: Initial value for pin - e.g. GPIO output value
141 * struct v4l2_subdev_core_ops - Define core ops callbacks for subdevs
159 * drivers without discussing this first on the linux-media mailinglist.
162 * @s_gpio: set GPIO pins. Very simple right now, might need to be extended with
165 * @command: called by in-kernel drivers in order to call functions internal
219 * struct v4l2_subdev_tuner_ops - Callbacks used when v4l device was opened
233 * freq->type must be filled in. Normally done by video_ioctl2()
240 * @s_tuner: callback for VIDIOC_S_TUNER() ioctl handler code. @vt->type must be
283 * struct v4l2_subdev_audio_ops - Callbacks used for audio-related settings
289 * -EINVAL is returned.
294 * If the frequency is not supported, then %-EINVAL is returned.
298 * Never attempt to use user-level input IDs (e.g. Composite, S-Video,
302 * The calling driver is responsible for mapping a user-level input to
316 * enum v4l2_mbus_frame_desc_entry - media bus frame description flags
319 * Indicates that &struct v4l2_mbus_frame_desc_entry->length field
331 * struct v4l2_mbus_frame_desc_entry - media bus frame description structure
348 * struct v4l2_mbus_frame_desc - media bus data frame description
358 * struct v4l2_subdev_video_ops - Callbacks used when v4l device was opened
367 * to 0. If the frequency is not supported, then -EINVAL is returned.
441 * struct v4l2_subdev_vbi_ops - Callbacks used when v4l device was opened
461 * the readback register contains invalid or erroneous data %-EIO is
486 * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations
501 * enum v4l2_subdev_ir_mode- describes the type of IR supported
510 * struct v4l2_subdev_ir_parameters - Parameters for IR TX or TX
559 * struct v4l2_subdev_ir_ops - operations for IR subdevices
562 * The semantics are similar to a non-blocking read() call.
571 * settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
578 * The semantics are similar to a non-blocking write() call.
587 * settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz
614 * struct v4l2_subdev_pad_config - Used for storing subdev pad information.
620 * This structure only needs to be passed to the pad op if the 'which' field
631 * struct v4l2_subdev_pad_ops - v4l2-subdev pad level operations
668 * @get_mbus_config: get the media bus configuration of a remote sub-device.
670 * firmware interface at sub-device probe time, immediately
672 * driver. Remote sub-devices (usually video receivers) shall
675 * Callers should make sure they get the most up-to-date as
681 * @set_mbus_config: set the media bus configuration of a remote sub-device.
684 * configuration parameters between media sub-devices. The
694 struct v4l2_subdev_pad_config *cfg);
696 struct v4l2_subdev_pad_config *cfg,
699 struct v4l2_subdev_pad_config *cfg,
702 struct v4l2_subdev_pad_config *cfg,
705 struct v4l2_subdev_pad_config *cfg,
708 struct v4l2_subdev_pad_config *cfg,
711 struct v4l2_subdev_pad_config *cfg,
714 struct v4l2_subdev_pad_config *cfg,
738 * struct v4l2_subdev_ops - Subdev operations
761 * struct v4l2_subdev_internal_ops - V4L2 subdev internal ops
776 * filehandle to the v4l-subdevX device node was closed. If no device
777 * node was created for this sub-device, then the @release callback
781 * sub-device that sets the V4L2_SUBDEV_FL_HAS_DEVNODE flag.
813 * struct v4l2_subdev_platform_data - regulators config struct
817 * @host_priv: Per-subdevice data, specific for a certain video host device
827 * struct v4l2_subdev - describes a V4L2 sub-device
830 * @list: List of sub-devices
832 * @owner_v4l2_dev: true if the &sd->owner matches the owner of @v4l2_dev->dev
835 * %V4L2_SUBDEV_FL_IS_I2C - Set this flag if this subdev is a i2c device;
836 * %V4L2_SUBDEV_FL_IS_SPI - Set this flag if this subdev is a spi device;
837 * %V4L2_SUBDEV_FL_HAS_DEVNODE - Set this flag if this subdev needs a
839 * %V4L2_SUBDEV_FL_HAS_EVENTS - Set this flag if this subdev generates
847 * @name: Name of the sub-device. Please notice that the name must be unique.
848 * @grp_id: can be used to group similar subdevs. Value is driver-specific
855 * either dev->of_node->fwnode or dev->fwnode (whichever is non-NULL).
856 * @async_list: Links this subdev to a global subdev_list or @notifier->done
860 * @subdev_notifier: A sub-device notifier implicitly registered for the sub-
865 * stand-alone or embedded in a larger struct.
898 * media_entity_to_v4l2_subdev - Returns a &struct v4l2_subdev from
913 * vdev_to_v4l2_subdev - Returns a &struct v4l2_subdev from
922 * struct v4l2_subdev_fh - Used for storing subdev information per file handle
937 * to_v4l2_subdev_fh - Returns a &struct v4l2_subdev_fh from
948 * v4l2_subdev_get_try_format - ancillary routine to call
949 * &struct v4l2_subdev_pad_config->try_fmt
952 * @cfg: pointer to &struct v4l2_subdev_pad_config array.
953 * @pad: index of the pad in the @cfg array.
957 struct v4l2_subdev_pad_config *cfg, in v4l2_subdev_get_try_format() argument
960 if (WARN_ON(pad >= sd->entity.num_pads)) in v4l2_subdev_get_try_format()
962 return &cfg[pad].try_fmt; in v4l2_subdev_get_try_format()
966 * v4l2_subdev_get_try_crop - ancillary routine to call
967 * &struct v4l2_subdev_pad_config->try_crop
970 * @cfg: pointer to &struct v4l2_subdev_pad_config array.
971 * @pad: index of the pad in the @cfg array.
975 struct v4l2_subdev_pad_config *cfg, in v4l2_subdev_get_try_crop() argument
978 if (WARN_ON(pad >= sd->entity.num_pads)) in v4l2_subdev_get_try_crop()
980 return &cfg[pad].try_crop; in v4l2_subdev_get_try_crop()
984 * v4l2_subdev_get_try_compose - ancillary routine to call
985 * &struct v4l2_subdev_pad_config->try_compose
988 * @cfg: pointer to &struct v4l2_subdev_pad_config array.
989 * @pad: index of the pad in the @cfg array.
993 struct v4l2_subdev_pad_config *cfg, in v4l2_subdev_get_try_compose() argument
996 if (WARN_ON(pad >= sd->entity.num_pads)) in v4l2_subdev_get_try_compose()
998 return &cfg[pad].try_compose; in v4l2_subdev_get_try_compose()
1006 * v4l2_set_subdevdata - Sets V4L2 dev private device data
1013 sd->dev_priv = p; in v4l2_set_subdevdata()
1017 * v4l2_get_subdevdata - Gets V4L2 dev private device data
1025 return sd->dev_priv; in v4l2_get_subdevdata()
1029 * v4l2_set_subdev_hostdata - Sets V4L2 dev private host data
1036 sd->host_priv = p; in v4l2_set_subdev_hostdata()
1040 * v4l2_get_subdev_hostdata - Gets V4L2 dev private data
1048 return sd->host_priv; in v4l2_get_subdev_hostdata()
1054 * v4l2_subdev_get_fwnode_pad_1_to_1 - Get pad number from a subdev fwnode
1071 * v4l2_subdev_link_validate_default - validates a media link
1087 * v4l2_subdev_link_validate - validates a media link
1100 * v4l2_subdev_alloc_pad_config - Allocates memory for pad config
1108 * v4l2_subdev_free_pad_config - Frees memory allocated by
1111 * @cfg: pointer to &struct v4l2_subdev_pad_config
1113 void v4l2_subdev_free_pad_config(struct v4l2_subdev_pad_config *cfg);
1117 * v4l2_subdev_init - initializes the sub-device struct
1128 * v4l2_subdev_call - call an operation of a v4l2_subdev.
1145 __result = -ENODEV; \
1146 else if (!(__sd->ops->o && __sd->ops->o->f)) \
1147 __result = -ENOIOCTLCMD; \
1149 v4l2_subdev_call_wrappers.o->f) \
1150 __result = v4l2_subdev_call_wrappers.o->f( \
1153 __result = __sd->ops->o->f(__sd, ##args); \
1158 * v4l2_subdev_has_op - Checks if a subdev defines a certain operation.
1166 ((sd)->ops->o && (sd)->ops->o->f)
1169 * v4l2_subdev_notify_event() - Delivers event notification for subdevice