Merge remote-tracking branches 'asoc/fix/da7219-pops' and 'asoc/fix/qcom' into asoc...
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / vidioc-subdev-g-frame-interval.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _VIDIOC_SUBDEV_G_FRAME_INTERVAL:
4
5 ********************************************************************
6 ioctl VIDIOC_SUBDEV_G_FRAME_INTERVAL, VIDIOC_SUBDEV_S_FRAME_INTERVAL
7 ********************************************************************
8
9 Name
10 ====
11
12 VIDIOC_SUBDEV_G_FRAME_INTERVAL - VIDIOC_SUBDEV_S_FRAME_INTERVAL - Get or set the frame interval on a subdev pad
13
14
15 Synopsis
16 ========
17
18 .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_G_FRAME_INTERVAL, struct v4l2_subdev_frame_interval *argp )
19     :name: VIDIOC_SUBDEV_G_FRAME_INTERVAL
20
21 .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_S_FRAME_INTERVAL, struct v4l2_subdev_frame_interval *argp )
22     :name: VIDIOC_SUBDEV_S_FRAME_INTERVAL
23
24
25 Arguments
26 =========
27
28 ``fd``
29     File descriptor returned by :ref:`open() <func-open>`.
30
31 ``argp``
32
33
34 Description
35 ===========
36
37 These ioctls are used to get and set the frame interval at specific
38 subdev pads in the image pipeline. The frame interval only makes sense
39 for sub-devices that can control the frame period on their own. This
40 includes, for instance, image sensors and TV tuners. Sub-devices that
41 don't support frame intervals must not implement these ioctls.
42
43 To retrieve the current frame interval applications set the ``pad``
44 field of a struct
45 :c:type:`v4l2_subdev_frame_interval` to
46 the desired pad number as reported by the media controller API. When
47 they call the ``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` ioctl with a pointer to
48 this structure the driver fills the members of the ``interval`` field.
49
50 To change the current frame interval applications set both the ``pad``
51 field and all members of the ``interval`` field. When they call the
52 ``VIDIOC_SUBDEV_S_FRAME_INTERVAL`` ioctl with a pointer to this
53 structure the driver verifies the requested interval, adjusts it based
54 on the hardware capabilities and configures the device. Upon return the
55 struct
56 :c:type:`v4l2_subdev_frame_interval`
57 contains the current frame interval as would be returned by a
58 ``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` call.
59
60 Drivers must not return an error solely because the requested interval
61 doesn't match the device capabilities. They must instead modify the
62 interval to match what the hardware can provide. The modified interval
63 should be as close as possible to the original request.
64
65 Sub-devices that support the frame interval ioctls should implement them
66 on a single pad only. Their behaviour when supported on multiple pads of
67 the same sub-device is not defined.
68
69
70 .. c:type:: v4l2_subdev_frame_interval
71
72 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
73
74 .. flat-table:: struct v4l2_subdev_frame_interval
75     :header-rows:  0
76     :stub-columns: 0
77     :widths:       1 1 2
78
79     * - __u32
80       - ``pad``
81       - Pad number as reported by the media controller API.
82     * - struct :c:type:`v4l2_fract`
83       - ``interval``
84       - Period, in seconds, between consecutive video frames.
85     * - __u32
86       - ``reserved``\ [9]
87       - Reserved for future extensions. Applications and drivers must set
88         the array to zero.
89
90
91 Return Value
92 ============
93
94 On success 0 is returned, on error -1 and the ``errno`` variable is set
95 appropriately. The generic error codes are described at the
96 :ref:`Generic Error Codes <gen-errors>` chapter.
97
98 EBUSY
99     The frame interval can't be changed because the pad is currently
100     busy. This can be caused, for instance, by an active video stream on
101     the pad. The ioctl must not be retried without performing another
102     action to fix the problem first. Only returned by
103     ``VIDIOC_SUBDEV_S_FRAME_INTERVAL``
104
105 EINVAL
106     The struct
107     :c:type:`v4l2_subdev_frame_interval`
108     ``pad`` references a non-existing pad, or the pad doesn't support
109     frame intervals.