diff options
Diffstat (limited to 'Documentation/media/v4l-drivers/uvcvideo.rst')
| -rw-r--r-- | Documentation/media/v4l-drivers/uvcvideo.rst | 48 |
1 files changed, 32 insertions, 16 deletions
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 @@ | |||
| 1 | Linux USB Video Class (UVC) driver | 1 | The Linux USB Video Class (UVC) driver |
| 2 | ================================== | 2 | ====================================== |
| 3 | 3 | ||
| 4 | This file documents some driver-specific aspects of the UVC driver, such as | 4 | This file documents some driver-specific aspects of the UVC driver, such as |
| 5 | driver-specific ioctls and implementation notes. | 5 | driver-specific ioctls and implementation notes. |
| @@ -11,7 +11,8 @@ linux-uvc-devel@lists.berlios.de. | |||
| 11 | Extension Unit (XU) support | 11 | Extension Unit (XU) support |
| 12 | --------------------------- | 12 | --------------------------- |
| 13 | 13 | ||
| 14 | 1. Introduction | 14 | Introduction |
| 15 | ~~~~~~~~~~~~ | ||
| 15 | 16 | ||
| 16 | The UVC specification allows for vendor-specific extensions through extension | 17 | The UVC specification allows for vendor-specific extensions through extension |
| 17 | units (XUs). The Linux UVC driver supports extension unit controls (XU controls) | 18 | units (XUs). The Linux UVC driver supports extension unit controls (XU controls) |
| @@ -31,7 +32,8 @@ maximum flexibility. | |||
| 31 | Both mechanisms complement each other and are described in more detail below. | 32 | Both mechanisms complement each other and are described in more detail below. |
| 32 | 33 | ||
| 33 | 34 | ||
| 34 | 2. Control mappings | 35 | Control mappings |
| 36 | ~~~~~~~~~~~~~~~~ | ||
| 35 | 37 | ||
| 36 | The UVC driver provides an API for user space applications to define so-called | 38 | The UVC driver provides an API for user space applications to define so-called |
| 37 | control mappings at runtime. These allow for individual XU controls or byte | 39 | control 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 | ||
| 85 | 4. Security | 87 | Security |
| 88 | ~~~~~~~~ | ||
| 86 | 89 | ||
| 87 | The API doesn't currently provide a fine-grained access control facility. The | 90 | The API doesn't currently provide a fine-grained access control facility. The |
| 88 | UVCIOC_CTRL_ADD and UVCIOC_CTRL_MAP ioctls require super user permissions. | 91 | UVCIOC_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. | |||
| 90 | Suggestions on how to improve this are welcome. | 93 | Suggestions on how to improve this are welcome. |
| 91 | 94 | ||
| 92 | 95 | ||
| 93 | 5. Debugging | 96 | Debugging |
| 97 | ~~~~~~~~~ | ||
| 94 | 98 | ||
| 95 | In order to debug problems related to XU controls or controls in general it is | 99 | In order to debug problems related to XU controls or controls in general it is |
| 96 | recommended to enable the UVC_TRACE_CONTROL bit in the module parameter 'trace'. | 100 | recommended to enable the UVC_TRACE_CONTROL bit in the module parameter 'trace'. |
| 97 | This causes extra output to be written into the system log. | 101 | This causes extra output to be written into the system log. |
| 98 | 102 | ||
| 99 | 103 | ||
| 100 | 6. IOCTL reference | 104 | IOCTL reference |
| 105 | ~~~~~~~~~~~~~~~ | ||
| 101 | 106 | ||
| 102 | ---- UVCIOC_CTRL_MAP - Map a UVC control to a V4L2 control ---- | 107 | UVCIOC_CTRL_MAP - Map a UVC control to a V4L2 control |
| 108 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| 103 | 109 | ||
| 104 | Argument: struct uvc_xu_control_mapping | 110 | Argument: struct uvc_xu_control_mapping |
| 105 | 111 | ||
| 106 | Description: | 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 | ||
| 125 | Return 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 | ||
| 140 | Data 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 ---- | 184 | UVCIOC_CTRL_QUERY - Query a UVC XU control |
| 174 | 185 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| 175 | Argument: struct uvc_xu_control_query | 186 | Argument: struct uvc_xu_control_query |
| 176 | 187 | ||
| 177 | Description: | 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 | ||
| 216 | Return 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 | ||
| 232 | Data 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 |
