Lines Matching full:c
7 :c:type:`video_device` struct (``v4l2-dev.h``). This struct can either be
10 To allocate it dynamically use :c:func:`video_device_alloc`:
12 .. code-block:: c
24 .. code-block:: c
33 The default :c:func:`video_device_release` callback currently
36 There is also a :c:func:`video_device_release_empty` function that does
40 You should also set these fields of :c:type:`video_device`:
42 - :c:type:`video_device`->v4l2_dev: must be set to the :c:type:`v4l2_device`
45 - :c:type:`video_device`->name: set to something descriptive and unique.
47 - :c:type:`video_device`->vfl_dir: set this to ``VFL_DIR_RX`` for capture
51 - :c:type:`video_device`->fops: set to the :c:type:`v4l2_file_operations`
54 - :c:type:`video_device`->ioctl_ops: if you use the :c:type:`v4l2_ioctl_ops`
57 :c:type:`v4l2_ioctl_ops` struct. The :c:type:`video_device`->vfl_type and
58 :c:type:`video_device`->vfl_dir fields are used to disable ops that do not
61 provide just one :c:type:`v4l2_ioctl_ops` struct for both vbi and
64 - :c:type:`video_device`->lock: leave to ``NULL`` if you want to do all the
66 ``mutex_lock`` and before the :c:type:`video_device`->unlocked_ioctl
70 - :c:type:`video_device`->queue: a pointer to the struct vb2_queue
82 - :c:type:`video_device`->prio: keeps track of the priorities. Used to
85 in :c:type:`v4l2_device`. If you want to have a separate priority state per
87 :c:type:`v4l2_prio_state`.
89 - :c:type:`video_device`->dev_parent: you only set this if v4l2_device was
92 the same :c:type:`v4l2_device` core.
94 The cx88 driver is an example of this: one core :c:type:`v4l2_device` struct,
96 (cx8802). Since the :c:type:`v4l2_device` cannot be associated with two PCI
101 If you use :c:type:`v4l2_ioctl_ops`, then you should set
102 :c:type:`video_device`->unlocked_ioctl to :c:func:`video_ioctl2` in your
103 :c:type:`v4l2_file_operations` struct.
106 your :c:type:`v4l2_ioctl_ops` should be ignored. You can mark such ioctls by
107 calling this function before :c:func:`video_register_device` is called:
109 :c:func:`v4l2_disable_ioctl <v4l2_disable_ioctl>`
110 (:c:type:`vdev <video_device>`, cmd).
113 being used) you want to turns off certain features in :c:type:`v4l2_ioctl_ops`
116 The :c:type:`v4l2_file_operations` struct is a subset of file_operations.
121 :c:type:`media_entity` struct embedded in the :c:type:`video_device` struct
122 (entity field) by calling :c:func:`media_entity_pads_init`:
124 .. code-block:: c
146 is a second lock that you can set: :c:type:`video_device`->queue->lock. If
147 set, then this lock will be used instead of :c:type:`video_device`->lock
163 :c:func:`vb2_ops_wait_prepare` and :c:func:`vb2_ops_wait_finish`.
166 :c:type:`video_device` before calling v4l2_device_disconnect. If you are also
167 using :c:type:`video_device`->queue->lock, then you have to first lock
168 :c:type:`video_device`->queue->lock followed by :c:type:`video_device`->lock.
170 :c:func:`v4l2_device_disconnect`.
175 Next you register the video device with :c:func:`video_register_device`.
178 .. code-block:: c
186 If the :c:type:`v4l2_device` parent device has a not ``NULL`` mdev field,
194 :c:type:`vfl_devnode_type` Device name Usage
226 :c:func:`video_register_device_no_warn` instead.
236 :c:func:`video_register_device()` the index is just increased by 1. The
244 - :c:type:`video_device`->vfl_type: the device type passed to
245 :c:func:`video_register_device`.
246 - :c:type:`video_device`->minor: the assigned device minor number.
247 - :c:type:`video_device`->num: the device node number (i.e. the X in
249 - :c:type:`video_device`->index: the device index number.
252 :c:func:`video_device_release` to free the allocated :c:type:`video_device`
253 struct, or free your own struct if the :c:type:`video_device` was embedded in
293 :c:func:`video_unregister_device`
294 (:c:type:`vdev <video_device>`);
299 After :c:func:`video_unregister_device` returns no new opens can be done.
310 :c:func:`media_entity_cleanup <media_entity_cleanup>`
321 - file and :c:type:`video_device` private data
325 :c:func:`video_get_drvdata <video_get_drvdata>`
326 (:c:type:`vdev <video_device>`);
328 :c:func:`video_set_drvdata <video_set_drvdata>`
329 (:c:type:`vdev <video_device>`);
331 Note that you can safely call :c:func:`video_set_drvdata` before calling
332 :c:func:`video_register_device`.
336 :c:func:`video_devdata <video_devdata>`
341 The :c:func:`video_devdata` function combines :c:func:`video_get_drvdata`
342 with :c:func:`video_devdata`:
344 :c:func:`video_drvdata <video_drvdata>`
347 You can go from a :c:type:`video_device` struct to the v4l2_device struct using:
349 .. code-block:: c
355 The :c:type:`video_device` node kernel name can be retrieved using:
357 :c:func:`video_device_node_name <video_device_node_name>`
358 (:c:type:`vdev <video_device>`);