Lines Matching +full:sub +full:- +full:group

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
12 #include <media/media-device.h>
13 #include <media/v4l2-subdev.h>
14 #include <media/v4l2-dev.h>
19 * struct v4l2_device - main struct to for V4L2 device drivers
27 * @notify: notify operation called by some sub-devices.
35 * either stand-alone or embedded in a larger struct.
37 * It allows easy access to sub-devices (see v4l2-subdev.h) and provides
38 * basic V4L2 device-level support.
42 * #) @dev->driver_data points to this struct.
60 * v4l2_device_get - gets a V4L2 device reference
69 kref_get(&v4l2_dev->ref); in v4l2_device_get()
73 * v4l2_device_put - puts a V4L2 device reference
83 * v4l2_device_register - Initialize v4l2_dev and make @dev->driver_data
91 * In such case the caller must fill in the @v4l2_dev->name field
98 * v4l2_device_set_name - Optional function to initialize the
107 * using the driver name and a driver-global atomic_t instance.
122 * then the name will be set to cx18-0 since cx180 would look really odd.
128 * v4l2_device_disconnect - Change V4L2 device state to disconnected.
136 * .. note:: This function sets @v4l2_dev->dev to NULL.
141 * v4l2_device_unregister - Unregister all sub-devices and any other
149 * v4l2_device_register_subdev - Registers a subdev with a v4l2 device.
154 * While registered, the subdev module is marked as in-use.
166 * v4l2_device_unregister_subdev - Unregisters a subdev with a v4l2 device.
178 * __v4l2_device_register_subdev_nodes - Registers device nodes for
183 * @read_only: subdevices read-only flag. True to register the subdevices
184 * device nodes in read-only mode, false to allow full access to the
192 * v4l2_device_register_subdev_nodes - Registers subdevices device nodes with
211 * v4l2_device_register_ro_subdev_nodes - Registers subdevices device nodes
212 * in read-only mode
230 * v4l2_subdev_notify - Sends a notification to v4l2_device.
234 * type is driver-specific.
241 if (sd && sd->v4l2_dev && sd->v4l2_dev->notify) in v4l2_subdev_notify()
242 sd->v4l2_dev->notify(sd, notification, arg); in v4l2_subdev_notify()
246 * v4l2_device_supports_requests - Test if requests are supported.
252 return v4l2_dev->mdev && v4l2_dev->mdev->ops && in v4l2_device_supports_requests()
253 v4l2_dev->mdev->ops->req_queue; in v4l2_device_supports_requests()
259 * v4l2_device_for_each_subdev - Helper macro that interates over all
260 * sub-devices of a given &v4l2_device.
264 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
266 * This macro iterates over all sub-devices owned by the @v4l2_dev device.
268 * the @sd variable pointing to each sub-device in turn.
271 list_for_each_entry(sd, &(v4l2_dev)->subdevs, list)
274 * __v4l2_device_call_subdevs_p - Calls the specified operation for
277 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
295 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
296 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
297 (sd)->ops->o->f((sd) , ##args); \
301 * __v4l2_device_call_subdevs - Calls the specified operation for
304 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
327 * __v4l2_device_call_subdevs_until_err_p - Calls the specified operation for
330 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
332 * &struct v4l2_subdev sub-devices associated with @v4l2_dev.
343 * If the operation returns an error other than 0 or ``-ENOIOCTLCMD``
354 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) { \
355 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
356 __err = (sd)->ops->o->f((sd) , ##args); \
357 if (__err && __err != -ENOIOCTLCMD) \
360 (__err == -ENOIOCTLCMD) ? 0 : __err; \
364 * __v4l2_device_call_subdevs_until_err - Calls the specified operation for
367 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
378 * If the operation returns an error other than 0 or ``-ENOIOCTLCMD``
393 * v4l2_device_call_all - Calls the specified operation for
397 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
398 * @grpid: &struct v4l2_subdev->grp_id group ID to match.
417 (grpid) == 0 || __sd->grp_id == (grpid), o, f , \
422 * v4l2_device_call_until_err - Calls the specified operation for
426 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
427 * @grpid: &struct v4l2_subdev->grp_id group ID to match.
438 * If the operation returns an error other than 0 or ``-ENOIOCTLCMD``
449 (grpid) == 0 || __sd->grp_id == (grpid), o, f , \
454 * v4l2_device_mask_call_all - Calls the specified operation for
455 * all subdevices where a group ID matches a specified bitmask.
457 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
458 * @grpmsk: bitmask to be checked against &struct v4l2_subdev->grp_id
459 * group ID to be matched. Use 0 to match them all.
477 (grpmsk) == 0 || (__sd->grp_id & (grpmsk)), o, \
482 * v4l2_device_mask_call_until_err - Calls the specified operation for
483 * all subdevices where a group ID matches a specified bitmask.
485 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
486 * @grpmsk: bitmask to be checked against &struct v4l2_subdev->grp_id
487 * group ID to be matched. Use 0 to match them all.
497 * If the operation returns an error other than 0 or ``-ENOIOCTLCMD``
508 (grpmsk) == 0 || (__sd->grp_id & (grpmsk)), o, \
514 * v4l2_device_has_op - checks if any subdev with matching grpid has a
517 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
518 * @grpid: &struct v4l2_subdev->grp_id group ID to match.
530 list_for_each_entry(__sd, &(v4l2_dev)->subdevs, list) { \
531 if ((grpid) && __sd->grp_id != (grpid)) \
542 * v4l2_device_mask_has_op - checks if any subdev with matching group
545 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
546 * @grpmsk: bitmask to be checked against &struct v4l2_subdev->grp_id
547 * group ID to be matched. Use 0 to match them all.
558 list_for_each_entry(__sd, &(v4l2_dev)->subdevs, list) { \
559 if ((grpmsk) && !(__sd->grp_id & (grpmsk))) \