aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc/uvc_ctrl.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@skynet.be>2009-06-26 10:39:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 11:17:18 -0400
commitb482d9231a73478763e6b42fd88ea453731a67eb (patch)
tree42428fb9002c4b97cae4de02b9f6abc71a9db726 /drivers/media/video/uvc/uvc_ctrl.c
parent042e143e8b21dca7c84e32c2e647980cb9101224 (diff)
V4L/DVB (12185): uvcvideo: Prefix all UVC constants with UVC_
In preparation to moving UVC constants to a public location, prefix all constants with UVC_ to avoid namespace clashes. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_ctrl.c')
-rw-r--r--drivers/media/video/uvc/uvc_ctrl.c205
1 files changed, 106 insertions, 99 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
index 36a6ba92df27..70043b1704fb 100644
--- a/drivers/media/video/uvc/uvc_ctrl.c
+++ b/drivers/media/video/uvc/uvc_ctrl.c
@@ -34,7 +34,7 @@
34static struct uvc_control_info uvc_ctrls[] = { 34static struct uvc_control_info uvc_ctrls[] = {
35 { 35 {
36 .entity = UVC_GUID_UVC_PROCESSING, 36 .entity = UVC_GUID_UVC_PROCESSING,
37 .selector = PU_BRIGHTNESS_CONTROL, 37 .selector = UVC_PU_BRIGHTNESS_CONTROL,
38 .index = 0, 38 .index = 0,
39 .size = 2, 39 .size = 2,
40 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 40 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -42,7 +42,7 @@ static struct uvc_control_info uvc_ctrls[] = {
42 }, 42 },
43 { 43 {
44 .entity = UVC_GUID_UVC_PROCESSING, 44 .entity = UVC_GUID_UVC_PROCESSING,
45 .selector = PU_CONTRAST_CONTROL, 45 .selector = UVC_PU_CONTRAST_CONTROL,
46 .index = 1, 46 .index = 1,
47 .size = 2, 47 .size = 2,
48 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 48 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -50,7 +50,7 @@ static struct uvc_control_info uvc_ctrls[] = {
50 }, 50 },
51 { 51 {
52 .entity = UVC_GUID_UVC_PROCESSING, 52 .entity = UVC_GUID_UVC_PROCESSING,
53 .selector = PU_HUE_CONTROL, 53 .selector = UVC_PU_HUE_CONTROL,
54 .index = 2, 54 .index = 2,
55 .size = 2, 55 .size = 2,
56 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 56 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -58,7 +58,7 @@ static struct uvc_control_info uvc_ctrls[] = {
58 }, 58 },
59 { 59 {
60 .entity = UVC_GUID_UVC_PROCESSING, 60 .entity = UVC_GUID_UVC_PROCESSING,
61 .selector = PU_SATURATION_CONTROL, 61 .selector = UVC_PU_SATURATION_CONTROL,
62 .index = 3, 62 .index = 3,
63 .size = 2, 63 .size = 2,
64 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 64 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -66,7 +66,7 @@ static struct uvc_control_info uvc_ctrls[] = {
66 }, 66 },
67 { 67 {
68 .entity = UVC_GUID_UVC_PROCESSING, 68 .entity = UVC_GUID_UVC_PROCESSING,
69 .selector = PU_SHARPNESS_CONTROL, 69 .selector = UVC_PU_SHARPNESS_CONTROL,
70 .index = 4, 70 .index = 4,
71 .size = 2, 71 .size = 2,
72 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 72 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -74,7 +74,7 @@ static struct uvc_control_info uvc_ctrls[] = {
74 }, 74 },
75 { 75 {
76 .entity = UVC_GUID_UVC_PROCESSING, 76 .entity = UVC_GUID_UVC_PROCESSING,
77 .selector = PU_GAMMA_CONTROL, 77 .selector = UVC_PU_GAMMA_CONTROL,
78 .index = 5, 78 .index = 5,
79 .size = 2, 79 .size = 2,
80 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 80 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -82,7 +82,7 @@ static struct uvc_control_info uvc_ctrls[] = {
82 }, 82 },
83 { 83 {
84 .entity = UVC_GUID_UVC_PROCESSING, 84 .entity = UVC_GUID_UVC_PROCESSING,
85 .selector = PU_WHITE_BALANCE_TEMPERATURE_CONTROL, 85 .selector = UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL,
86 .index = 6, 86 .index = 6,
87 .size = 2, 87 .size = 2,
88 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 88 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -90,7 +90,7 @@ static struct uvc_control_info uvc_ctrls[] = {
90 }, 90 },
91 { 91 {
92 .entity = UVC_GUID_UVC_PROCESSING, 92 .entity = UVC_GUID_UVC_PROCESSING,
93 .selector = PU_WHITE_BALANCE_COMPONENT_CONTROL, 93 .selector = UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL,
94 .index = 7, 94 .index = 7,
95 .size = 4, 95 .size = 4,
96 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 96 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -98,7 +98,7 @@ static struct uvc_control_info uvc_ctrls[] = {
98 }, 98 },
99 { 99 {
100 .entity = UVC_GUID_UVC_PROCESSING, 100 .entity = UVC_GUID_UVC_PROCESSING,
101 .selector = PU_BACKLIGHT_COMPENSATION_CONTROL, 101 .selector = UVC_PU_BACKLIGHT_COMPENSATION_CONTROL,
102 .index = 8, 102 .index = 8,
103 .size = 2, 103 .size = 2,
104 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 104 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -106,7 +106,7 @@ static struct uvc_control_info uvc_ctrls[] = {
106 }, 106 },
107 { 107 {
108 .entity = UVC_GUID_UVC_PROCESSING, 108 .entity = UVC_GUID_UVC_PROCESSING,
109 .selector = PU_GAIN_CONTROL, 109 .selector = UVC_PU_GAIN_CONTROL,
110 .index = 9, 110 .index = 9,
111 .size = 2, 111 .size = 2,
112 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 112 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -114,7 +114,7 @@ static struct uvc_control_info uvc_ctrls[] = {
114 }, 114 },
115 { 115 {
116 .entity = UVC_GUID_UVC_PROCESSING, 116 .entity = UVC_GUID_UVC_PROCESSING,
117 .selector = PU_POWER_LINE_FREQUENCY_CONTROL, 117 .selector = UVC_PU_POWER_LINE_FREQUENCY_CONTROL,
118 .index = 10, 118 .index = 10,
119 .size = 1, 119 .size = 1,
120 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 120 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -122,7 +122,7 @@ static struct uvc_control_info uvc_ctrls[] = {
122 }, 122 },
123 { 123 {
124 .entity = UVC_GUID_UVC_PROCESSING, 124 .entity = UVC_GUID_UVC_PROCESSING,
125 .selector = PU_HUE_AUTO_CONTROL, 125 .selector = UVC_PU_HUE_AUTO_CONTROL,
126 .index = 11, 126 .index = 11,
127 .size = 1, 127 .size = 1,
128 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR 128 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
@@ -130,7 +130,7 @@ static struct uvc_control_info uvc_ctrls[] = {
130 }, 130 },
131 { 131 {
132 .entity = UVC_GUID_UVC_PROCESSING, 132 .entity = UVC_GUID_UVC_PROCESSING,
133 .selector = PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL, 133 .selector = UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL,
134 .index = 12, 134 .index = 12,
135 .size = 1, 135 .size = 1,
136 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR 136 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
@@ -138,7 +138,7 @@ static struct uvc_control_info uvc_ctrls[] = {
138 }, 138 },
139 { 139 {
140 .entity = UVC_GUID_UVC_PROCESSING, 140 .entity = UVC_GUID_UVC_PROCESSING,
141 .selector = PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL, 141 .selector = UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL,
142 .index = 13, 142 .index = 13,
143 .size = 1, 143 .size = 1,
144 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR 144 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
@@ -146,7 +146,7 @@ static struct uvc_control_info uvc_ctrls[] = {
146 }, 146 },
147 { 147 {
148 .entity = UVC_GUID_UVC_PROCESSING, 148 .entity = UVC_GUID_UVC_PROCESSING,
149 .selector = PU_DIGITAL_MULTIPLIER_CONTROL, 149 .selector = UVC_PU_DIGITAL_MULTIPLIER_CONTROL,
150 .index = 14, 150 .index = 14,
151 .size = 2, 151 .size = 2,
152 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 152 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -154,7 +154,7 @@ static struct uvc_control_info uvc_ctrls[] = {
154 }, 154 },
155 { 155 {
156 .entity = UVC_GUID_UVC_PROCESSING, 156 .entity = UVC_GUID_UVC_PROCESSING,
157 .selector = PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL, 157 .selector = UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL,
158 .index = 15, 158 .index = 15,
159 .size = 2, 159 .size = 2,
160 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 160 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -162,21 +162,21 @@ static struct uvc_control_info uvc_ctrls[] = {
162 }, 162 },
163 { 163 {
164 .entity = UVC_GUID_UVC_PROCESSING, 164 .entity = UVC_GUID_UVC_PROCESSING,
165 .selector = PU_ANALOG_VIDEO_STANDARD_CONTROL, 165 .selector = UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL,
166 .index = 16, 166 .index = 16,
167 .size = 1, 167 .size = 1,
168 .flags = UVC_CONTROL_GET_CUR, 168 .flags = UVC_CONTROL_GET_CUR,
169 }, 169 },
170 { 170 {
171 .entity = UVC_GUID_UVC_PROCESSING, 171 .entity = UVC_GUID_UVC_PROCESSING,
172 .selector = PU_ANALOG_LOCK_STATUS_CONTROL, 172 .selector = UVC_PU_ANALOG_LOCK_STATUS_CONTROL,
173 .index = 17, 173 .index = 17,
174 .size = 1, 174 .size = 1,
175 .flags = UVC_CONTROL_GET_CUR, 175 .flags = UVC_CONTROL_GET_CUR,
176 }, 176 },
177 { 177 {
178 .entity = UVC_GUID_UVC_CAMERA, 178 .entity = UVC_GUID_UVC_CAMERA,
179 .selector = CT_SCANNING_MODE_CONTROL, 179 .selector = UVC_CT_SCANNING_MODE_CONTROL,
180 .index = 0, 180 .index = 0,
181 .size = 1, 181 .size = 1,
182 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR 182 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
@@ -184,7 +184,7 @@ static struct uvc_control_info uvc_ctrls[] = {
184 }, 184 },
185 { 185 {
186 .entity = UVC_GUID_UVC_CAMERA, 186 .entity = UVC_GUID_UVC_CAMERA,
187 .selector = CT_AE_MODE_CONTROL, 187 .selector = UVC_CT_AE_MODE_CONTROL,
188 .index = 1, 188 .index = 1,
189 .size = 1, 189 .size = 1,
190 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR 190 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
@@ -193,7 +193,7 @@ static struct uvc_control_info uvc_ctrls[] = {
193 }, 193 },
194 { 194 {
195 .entity = UVC_GUID_UVC_CAMERA, 195 .entity = UVC_GUID_UVC_CAMERA,
196 .selector = CT_AE_PRIORITY_CONTROL, 196 .selector = UVC_CT_AE_PRIORITY_CONTROL,
197 .index = 2, 197 .index = 2,
198 .size = 1, 198 .size = 1,
199 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR 199 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
@@ -201,7 +201,7 @@ static struct uvc_control_info uvc_ctrls[] = {
201 }, 201 },
202 { 202 {
203 .entity = UVC_GUID_UVC_CAMERA, 203 .entity = UVC_GUID_UVC_CAMERA,
204 .selector = CT_EXPOSURE_TIME_ABSOLUTE_CONTROL, 204 .selector = UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL,
205 .index = 3, 205 .index = 3,
206 .size = 4, 206 .size = 4,
207 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 207 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -209,7 +209,7 @@ static struct uvc_control_info uvc_ctrls[] = {
209 }, 209 },
210 { 210 {
211 .entity = UVC_GUID_UVC_CAMERA, 211 .entity = UVC_GUID_UVC_CAMERA,
212 .selector = CT_EXPOSURE_TIME_RELATIVE_CONTROL, 212 .selector = UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL,
213 .index = 4, 213 .index = 4,
214 .size = 1, 214 .size = 1,
215 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR 215 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
@@ -217,7 +217,7 @@ static struct uvc_control_info uvc_ctrls[] = {
217 }, 217 },
218 { 218 {
219 .entity = UVC_GUID_UVC_CAMERA, 219 .entity = UVC_GUID_UVC_CAMERA,
220 .selector = CT_FOCUS_ABSOLUTE_CONTROL, 220 .selector = UVC_CT_FOCUS_ABSOLUTE_CONTROL,
221 .index = 5, 221 .index = 5,
222 .size = 2, 222 .size = 2,
223 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 223 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -225,7 +225,7 @@ static struct uvc_control_info uvc_ctrls[] = {
225 }, 225 },
226 { 226 {
227 .entity = UVC_GUID_UVC_CAMERA, 227 .entity = UVC_GUID_UVC_CAMERA,
228 .selector = CT_FOCUS_RELATIVE_CONTROL, 228 .selector = UVC_CT_FOCUS_RELATIVE_CONTROL,
229 .index = 6, 229 .index = 6,
230 .size = 2, 230 .size = 2,
231 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 231 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -233,7 +233,7 @@ static struct uvc_control_info uvc_ctrls[] = {
233 }, 233 },
234 { 234 {
235 .entity = UVC_GUID_UVC_CAMERA, 235 .entity = UVC_GUID_UVC_CAMERA,
236 .selector = CT_IRIS_ABSOLUTE_CONTROL, 236 .selector = UVC_CT_IRIS_ABSOLUTE_CONTROL,
237 .index = 7, 237 .index = 7,
238 .size = 2, 238 .size = 2,
239 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 239 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -241,7 +241,7 @@ static struct uvc_control_info uvc_ctrls[] = {
241 }, 241 },
242 { 242 {
243 .entity = UVC_GUID_UVC_CAMERA, 243 .entity = UVC_GUID_UVC_CAMERA,
244 .selector = CT_IRIS_RELATIVE_CONTROL, 244 .selector = UVC_CT_IRIS_RELATIVE_CONTROL,
245 .index = 8, 245 .index = 8,
246 .size = 1, 246 .size = 1,
247 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR 247 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
@@ -249,7 +249,7 @@ static struct uvc_control_info uvc_ctrls[] = {
249 }, 249 },
250 { 250 {
251 .entity = UVC_GUID_UVC_CAMERA, 251 .entity = UVC_GUID_UVC_CAMERA,
252 .selector = CT_ZOOM_ABSOLUTE_CONTROL, 252 .selector = UVC_CT_ZOOM_ABSOLUTE_CONTROL,
253 .index = 9, 253 .index = 9,
254 .size = 2, 254 .size = 2,
255 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 255 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -257,7 +257,7 @@ static struct uvc_control_info uvc_ctrls[] = {
257 }, 257 },
258 { 258 {
259 .entity = UVC_GUID_UVC_CAMERA, 259 .entity = UVC_GUID_UVC_CAMERA,
260 .selector = CT_ZOOM_RELATIVE_CONTROL, 260 .selector = UVC_CT_ZOOM_RELATIVE_CONTROL,
261 .index = 10, 261 .index = 10,
262 .size = 3, 262 .size = 3,
263 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 263 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -265,7 +265,7 @@ static struct uvc_control_info uvc_ctrls[] = {
265 }, 265 },
266 { 266 {
267 .entity = UVC_GUID_UVC_CAMERA, 267 .entity = UVC_GUID_UVC_CAMERA,
268 .selector = CT_PANTILT_ABSOLUTE_CONTROL, 268 .selector = UVC_CT_PANTILT_ABSOLUTE_CONTROL,
269 .index = 11, 269 .index = 11,
270 .size = 8, 270 .size = 8,
271 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 271 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -273,7 +273,7 @@ static struct uvc_control_info uvc_ctrls[] = {
273 }, 273 },
274 { 274 {
275 .entity = UVC_GUID_UVC_CAMERA, 275 .entity = UVC_GUID_UVC_CAMERA,
276 .selector = CT_PANTILT_RELATIVE_CONTROL, 276 .selector = UVC_CT_PANTILT_RELATIVE_CONTROL,
277 .index = 12, 277 .index = 12,
278 .size = 4, 278 .size = 4,
279 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 279 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -281,7 +281,7 @@ static struct uvc_control_info uvc_ctrls[] = {
281 }, 281 },
282 { 282 {
283 .entity = UVC_GUID_UVC_CAMERA, 283 .entity = UVC_GUID_UVC_CAMERA,
284 .selector = CT_ROLL_ABSOLUTE_CONTROL, 284 .selector = UVC_CT_ROLL_ABSOLUTE_CONTROL,
285 .index = 13, 285 .index = 13,
286 .size = 2, 286 .size = 2,
287 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 287 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -289,7 +289,7 @@ static struct uvc_control_info uvc_ctrls[] = {
289 }, 289 },
290 { 290 {
291 .entity = UVC_GUID_UVC_CAMERA, 291 .entity = UVC_GUID_UVC_CAMERA,
292 .selector = CT_ROLL_RELATIVE_CONTROL, 292 .selector = UVC_CT_ROLL_RELATIVE_CONTROL,
293 .index = 14, 293 .index = 14,
294 .size = 2, 294 .size = 2,
295 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE 295 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE
@@ -297,7 +297,7 @@ static struct uvc_control_info uvc_ctrls[] = {
297 }, 297 },
298 { 298 {
299 .entity = UVC_GUID_UVC_CAMERA, 299 .entity = UVC_GUID_UVC_CAMERA,
300 .selector = CT_FOCUS_AUTO_CONTROL, 300 .selector = UVC_CT_FOCUS_AUTO_CONTROL,
301 .index = 17, 301 .index = 17,
302 .size = 1, 302 .size = 1,
303 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR 303 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
@@ -305,7 +305,7 @@ static struct uvc_control_info uvc_ctrls[] = {
305 }, 305 },
306 { 306 {
307 .entity = UVC_GUID_UVC_CAMERA, 307 .entity = UVC_GUID_UVC_CAMERA,
308 .selector = CT_PRIVACY_CONTROL, 308 .selector = UVC_CT_PRIVACY_CONTROL,
309 .index = 18, 309 .index = 18,
310 .size = 1, 310 .size = 1,
311 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR 311 .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR
@@ -332,13 +332,13 @@ static __s32 uvc_ctrl_get_zoom(struct uvc_control_mapping *mapping,
332 __s8 zoom = (__s8)data[0]; 332 __s8 zoom = (__s8)data[0];
333 333
334 switch (query) { 334 switch (query) {
335 case GET_CUR: 335 case UVC_GET_CUR:
336 return (zoom == 0) ? 0 : (zoom > 0 ? data[2] : -data[2]); 336 return (zoom == 0) ? 0 : (zoom > 0 ? data[2] : -data[2]);
337 337
338 case GET_MIN: 338 case UVC_GET_MIN:
339 case GET_MAX: 339 case UVC_GET_MAX:
340 case GET_RES: 340 case UVC_GET_RES:
341 case GET_DEF: 341 case UVC_GET_DEF:
342 default: 342 default:
343 return data[2]; 343 return data[2];
344 } 344 }
@@ -356,7 +356,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
356 .id = V4L2_CID_BRIGHTNESS, 356 .id = V4L2_CID_BRIGHTNESS,
357 .name = "Brightness", 357 .name = "Brightness",
358 .entity = UVC_GUID_UVC_PROCESSING, 358 .entity = UVC_GUID_UVC_PROCESSING,
359 .selector = PU_BRIGHTNESS_CONTROL, 359 .selector = UVC_PU_BRIGHTNESS_CONTROL,
360 .size = 16, 360 .size = 16,
361 .offset = 0, 361 .offset = 0,
362 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 362 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -366,7 +366,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
366 .id = V4L2_CID_CONTRAST, 366 .id = V4L2_CID_CONTRAST,
367 .name = "Contrast", 367 .name = "Contrast",
368 .entity = UVC_GUID_UVC_PROCESSING, 368 .entity = UVC_GUID_UVC_PROCESSING,
369 .selector = PU_CONTRAST_CONTROL, 369 .selector = UVC_PU_CONTRAST_CONTROL,
370 .size = 16, 370 .size = 16,
371 .offset = 0, 371 .offset = 0,
372 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 372 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -376,7 +376,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
376 .id = V4L2_CID_HUE, 376 .id = V4L2_CID_HUE,
377 .name = "Hue", 377 .name = "Hue",
378 .entity = UVC_GUID_UVC_PROCESSING, 378 .entity = UVC_GUID_UVC_PROCESSING,
379 .selector = PU_HUE_CONTROL, 379 .selector = UVC_PU_HUE_CONTROL,
380 .size = 16, 380 .size = 16,
381 .offset = 0, 381 .offset = 0,
382 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 382 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -386,7 +386,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
386 .id = V4L2_CID_SATURATION, 386 .id = V4L2_CID_SATURATION,
387 .name = "Saturation", 387 .name = "Saturation",
388 .entity = UVC_GUID_UVC_PROCESSING, 388 .entity = UVC_GUID_UVC_PROCESSING,
389 .selector = PU_SATURATION_CONTROL, 389 .selector = UVC_PU_SATURATION_CONTROL,
390 .size = 16, 390 .size = 16,
391 .offset = 0, 391 .offset = 0,
392 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 392 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -396,7 +396,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
396 .id = V4L2_CID_SHARPNESS, 396 .id = V4L2_CID_SHARPNESS,
397 .name = "Sharpness", 397 .name = "Sharpness",
398 .entity = UVC_GUID_UVC_PROCESSING, 398 .entity = UVC_GUID_UVC_PROCESSING,
399 .selector = PU_SHARPNESS_CONTROL, 399 .selector = UVC_PU_SHARPNESS_CONTROL,
400 .size = 16, 400 .size = 16,
401 .offset = 0, 401 .offset = 0,
402 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 402 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -406,7 +406,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
406 .id = V4L2_CID_GAMMA, 406 .id = V4L2_CID_GAMMA,
407 .name = "Gamma", 407 .name = "Gamma",
408 .entity = UVC_GUID_UVC_PROCESSING, 408 .entity = UVC_GUID_UVC_PROCESSING,
409 .selector = PU_GAMMA_CONTROL, 409 .selector = UVC_PU_GAMMA_CONTROL,
410 .size = 16, 410 .size = 16,
411 .offset = 0, 411 .offset = 0,
412 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 412 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -416,7 +416,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
416 .id = V4L2_CID_BACKLIGHT_COMPENSATION, 416 .id = V4L2_CID_BACKLIGHT_COMPENSATION,
417 .name = "Backlight Compensation", 417 .name = "Backlight Compensation",
418 .entity = UVC_GUID_UVC_PROCESSING, 418 .entity = UVC_GUID_UVC_PROCESSING,
419 .selector = PU_BACKLIGHT_COMPENSATION_CONTROL, 419 .selector = UVC_PU_BACKLIGHT_COMPENSATION_CONTROL,
420 .size = 16, 420 .size = 16,
421 .offset = 0, 421 .offset = 0,
422 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 422 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -426,7 +426,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
426 .id = V4L2_CID_GAIN, 426 .id = V4L2_CID_GAIN,
427 .name = "Gain", 427 .name = "Gain",
428 .entity = UVC_GUID_UVC_PROCESSING, 428 .entity = UVC_GUID_UVC_PROCESSING,
429 .selector = PU_GAIN_CONTROL, 429 .selector = UVC_PU_GAIN_CONTROL,
430 .size = 16, 430 .size = 16,
431 .offset = 0, 431 .offset = 0,
432 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 432 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -436,7 +436,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
436 .id = V4L2_CID_POWER_LINE_FREQUENCY, 436 .id = V4L2_CID_POWER_LINE_FREQUENCY,
437 .name = "Power Line Frequency", 437 .name = "Power Line Frequency",
438 .entity = UVC_GUID_UVC_PROCESSING, 438 .entity = UVC_GUID_UVC_PROCESSING,
439 .selector = PU_POWER_LINE_FREQUENCY_CONTROL, 439 .selector = UVC_PU_POWER_LINE_FREQUENCY_CONTROL,
440 .size = 2, 440 .size = 2,
441 .offset = 0, 441 .offset = 0,
442 .v4l2_type = V4L2_CTRL_TYPE_MENU, 442 .v4l2_type = V4L2_CTRL_TYPE_MENU,
@@ -448,7 +448,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
448 .id = V4L2_CID_HUE_AUTO, 448 .id = V4L2_CID_HUE_AUTO,
449 .name = "Hue, Auto", 449 .name = "Hue, Auto",
450 .entity = UVC_GUID_UVC_PROCESSING, 450 .entity = UVC_GUID_UVC_PROCESSING,
451 .selector = PU_HUE_AUTO_CONTROL, 451 .selector = UVC_PU_HUE_AUTO_CONTROL,
452 .size = 1, 452 .size = 1,
453 .offset = 0, 453 .offset = 0,
454 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN, 454 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN,
@@ -458,7 +458,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
458 .id = V4L2_CID_EXPOSURE_AUTO, 458 .id = V4L2_CID_EXPOSURE_AUTO,
459 .name = "Exposure, Auto", 459 .name = "Exposure, Auto",
460 .entity = UVC_GUID_UVC_CAMERA, 460 .entity = UVC_GUID_UVC_CAMERA,
461 .selector = CT_AE_MODE_CONTROL, 461 .selector = UVC_CT_AE_MODE_CONTROL,
462 .size = 4, 462 .size = 4,
463 .offset = 0, 463 .offset = 0,
464 .v4l2_type = V4L2_CTRL_TYPE_MENU, 464 .v4l2_type = V4L2_CTRL_TYPE_MENU,
@@ -470,7 +470,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
470 .id = V4L2_CID_EXPOSURE_AUTO_PRIORITY, 470 .id = V4L2_CID_EXPOSURE_AUTO_PRIORITY,
471 .name = "Exposure, Auto Priority", 471 .name = "Exposure, Auto Priority",
472 .entity = UVC_GUID_UVC_CAMERA, 472 .entity = UVC_GUID_UVC_CAMERA,
473 .selector = CT_AE_PRIORITY_CONTROL, 473 .selector = UVC_CT_AE_PRIORITY_CONTROL,
474 .size = 1, 474 .size = 1,
475 .offset = 0, 475 .offset = 0,
476 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN, 476 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN,
@@ -480,7 +480,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
480 .id = V4L2_CID_EXPOSURE_ABSOLUTE, 480 .id = V4L2_CID_EXPOSURE_ABSOLUTE,
481 .name = "Exposure (Absolute)", 481 .name = "Exposure (Absolute)",
482 .entity = UVC_GUID_UVC_CAMERA, 482 .entity = UVC_GUID_UVC_CAMERA,
483 .selector = CT_EXPOSURE_TIME_ABSOLUTE_CONTROL, 483 .selector = UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL,
484 .size = 32, 484 .size = 32,
485 .offset = 0, 485 .offset = 0,
486 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 486 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -490,7 +490,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
490 .id = V4L2_CID_AUTO_WHITE_BALANCE, 490 .id = V4L2_CID_AUTO_WHITE_BALANCE,
491 .name = "White Balance Temperature, Auto", 491 .name = "White Balance Temperature, Auto",
492 .entity = UVC_GUID_UVC_PROCESSING, 492 .entity = UVC_GUID_UVC_PROCESSING,
493 .selector = PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL, 493 .selector = UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL,
494 .size = 1, 494 .size = 1,
495 .offset = 0, 495 .offset = 0,
496 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN, 496 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN,
@@ -500,7 +500,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
500 .id = V4L2_CID_WHITE_BALANCE_TEMPERATURE, 500 .id = V4L2_CID_WHITE_BALANCE_TEMPERATURE,
501 .name = "White Balance Temperature", 501 .name = "White Balance Temperature",
502 .entity = UVC_GUID_UVC_PROCESSING, 502 .entity = UVC_GUID_UVC_PROCESSING,
503 .selector = PU_WHITE_BALANCE_TEMPERATURE_CONTROL, 503 .selector = UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL,
504 .size = 16, 504 .size = 16,
505 .offset = 0, 505 .offset = 0,
506 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 506 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -510,7 +510,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
510 .id = V4L2_CID_AUTO_WHITE_BALANCE, 510 .id = V4L2_CID_AUTO_WHITE_BALANCE,
511 .name = "White Balance Component, Auto", 511 .name = "White Balance Component, Auto",
512 .entity = UVC_GUID_UVC_PROCESSING, 512 .entity = UVC_GUID_UVC_PROCESSING,
513 .selector = PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL, 513 .selector = UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL,
514 .size = 1, 514 .size = 1,
515 .offset = 0, 515 .offset = 0,
516 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN, 516 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN,
@@ -520,7 +520,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
520 .id = V4L2_CID_BLUE_BALANCE, 520 .id = V4L2_CID_BLUE_BALANCE,
521 .name = "White Balance Blue Component", 521 .name = "White Balance Blue Component",
522 .entity = UVC_GUID_UVC_PROCESSING, 522 .entity = UVC_GUID_UVC_PROCESSING,
523 .selector = PU_WHITE_BALANCE_COMPONENT_CONTROL, 523 .selector = UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL,
524 .size = 16, 524 .size = 16,
525 .offset = 0, 525 .offset = 0,
526 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 526 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -530,7 +530,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
530 .id = V4L2_CID_RED_BALANCE, 530 .id = V4L2_CID_RED_BALANCE,
531 .name = "White Balance Red Component", 531 .name = "White Balance Red Component",
532 .entity = UVC_GUID_UVC_PROCESSING, 532 .entity = UVC_GUID_UVC_PROCESSING,
533 .selector = PU_WHITE_BALANCE_COMPONENT_CONTROL, 533 .selector = UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL,
534 .size = 16, 534 .size = 16,
535 .offset = 16, 535 .offset = 16,
536 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 536 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -540,7 +540,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
540 .id = V4L2_CID_FOCUS_ABSOLUTE, 540 .id = V4L2_CID_FOCUS_ABSOLUTE,
541 .name = "Focus (absolute)", 541 .name = "Focus (absolute)",
542 .entity = UVC_GUID_UVC_CAMERA, 542 .entity = UVC_GUID_UVC_CAMERA,
543 .selector = CT_FOCUS_ABSOLUTE_CONTROL, 543 .selector = UVC_CT_FOCUS_ABSOLUTE_CONTROL,
544 .size = 16, 544 .size = 16,
545 .offset = 0, 545 .offset = 0,
546 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 546 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -550,7 +550,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
550 .id = V4L2_CID_FOCUS_AUTO, 550 .id = V4L2_CID_FOCUS_AUTO,
551 .name = "Focus, Auto", 551 .name = "Focus, Auto",
552 .entity = UVC_GUID_UVC_CAMERA, 552 .entity = UVC_GUID_UVC_CAMERA,
553 .selector = CT_FOCUS_AUTO_CONTROL, 553 .selector = UVC_CT_FOCUS_AUTO_CONTROL,
554 .size = 1, 554 .size = 1,
555 .offset = 0, 555 .offset = 0,
556 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN, 556 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN,
@@ -560,7 +560,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
560 .id = V4L2_CID_ZOOM_ABSOLUTE, 560 .id = V4L2_CID_ZOOM_ABSOLUTE,
561 .name = "Zoom, Absolute", 561 .name = "Zoom, Absolute",
562 .entity = UVC_GUID_UVC_CAMERA, 562 .entity = UVC_GUID_UVC_CAMERA,
563 .selector = CT_ZOOM_ABSOLUTE_CONTROL, 563 .selector = UVC_CT_ZOOM_ABSOLUTE_CONTROL,
564 .size = 16, 564 .size = 16,
565 .offset = 0, 565 .offset = 0,
566 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 566 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -570,7 +570,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
570 .id = V4L2_CID_ZOOM_CONTINUOUS, 570 .id = V4L2_CID_ZOOM_CONTINUOUS,
571 .name = "Zoom, Continuous", 571 .name = "Zoom, Continuous",
572 .entity = UVC_GUID_UVC_CAMERA, 572 .entity = UVC_GUID_UVC_CAMERA,
573 .selector = CT_ZOOM_RELATIVE_CONTROL, 573 .selector = UVC_CT_ZOOM_RELATIVE_CONTROL,
574 .size = 0, 574 .size = 0,
575 .offset = 0, 575 .offset = 0,
576 .v4l2_type = V4L2_CTRL_TYPE_INTEGER, 576 .v4l2_type = V4L2_CTRL_TYPE_INTEGER,
@@ -582,7 +582,7 @@ static struct uvc_control_mapping uvc_ctrl_mappings[] = {
582 .id = V4L2_CID_PRIVACY, 582 .id = V4L2_CID_PRIVACY,
583 .name = "Privacy", 583 .name = "Privacy",
584 .entity = UVC_GUID_UVC_CAMERA, 584 .entity = UVC_GUID_UVC_CAMERA,
585 .selector = CT_PRIVACY_CONTROL, 585 .selector = UVC_CT_PRIVACY_CONTROL,
586 .size = 1, 586 .size = 1,
587 .offset = 0, 587 .offset = 0,
588 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN, 588 .v4l2_type = V4L2_CTRL_TYPE_BOOLEAN,
@@ -675,16 +675,16 @@ static const __u8 uvc_media_transport_input_guid[16] =
675static int uvc_entity_match_guid(struct uvc_entity *entity, __u8 guid[16]) 675static int uvc_entity_match_guid(struct uvc_entity *entity, __u8 guid[16])
676{ 676{
677 switch (UVC_ENTITY_TYPE(entity)) { 677 switch (UVC_ENTITY_TYPE(entity)) {
678 case ITT_CAMERA: 678 case UVC_ITT_CAMERA:
679 return memcmp(uvc_camera_guid, guid, 16) == 0; 679 return memcmp(uvc_camera_guid, guid, 16) == 0;
680 680
681 case ITT_MEDIA_TRANSPORT_INPUT: 681 case UVC_ITT_MEDIA_TRANSPORT_INPUT:
682 return memcmp(uvc_media_transport_input_guid, guid, 16) == 0; 682 return memcmp(uvc_media_transport_input_guid, guid, 16) == 0;
683 683
684 case VC_PROCESSING_UNIT: 684 case UVC_VC_PROCESSING_UNIT:
685 return memcmp(uvc_processing_guid, guid, 16) == 0; 685 return memcmp(uvc_processing_guid, guid, 16) == 0;
686 686
687 case VC_EXTENSION_UNIT: 687 case UVC_VC_EXTENSION_UNIT:
688 return memcmp(entity->extension.guidExtensionCode, 688 return memcmp(entity->extension.guidExtensionCode,
689 guid, 16) == 0; 689 guid, 16) == 0;
690 690
@@ -793,11 +793,13 @@ int uvc_query_v4l2_ctrl(struct uvc_video_device *video,
793 v4l2_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; 793 v4l2_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY;
794 794
795 if (ctrl->info->flags & UVC_CONTROL_GET_DEF) { 795 if (ctrl->info->flags & UVC_CONTROL_GET_DEF) {
796 if ((ret = uvc_query_ctrl(video->dev, GET_DEF, ctrl->entity->id, 796 ret = uvc_query_ctrl(video->dev, UVC_GET_DEF, ctrl->entity->id,
797 video->dev->intfnum, ctrl->info->selector, 797 video->dev->intfnum, ctrl->info->selector, data,
798 data, ctrl->info->size)) < 0) 798 ctrl->info->size);
799 if (ret < 0)
799 goto out; 800 goto out;
800 v4l2_ctrl->default_value = mapping->get(mapping, GET_DEF, data); 801 v4l2_ctrl->default_value =
802 mapping->get(mapping, UVC_GET_DEF, data);
801 } 803 }
802 804
803 switch (mapping->v4l2_type) { 805 switch (mapping->v4l2_type) {
@@ -829,25 +831,28 @@ int uvc_query_v4l2_ctrl(struct uvc_video_device *video,
829 } 831 }
830 832
831 if (ctrl->info->flags & UVC_CONTROL_GET_MIN) { 833 if (ctrl->info->flags & UVC_CONTROL_GET_MIN) {
832 if ((ret = uvc_query_ctrl(video->dev, GET_MIN, ctrl->entity->id, 834 ret = uvc_query_ctrl(video->dev, UVC_GET_MIN, ctrl->entity->id,
833 video->dev->intfnum, ctrl->info->selector, 835 video->dev->intfnum, ctrl->info->selector, data,
834 data, ctrl->info->size)) < 0) 836 ctrl->info->size);
837 if (ret < 0)
835 goto out; 838 goto out;
836 v4l2_ctrl->minimum = mapping->get(mapping, GET_MIN, data); 839 v4l2_ctrl->minimum = mapping->get(mapping, UVC_GET_MIN, data);
837 } 840 }
838 if (ctrl->info->flags & UVC_CONTROL_GET_MAX) { 841 if (ctrl->info->flags & UVC_CONTROL_GET_MAX) {
839 if ((ret = uvc_query_ctrl(video->dev, GET_MAX, ctrl->entity->id, 842 ret = uvc_query_ctrl(video->dev, UVC_GET_MAX, ctrl->entity->id,
840 video->dev->intfnum, ctrl->info->selector, 843 video->dev->intfnum, ctrl->info->selector, data,
841 data, ctrl->info->size)) < 0) 844 ctrl->info->size);
845 if (ret < 0)
842 goto out; 846 goto out;
843 v4l2_ctrl->maximum = mapping->get(mapping, GET_MAX, data); 847 v4l2_ctrl->maximum = mapping->get(mapping, UVC_GET_MAX, data);
844 } 848 }
845 if (ctrl->info->flags & UVC_CONTROL_GET_RES) { 849 if (ctrl->info->flags & UVC_CONTROL_GET_RES) {
846 if ((ret = uvc_query_ctrl(video->dev, GET_RES, ctrl->entity->id, 850 ret = uvc_query_ctrl(video->dev, UVC_GET_RES, ctrl->entity->id,
847 video->dev->intfnum, ctrl->info->selector, 851 video->dev->intfnum, ctrl->info->selector, data,
848 data, ctrl->info->size)) < 0) 852 ctrl->info->size);
853 if (ret < 0)
849 goto out; 854 goto out;
850 v4l2_ctrl->step = mapping->get(mapping, GET_RES, data); 855 v4l2_ctrl->step = mapping->get(mapping, UVC_GET_RES, data);
851 } 856 }
852 857
853 ret = 0; 858 ret = 0;
@@ -912,7 +917,7 @@ static int uvc_ctrl_commit_entity(struct uvc_device *dev,
912 continue; 917 continue;
913 918
914 if (!rollback) 919 if (!rollback)
915 ret = uvc_query_ctrl(dev, SET_CUR, ctrl->entity->id, 920 ret = uvc_query_ctrl(dev, UVC_SET_CUR, ctrl->entity->id,
916 dev->intfnum, ctrl->info->selector, 921 dev->intfnum, ctrl->info->selector,
917 uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT), 922 uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT),
918 ctrl->info->size); 923 ctrl->info->size);
@@ -974,7 +979,7 @@ int uvc_ctrl_get(struct uvc_video_device *video,
974 return -EINVAL; 979 return -EINVAL;
975 980
976 if (!ctrl->loaded) { 981 if (!ctrl->loaded) {
977 ret = uvc_query_ctrl(video->dev, GET_CUR, ctrl->entity->id, 982 ret = uvc_query_ctrl(video->dev, UVC_GET_CUR, ctrl->entity->id,
978 video->dev->intfnum, ctrl->info->selector, 983 video->dev->intfnum, ctrl->info->selector,
979 uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT), 984 uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT),
980 ctrl->info->size); 985 ctrl->info->size);
@@ -984,7 +989,7 @@ int uvc_ctrl_get(struct uvc_video_device *video,
984 ctrl->loaded = 1; 989 ctrl->loaded = 1;
985 } 990 }
986 991
987 xctrl->value = mapping->get(mapping, GET_CUR, 992 xctrl->value = mapping->get(mapping, UVC_GET_CUR,
988 uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT)); 993 uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT));
989 994
990 if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) { 995 if (mapping->v4l2_type == V4L2_CTRL_TYPE_MENU) {
@@ -1023,7 +1028,7 @@ int uvc_ctrl_set(struct uvc_video_device *video,
1023 memset(uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT), 1028 memset(uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT),
1024 0, ctrl->info->size); 1029 0, ctrl->info->size);
1025 } else { 1030 } else {
1026 ret = uvc_query_ctrl(video->dev, GET_CUR, 1031 ret = uvc_query_ctrl(video->dev, UVC_GET_CUR,
1027 ctrl->entity->id, video->dev->intfnum, 1032 ctrl->entity->id, video->dev->intfnum,
1028 ctrl->info->selector, 1033 ctrl->info->selector,
1029 uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT), 1034 uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT),
@@ -1115,9 +1120,9 @@ int uvc_xu_ctrl_query(struct uvc_video_device *video,
1115 goto out; 1120 goto out;
1116 } 1121 }
1117 1122
1118 ret = uvc_query_ctrl(video->dev, set ? SET_CUR : GET_CUR, xctrl->unit, 1123 ret = uvc_query_ctrl(video->dev, set ? UVC_SET_CUR : UVC_GET_CUR,
1119 video->dev->intfnum, xctrl->selector, data, 1124 xctrl->unit, video->dev->intfnum, xctrl->selector,
1120 xctrl->size); 1125 data, xctrl->size);
1121 if (ret < 0) 1126 if (ret < 0)
1122 goto out; 1127 goto out;
1123 1128
@@ -1211,7 +1216,7 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev,
1211 if (!found) 1216 if (!found)
1212 return; 1217 return;
1213 1218
1214 if (UVC_ENTITY_TYPE(entity) == VC_EXTENSION_UNIT) { 1219 if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT) {
1215 /* Check if the device control information and length match 1220 /* Check if the device control information and length match
1216 * the user supplied information. 1221 * the user supplied information.
1217 */ 1222 */
@@ -1219,8 +1224,9 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev,
1219 __le16 size; 1224 __le16 size;
1220 __u8 inf; 1225 __u8 inf;
1221 1226
1222 if ((ret = uvc_query_ctrl(dev, GET_LEN, ctrl->entity->id, 1227 ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id,
1223 dev->intfnum, info->selector, (__u8 *)&size, 2)) < 0) { 1228 dev->intfnum, info->selector, (__u8 *)&size, 2);
1229 if (ret < 0) {
1224 uvc_trace(UVC_TRACE_CONTROL, "GET_LEN failed on " 1230 uvc_trace(UVC_TRACE_CONTROL, "GET_LEN failed on "
1225 "control " UVC_GUID_FORMAT "/%u (%d).\n", 1231 "control " UVC_GUID_FORMAT "/%u (%d).\n",
1226 UVC_GUID_ARGS(info->entity), info->selector, 1232 UVC_GUID_ARGS(info->entity), info->selector,
@@ -1236,8 +1242,9 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev,
1236 return; 1242 return;
1237 } 1243 }
1238 1244
1239 if ((ret = uvc_query_ctrl(dev, GET_INFO, ctrl->entity->id, 1245 ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id,
1240 dev->intfnum, info->selector, &inf, 1)) < 0) { 1246 dev->intfnum, info->selector, &inf, 1);
1247 if (ret < 0) {
1241 uvc_trace(UVC_TRACE_CONTROL, "GET_INFO failed on " 1248 uvc_trace(UVC_TRACE_CONTROL, "GET_INFO failed on "
1242 "control " UVC_GUID_FORMAT "/%u (%d).\n", 1249 "control " UVC_GUID_FORMAT "/%u (%d).\n",
1243 UVC_GUID_ARGS(info->entity), info->selector, 1250 UVC_GUID_ARGS(info->entity), info->selector,
@@ -1391,7 +1398,7 @@ uvc_ctrl_prune_entity(struct uvc_device *dev, struct uvc_entity *entity)
1391 unsigned int size; 1398 unsigned int size;
1392 unsigned int i; 1399 unsigned int i;
1393 1400
1394 if (UVC_ENTITY_TYPE(entity) != VC_PROCESSING_UNIT) 1401 if (UVC_ENTITY_TYPE(entity) != UVC_VC_PROCESSING_UNIT)
1395 return; 1402 return;
1396 1403
1397 controls = entity->processing.bmControls; 1404 controls = entity->processing.bmControls;
@@ -1427,13 +1434,13 @@ int uvc_ctrl_init_device(struct uvc_device *dev)
1427 unsigned int bControlSize = 0, ncontrols = 0; 1434 unsigned int bControlSize = 0, ncontrols = 0;
1428 __u8 *bmControls = NULL; 1435 __u8 *bmControls = NULL;
1429 1436
1430 if (UVC_ENTITY_TYPE(entity) == VC_EXTENSION_UNIT) { 1437 if (UVC_ENTITY_TYPE(entity) == UVC_VC_EXTENSION_UNIT) {
1431 bmControls = entity->extension.bmControls; 1438 bmControls = entity->extension.bmControls;
1432 bControlSize = entity->extension.bControlSize; 1439 bControlSize = entity->extension.bControlSize;
1433 } else if (UVC_ENTITY_TYPE(entity) == VC_PROCESSING_UNIT) { 1440 } else if (UVC_ENTITY_TYPE(entity) == UVC_VC_PROCESSING_UNIT) {
1434 bmControls = entity->processing.bmControls; 1441 bmControls = entity->processing.bmControls;
1435 bControlSize = entity->processing.bControlSize; 1442 bControlSize = entity->processing.bControlSize;
1436 } else if (UVC_ENTITY_TYPE(entity) == ITT_CAMERA) { 1443 } else if (UVC_ENTITY_TYPE(entity) == UVC_ITT_CAMERA) {
1437 bmControls = entity->camera.bmControls; 1444 bmControls = entity->camera.bmControls;
1438 bControlSize = entity->camera.bControlSize; 1445 bControlSize = entity->camera.bControlSize;
1439 } 1446 }