Lines Matching +full:sub +full:- +full:function

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>
21 * struct v4l2_device - main struct to for V4L2 device drivers
29 * @notify: notify operation called by some sub-devices.
33 * @release: Release function that is called when the ref count
37 * either stand-alone or embedded in a larger struct.
39 * It allows easy access to sub-devices (see v4l2-subdev.h) and provides
40 * basic V4L2 device-level support.
44 * #) @dev->driver_data points to this struct.
62 * v4l2_device_get - gets a V4L2 device reference
71 kref_get(&v4l2_dev->ref); in v4l2_device_get()
75 * v4l2_device_put - puts a V4L2 device reference
85 * v4l2_device_register - Initialize v4l2_dev and make @dev->driver_data
93 * In such case the caller must fill in the @v4l2_dev->name field
94 * before calling this function.
100 * v4l2_device_set_name - Optional function to initialize the
109 * using the driver name and a driver-global atomic_t instance.
111 * This function will increment the instance counter and returns the
123 * this function returns 0. If the name ends with a digit (e.g. cx18),
124 * then the name will be set to cx18-0 since cx180 would look really odd.
130 * v4l2_device_disconnect - Change V4L2 device state to disconnected.
138 * .. note:: This function sets @v4l2_dev->dev to NULL.
143 * v4l2_device_unregister - Unregister all sub-devices and any other
151 * v4l2_device_register_subdev - Registers a subdev with a v4l2 device.
156 * While registered, the subdev module is marked as in-use.
165 * v4l2_device_unregister_subdev - Unregisters a subdev with a v4l2 device.
177 * __v4l2_device_register_subdev_nodes - Registers device nodes for
182 * @read_only: subdevices read-only flag. True to register the subdevices
183 * device nodes in read-only mode, false to allow full access to the
191 * v4l2_device_register_subdev_nodes - Registers subdevices device nodes with
210 * v4l2_device_register_ro_subdev_nodes - Registers subdevices device nodes
211 * in read-only mode
229 * v4l2_subdev_notify - Sends a notification to v4l2_device.
233 * type is driver-specific.
240 if (sd && sd->v4l2_dev && sd->v4l2_dev->notify) in v4l2_subdev_notify()
241 sd->v4l2_dev->notify(sd, notification, arg); in v4l2_subdev_notify()
245 * v4l2_device_supports_requests - Test if requests are supported.
251 return v4l2_dev->mdev && v4l2_dev->mdev->ops && in v4l2_device_supports_requests()
252 v4l2_dev->mdev->ops->req_queue; in v4l2_device_supports_requests()
258 * v4l2_device_for_each_subdev - Helper macro that interates over all
259 * sub-devices of a given &v4l2_device.
263 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
265 * This macro iterates over all sub-devices owned by the @v4l2_dev device.
267 * the @sd variable pointing to each sub-device in turn.
270 list_for_each_entry(sd, &(v4l2_dev)->subdevs, list)
273 * __v4l2_device_call_subdevs_p - Calls the specified operation for
276 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
282 * @f: operation function that will be called if @cond matches.
294 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
295 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
296 (sd)->ops->o->f((sd) , ##args); \
300 * __v4l2_device_call_subdevs - Calls the specified operation for
303 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
307 * @f: operation function that will be called if @cond matches.
326 * __v4l2_device_call_subdevs_until_err_p - Calls the specified operation for
329 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
331 * &struct v4l2_subdev sub-devices associated with @v4l2_dev.
335 * @f: operation function that will be called if @cond matches.
342 * If the operation returns an error other than 0 or ``-ENOIOCTLCMD``
353 list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) { \
354 if ((cond) && (sd)->ops->o && (sd)->ops->o->f) \
355 __err = (sd)->ops->o->f((sd) , ##args); \
356 if (__err && __err != -ENOIOCTLCMD) \
359 (__err == -ENOIOCTLCMD) ? 0 : __err; \
363 * __v4l2_device_call_subdevs_until_err - Calls the specified operation for
366 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
370 * @f: operation function that will be called if @cond matches.
377 * If the operation returns an error other than 0 or ``-ENOIOCTLCMD``
392 * v4l2_device_call_all - Calls the specified operation for
396 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
397 * @grpid: &struct v4l2_subdev->grp_id group ID to match.
401 * @f: operation function that will be called if @cond matches.
416 (grpid) == 0 || __sd->grp_id == (grpid), o, f , \
421 * v4l2_device_call_until_err - Calls the specified operation for
425 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
426 * @grpid: &struct v4l2_subdev->grp_id group ID to match.
430 * @f: operation function that will be called if @cond matches.
437 * If the operation returns an error other than 0 or ``-ENOIOCTLCMD``
448 (grpid) == 0 || __sd->grp_id == (grpid), o, f , \
453 * v4l2_device_mask_call_all - Calls the specified operation for
456 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
457 * @grpmsk: bitmask to be checked against &struct v4l2_subdev->grp_id
461 * @f: operation function that will be called if @cond matches.
476 (grpmsk) == 0 || (__sd->grp_id & (grpmsk)), o, \
481 * v4l2_device_mask_call_until_err - Calls the specified operation for
484 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
485 * @grpmsk: bitmask to be checked against &struct v4l2_subdev->grp_id
489 * @f: operation function that will be called if @cond matches.
496 * If the operation returns an error other than 0 or ``-ENOIOCTLCMD``
507 (grpmsk) == 0 || (__sd->grp_id & (grpmsk)), o, \
513 * v4l2_device_has_op - checks if any subdev with matching grpid has a
516 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
517 * @grpid: &struct v4l2_subdev->grp_id group ID to match.
521 * @f: operation function that will be called if @cond matches.
529 list_for_each_entry(__sd, &(v4l2_dev)->subdevs, list) { \
530 if ((grpid) && __sd->grp_id != (grpid)) \
541 * v4l2_device_mask_has_op - checks if any subdev with matching group
544 * @v4l2_dev: &struct v4l2_device owning the sub-devices to iterate over.
545 * @grpmsk: bitmask to be checked against &struct v4l2_subdev->grp_id
549 * @f: operation function that will be called if @cond matches.
557 list_for_each_entry(__sd, &(v4l2_dev)->subdevs, list) { \
558 if ((grpmsk) && !(__sd->grp_id & (grpmsk))) \