aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-17 19:50:45 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-07-17 21:51:26 -0400
commita965d2024fe6f45a33462a62826c23a2175f3d5a (patch)
tree50e6aad7842652be8f9efbd66bf852bd1a867abe
parentc0d0138255b37f362bb8559342cc0ac7da59b1be (diff)
[media] doc-rst: add documentation for uvcvideo
Convert it to ReST and add to media/v4l-drivers book. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--Documentation/media/v4l-drivers/index.rst1
-rw-r--r--Documentation/media/v4l-drivers/uvcvideo.rst48
2 files changed, 33 insertions, 16 deletions
diff --git a/Documentation/media/v4l-drivers/index.rst b/Documentation/media/v4l-drivers/index.rst
index a982d73abcb6..90224e0231df 100644
--- a/Documentation/media/v4l-drivers/index.rst
+++ b/Documentation/media/v4l-drivers/index.rst
@@ -39,4 +39,5 @@ License".
39 si4713 39 si4713
40 si476x 40 si476x
41 soc-camera 41 soc-camera
42 uvcvideo
42 zr364xx 43 zr364xx
diff --git a/Documentation/media/v4l-drivers/uvcvideo.rst b/Documentation/media/v4l-drivers/uvcvideo.rst
index 35ce19cddcf8..d68b3d59a4b5 100644
--- a/Documentation/media/v4l-drivers/uvcvideo.rst
+++ b/Documentation/media/v4l-drivers/uvcvideo.rst
@@ -1,5 +1,5 @@
1Linux USB Video Class (UVC) driver 1The Linux USB Video Class (UVC) driver
2================================== 2======================================
3 3
4This file documents some driver-specific aspects of the UVC driver, such as 4This file documents some driver-specific aspects of the UVC driver, such as
5driver-specific ioctls and implementation notes. 5driver-specific ioctls and implementation notes.
@@ -11,7 +11,8 @@ linux-uvc-devel@lists.berlios.de.
11Extension Unit (XU) support 11Extension Unit (XU) support
12--------------------------- 12---------------------------
13 13
141. Introduction 14Introduction
15~~~~~~~~~~~~
15 16
16The UVC specification allows for vendor-specific extensions through extension 17The UVC specification allows for vendor-specific extensions through extension
17units (XUs). The Linux UVC driver supports extension unit controls (XU controls) 18units (XUs). The Linux UVC driver supports extension unit controls (XU controls)
@@ -31,7 +32,8 @@ maximum flexibility.
31Both mechanisms complement each other and are described in more detail below. 32Both mechanisms complement each other and are described in more detail below.
32 33
33 34
342. Control mappings 35Control mappings
36~~~~~~~~~~~~~~~~
35 37
36The UVC driver provides an API for user space applications to define so-called 38The UVC driver provides an API for user space applications to define so-called
37control mappings at runtime. These allow for individual XU controls or byte 39control mappings at runtime. These allow for individual XU controls or byte
@@ -82,7 +84,8 @@ For details on the UVCIOC_CTRL_QUERY ioctl please refer to the section titled
82"IOCTL reference" below. 84"IOCTL reference" below.
83 85
84 86
854. Security 87Security
88~~~~~~~~
86 89
87The API doesn't currently provide a fine-grained access control facility. The 90The API doesn't currently provide a fine-grained access control facility. The
88UVCIOC_CTRL_ADD and UVCIOC_CTRL_MAP ioctls require super user permissions. 91UVCIOC_CTRL_ADD and UVCIOC_CTRL_MAP ioctls require super user permissions.
@@ -90,20 +93,24 @@ UVCIOC_CTRL_ADD and UVCIOC_CTRL_MAP ioctls require super user permissions.
90Suggestions on how to improve this are welcome. 93Suggestions on how to improve this are welcome.
91 94
92 95
935. Debugging 96Debugging
97~~~~~~~~~
94 98
95In order to debug problems related to XU controls or controls in general it is 99In order to debug problems related to XU controls or controls in general it is
96recommended to enable the UVC_TRACE_CONTROL bit in the module parameter 'trace'. 100recommended to enable the UVC_TRACE_CONTROL bit in the module parameter 'trace'.
97This causes extra output to be written into the system log. 101This causes extra output to be written into the system log.
98 102
99 103
1006. IOCTL reference 104IOCTL reference
105~~~~~~~~~~~~~~~
101 106
102---- UVCIOC_CTRL_MAP - Map a UVC control to a V4L2 control ---- 107UVCIOC_CTRL_MAP - Map a UVC control to a V4L2 control
108^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103 109
104Argument: struct uvc_xu_control_mapping 110Argument: struct uvc_xu_control_mapping
105 111
106Description: 112**Description**:
113
107 This ioctl creates a mapping between a UVC control or part of a UVC 114 This ioctl creates a mapping between a UVC control or part of a UVC
108 control and a V4L2 control. Once mappings are defined, userspace 115 control and a V4L2 control. Once mappings are defined, userspace
109 applications can access vendor-defined UVC control through the V4L2 116 applications can access vendor-defined UVC control through the V4L2
@@ -122,7 +129,8 @@ Description:
122 For signed integer V4L2 controls the data_type field should be set to 129 For signed integer V4L2 controls the data_type field should be set to
123 UVC_CTRL_DATA_TYPE_SIGNED. Other values are currently ignored. 130 UVC_CTRL_DATA_TYPE_SIGNED. Other values are currently ignored.
124 131
125Return value: 132**Return value**:
133
126 On success 0 is returned. On error -1 is returned and errno is set 134 On success 0 is returned. On error -1 is returned and errno is set
127 appropriately. 135 appropriately.
128 136
@@ -137,7 +145,10 @@ Return value:
137 EEXIST 145 EEXIST
138 Mapping already exists. 146 Mapping already exists.
139 147
140Data types: 148**Data types**:
149
150.. code-block:: none
151
141 * struct uvc_xu_control_mapping 152 * struct uvc_xu_control_mapping
142 153
143 __u32 id V4L2 control identifier 154 __u32 id V4L2 control identifier
@@ -170,11 +181,12 @@ Data types:
170 UVC_CTRL_DATA_TYPE_BITMASK Bitmask 181 UVC_CTRL_DATA_TYPE_BITMASK Bitmask
171 182
172 183
173---- UVCIOC_CTRL_QUERY - Query a UVC XU control ---- 184UVCIOC_CTRL_QUERY - Query a UVC XU control
174 185^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
175Argument: struct uvc_xu_control_query 186Argument: struct uvc_xu_control_query
176 187
177Description: 188**Description**:
189
178 This ioctl queries a UVC XU control identified by its extension unit ID 190 This ioctl queries a UVC XU control identified by its extension unit ID
179 and control selector. 191 and control selector.
180 192
@@ -213,7 +225,8 @@ Description:
213 important for the result of the UVC_GET_LEN requests, which is always 225 important for the result of the UVC_GET_LEN requests, which is always
214 returned as a little-endian 16-bit integer by the device. 226 returned as a little-endian 16-bit integer by the device.
215 227
216Return value: 228**Return value**:
229
217 On success 0 is returned. On error -1 is returned and errno is set 230 On success 0 is returned. On error -1 is returned and errno is set
218 appropriately. 231 appropriately.
219 232
@@ -229,7 +242,10 @@ Return value:
229 EFAULT 242 EFAULT
230 The data pointer references an inaccessible memory area. 243 The data pointer references an inaccessible memory area.
231 244
232Data types: 245**Data types**:
246
247.. code-block:: none
248
233 * struct uvc_xu_control_query 249 * struct uvc_xu_control_query
234 250
235 __u8 unit Extension unit ID 251 __u8 unit Extension unit ID