diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2014-09-08 19:02:08 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-09-09 10:49:03 -0400 |
commit | 7ea95b110811fa8e41f5960c278bcfc80b8b21c1 (patch) | |
tree | 7d3ac41dd7a19baba014ea06a9afabb903bbcf80 /drivers/usb/gadget | |
parent | 70aacc5777d1f1ca0a88067c9121ce86441bc4e0 (diff) |
usb: gadget: uvc: rename functions to avoid conflicts with host uvc
Prepare for separate compilation of uvc function's components.
Some symbols will have to be exported, so rename to avoid
conflicts with functions of the same name in host uvc.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Tested-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
[Rename uvc_video_pump and uvc_queue_head as well]
[Rename forgotten uvc_queue_cancel instance in a comment]
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/function/f_uvc.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/function/uvc_queue.c | 49 | ||||
-rw-r--r-- | drivers/usb/gadget/function/uvc_v4l2.c | 26 | ||||
-rw-r--r-- | drivers/usb/gadget/function/uvc_video.c | 34 |
4 files changed, 56 insertions, 55 deletions
diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c index 187c3a04cf70..ae5bcb49dddb 100644 --- a/drivers/usb/gadget/function/f_uvc.c +++ b/drivers/usb/gadget/function/f_uvc.c | |||
@@ -693,7 +693,7 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f) | |||
693 | } | 693 | } |
694 | 694 | ||
695 | /* Initialise video. */ | 695 | /* Initialise video. */ |
696 | ret = uvc_video_init(&uvc->video); | 696 | ret = uvcg_video_init(&uvc->video); |
697 | if (ret < 0) | 697 | if (ret < 0) |
698 | goto error; | 698 | goto error; |
699 | 699 | ||
diff --git a/drivers/usb/gadget/function/uvc_queue.c b/drivers/usb/gadget/function/uvc_queue.c index 8590f9ff0849..1e1bc73dba1f 100644 --- a/drivers/usb/gadget/function/uvc_queue.c +++ b/drivers/usb/gadget/function/uvc_queue.c | |||
@@ -28,7 +28,7 @@ | |||
28 | /* ------------------------------------------------------------------------ | 28 | /* ------------------------------------------------------------------------ |
29 | * Video buffers queue management. | 29 | * Video buffers queue management. |
30 | * | 30 | * |
31 | * Video queues is initialized by uvc_queue_init(). The function performs | 31 | * Video queues is initialized by uvcg_queue_init(). The function performs |
32 | * basic initialization of the uvc_video_queue struct and never fails. | 32 | * basic initialization of the uvc_video_queue struct and never fails. |
33 | * | 33 | * |
34 | * Video buffers are managed by videobuf2. The driver uses a mutex to protect | 34 | * Video buffers are managed by videobuf2. The driver uses a mutex to protect |
@@ -126,8 +126,8 @@ static struct vb2_ops uvc_queue_qops = { | |||
126 | .wait_finish = uvc_wait_finish, | 126 | .wait_finish = uvc_wait_finish, |
127 | }; | 127 | }; |
128 | 128 | ||
129 | static int uvc_queue_init(struct uvc_video_queue *queue, | 129 | static int uvcg_queue_init(struct uvc_video_queue *queue, |
130 | enum v4l2_buf_type type) | 130 | enum v4l2_buf_type type) |
131 | { | 131 | { |
132 | int ret; | 132 | int ret; |
133 | 133 | ||
@@ -154,7 +154,7 @@ static int uvc_queue_init(struct uvc_video_queue *queue, | |||
154 | /* | 154 | /* |
155 | * Free the video buffers. | 155 | * Free the video buffers. |
156 | */ | 156 | */ |
157 | static void uvc_free_buffers(struct uvc_video_queue *queue) | 157 | static void uvcg_free_buffers(struct uvc_video_queue *queue) |
158 | { | 158 | { |
159 | mutex_lock(&queue->mutex); | 159 | mutex_lock(&queue->mutex); |
160 | vb2_queue_release(&queue->queue); | 160 | vb2_queue_release(&queue->queue); |
@@ -164,8 +164,8 @@ static void uvc_free_buffers(struct uvc_video_queue *queue) | |||
164 | /* | 164 | /* |
165 | * Allocate the video buffers. | 165 | * Allocate the video buffers. |
166 | */ | 166 | */ |
167 | static int uvc_alloc_buffers(struct uvc_video_queue *queue, | 167 | static int uvcg_alloc_buffers(struct uvc_video_queue *queue, |
168 | struct v4l2_requestbuffers *rb) | 168 | struct v4l2_requestbuffers *rb) |
169 | { | 169 | { |
170 | int ret; | 170 | int ret; |
171 | 171 | ||
@@ -176,8 +176,8 @@ static int uvc_alloc_buffers(struct uvc_video_queue *queue, | |||
176 | return ret ? ret : rb->count; | 176 | return ret ? ret : rb->count; |
177 | } | 177 | } |
178 | 178 | ||
179 | static int uvc_query_buffer(struct uvc_video_queue *queue, | 179 | static int uvcg_query_buffer(struct uvc_video_queue *queue, |
180 | struct v4l2_buffer *buf) | 180 | struct v4l2_buffer *buf) |
181 | { | 181 | { |
182 | int ret; | 182 | int ret; |
183 | 183 | ||
@@ -188,8 +188,8 @@ static int uvc_query_buffer(struct uvc_video_queue *queue, | |||
188 | return ret; | 188 | return ret; |
189 | } | 189 | } |
190 | 190 | ||
191 | static int uvc_queue_buffer(struct uvc_video_queue *queue, | 191 | static int uvcg_queue_buffer(struct uvc_video_queue *queue, |
192 | struct v4l2_buffer *buf) | 192 | struct v4l2_buffer *buf) |
193 | { | 193 | { |
194 | unsigned long flags; | 194 | unsigned long flags; |
195 | int ret; | 195 | int ret; |
@@ -213,8 +213,8 @@ done: | |||
213 | * Dequeue a video buffer. If nonblocking is false, block until a buffer is | 213 | * Dequeue a video buffer. If nonblocking is false, block until a buffer is |
214 | * available. | 214 | * available. |
215 | */ | 215 | */ |
216 | static int uvc_dequeue_buffer(struct uvc_video_queue *queue, | 216 | static int uvcg_dequeue_buffer(struct uvc_video_queue *queue, |
217 | struct v4l2_buffer *buf, int nonblocking) | 217 | struct v4l2_buffer *buf, int nonblocking) |
218 | { | 218 | { |
219 | int ret; | 219 | int ret; |
220 | 220 | ||
@@ -231,8 +231,8 @@ static int uvc_dequeue_buffer(struct uvc_video_queue *queue, | |||
231 | * This function implements video queue polling and is intended to be used by | 231 | * This function implements video queue polling and is intended to be used by |
232 | * the device poll handler. | 232 | * the device poll handler. |
233 | */ | 233 | */ |
234 | static unsigned int uvc_queue_poll(struct uvc_video_queue *queue, | 234 | static unsigned int uvcg_queue_poll(struct uvc_video_queue *queue, |
235 | struct file *file, poll_table *wait) | 235 | struct file *file, poll_table *wait) |
236 | { | 236 | { |
237 | unsigned int ret; | 237 | unsigned int ret; |
238 | 238 | ||
@@ -243,8 +243,8 @@ static unsigned int uvc_queue_poll(struct uvc_video_queue *queue, | |||
243 | return ret; | 243 | return ret; |
244 | } | 244 | } |
245 | 245 | ||
246 | static int uvc_queue_mmap(struct uvc_video_queue *queue, | 246 | static int uvcg_queue_mmap(struct uvc_video_queue *queue, |
247 | struct vm_area_struct *vma) | 247 | struct vm_area_struct *vma) |
248 | { | 248 | { |
249 | int ret; | 249 | int ret; |
250 | 250 | ||
@@ -261,8 +261,9 @@ static int uvc_queue_mmap(struct uvc_video_queue *queue, | |||
261 | * | 261 | * |
262 | * NO-MMU arch need this function to make mmap() work correctly. | 262 | * NO-MMU arch need this function to make mmap() work correctly. |
263 | */ | 263 | */ |
264 | static unsigned long uvc_queue_get_unmapped_area(struct uvc_video_queue *queue, | 264 | static unsigned long uvcg_queue_get_unmapped_area( |
265 | unsigned long pgoff) | 265 | struct uvc_video_queue *queue, |
266 | unsigned long pgoff) | ||
266 | { | 267 | { |
267 | unsigned long ret; | 268 | unsigned long ret; |
268 | 269 | ||
@@ -285,7 +286,7 @@ static unsigned long uvc_queue_get_unmapped_area(struct uvc_video_queue *queue, | |||
285 | * This function acquires the irq spinlock and can be called from interrupt | 286 | * This function acquires the irq spinlock and can be called from interrupt |
286 | * context. | 287 | * context. |
287 | */ | 288 | */ |
288 | static void uvc_queue_cancel(struct uvc_video_queue *queue, int disconnect) | 289 | static void uvcg_queue_cancel(struct uvc_video_queue *queue, int disconnect) |
289 | { | 290 | { |
290 | struct uvc_buffer *buf; | 291 | struct uvc_buffer *buf; |
291 | unsigned long flags; | 292 | unsigned long flags; |
@@ -324,9 +325,9 @@ static void uvc_queue_cancel(struct uvc_video_queue *queue, int disconnect) | |||
324 | * the main queue. | 325 | * the main queue. |
325 | * | 326 | * |
326 | * This function can't be called from interrupt context. Use | 327 | * This function can't be called from interrupt context. Use |
327 | * uvc_queue_cancel() instead. | 328 | * uvcg_queue_cancel() instead. |
328 | */ | 329 | */ |
329 | static int uvc_queue_enable(struct uvc_video_queue *queue, int enable) | 330 | static int uvcg_queue_enable(struct uvc_video_queue *queue, int enable) |
330 | { | 331 | { |
331 | unsigned long flags; | 332 | unsigned long flags; |
332 | int ret = 0; | 333 | int ret = 0; |
@@ -363,8 +364,8 @@ done: | |||
363 | } | 364 | } |
364 | 365 | ||
365 | /* called with &queue_irqlock held.. */ | 366 | /* called with &queue_irqlock held.. */ |
366 | static struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue, | 367 | static struct uvc_buffer *uvcg_queue_next_buffer(struct uvc_video_queue *queue, |
367 | struct uvc_buffer *buf) | 368 | struct uvc_buffer *buf) |
368 | { | 369 | { |
369 | struct uvc_buffer *nextbuf; | 370 | struct uvc_buffer *nextbuf; |
370 | 371 | ||
@@ -392,7 +393,7 @@ static struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue, | |||
392 | return nextbuf; | 393 | return nextbuf; |
393 | } | 394 | } |
394 | 395 | ||
395 | static struct uvc_buffer *uvc_queue_head(struct uvc_video_queue *queue) | 396 | static struct uvc_buffer *uvcg_queue_head(struct uvc_video_queue *queue) |
396 | { | 397 | { |
397 | struct uvc_buffer *buf = NULL; | 398 | struct uvc_buffer *buf = NULL; |
398 | 399 | ||
diff --git a/drivers/usb/gadget/function/uvc_v4l2.c b/drivers/usb/gadget/function/uvc_v4l2.c index 14c3a3734b95..c85730eb36dd 100644 --- a/drivers/usb/gadget/function/uvc_v4l2.c +++ b/drivers/usb/gadget/function/uvc_v4l2.c | |||
@@ -149,7 +149,7 @@ uvc_v4l2_reqbufs(struct file *file, void *fh, struct v4l2_requestbuffers *b) | |||
149 | if (b->type != video->queue.queue.type) | 149 | if (b->type != video->queue.queue.type) |
150 | return -EINVAL; | 150 | return -EINVAL; |
151 | 151 | ||
152 | return uvc_alloc_buffers(&video->queue, b); | 152 | return uvcg_alloc_buffers(&video->queue, b); |
153 | } | 153 | } |
154 | 154 | ||
155 | static int | 155 | static int |
@@ -159,7 +159,7 @@ uvc_v4l2_querybuf(struct file *file, void *fh, struct v4l2_buffer *b) | |||
159 | struct uvc_device *uvc = video_get_drvdata(vdev); | 159 | struct uvc_device *uvc = video_get_drvdata(vdev); |
160 | struct uvc_video *video = &uvc->video; | 160 | struct uvc_video *video = &uvc->video; |
161 | 161 | ||
162 | return uvc_query_buffer(&video->queue, b); | 162 | return uvcg_query_buffer(&video->queue, b); |
163 | } | 163 | } |
164 | 164 | ||
165 | static int | 165 | static int |
@@ -170,11 +170,11 @@ uvc_v4l2_qbuf(struct file *file, void *fh, struct v4l2_buffer *b) | |||
170 | struct uvc_video *video = &uvc->video; | 170 | struct uvc_video *video = &uvc->video; |
171 | int ret; | 171 | int ret; |
172 | 172 | ||
173 | ret = uvc_queue_buffer(&video->queue, b); | 173 | ret = uvcg_queue_buffer(&video->queue, b); |
174 | if (ret < 0) | 174 | if (ret < 0) |
175 | return ret; | 175 | return ret; |
176 | 176 | ||
177 | return uvc_video_pump(video); | 177 | return uvcg_video_pump(video); |
178 | } | 178 | } |
179 | 179 | ||
180 | static int | 180 | static int |
@@ -184,7 +184,7 @@ uvc_v4l2_dqbuf(struct file *file, void *fh, struct v4l2_buffer *b) | |||
184 | struct uvc_device *uvc = video_get_drvdata(vdev); | 184 | struct uvc_device *uvc = video_get_drvdata(vdev); |
185 | struct uvc_video *video = &uvc->video; | 185 | struct uvc_video *video = &uvc->video; |
186 | 186 | ||
187 | return uvc_dequeue_buffer(&video->queue, b, file->f_flags & O_NONBLOCK); | 187 | return uvcg_dequeue_buffer(&video->queue, b, file->f_flags & O_NONBLOCK); |
188 | } | 188 | } |
189 | 189 | ||
190 | static int | 190 | static int |
@@ -199,7 +199,7 @@ uvc_v4l2_streamon(struct file *file, void *fh, enum v4l2_buf_type type) | |||
199 | return -EINVAL; | 199 | return -EINVAL; |
200 | 200 | ||
201 | /* Enable UVC video. */ | 201 | /* Enable UVC video. */ |
202 | ret = uvc_video_enable(video, 1); | 202 | ret = uvcg_video_enable(video, 1); |
203 | if (ret < 0) | 203 | if (ret < 0) |
204 | return ret; | 204 | return ret; |
205 | 205 | ||
@@ -223,7 +223,7 @@ uvc_v4l2_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) | |||
223 | if (type != video->queue.queue.type) | 223 | if (type != video->queue.queue.type) |
224 | return -EINVAL; | 224 | return -EINVAL; |
225 | 225 | ||
226 | return uvc_video_enable(video, 0); | 226 | return uvcg_video_enable(video, 0); |
227 | } | 227 | } |
228 | 228 | ||
229 | static int | 229 | static int |
@@ -309,8 +309,8 @@ uvc_v4l2_release(struct file *file) | |||
309 | 309 | ||
310 | uvc_function_disconnect(uvc); | 310 | uvc_function_disconnect(uvc); |
311 | 311 | ||
312 | uvc_video_enable(video, 0); | 312 | uvcg_video_enable(video, 0); |
313 | uvc_free_buffers(&video->queue); | 313 | uvcg_free_buffers(&video->queue); |
314 | 314 | ||
315 | file->private_data = NULL; | 315 | file->private_data = NULL; |
316 | v4l2_fh_del(&handle->vfh); | 316 | v4l2_fh_del(&handle->vfh); |
@@ -326,7 +326,7 @@ uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma) | |||
326 | struct video_device *vdev = video_devdata(file); | 326 | struct video_device *vdev = video_devdata(file); |
327 | struct uvc_device *uvc = video_get_drvdata(vdev); | 327 | struct uvc_device *uvc = video_get_drvdata(vdev); |
328 | 328 | ||
329 | return uvc_queue_mmap(&uvc->video.queue, vma); | 329 | return uvcg_queue_mmap(&uvc->video.queue, vma); |
330 | } | 330 | } |
331 | 331 | ||
332 | static unsigned int | 332 | static unsigned int |
@@ -335,7 +335,7 @@ uvc_v4l2_poll(struct file *file, poll_table *wait) | |||
335 | struct video_device *vdev = video_devdata(file); | 335 | struct video_device *vdev = video_devdata(file); |
336 | struct uvc_device *uvc = video_get_drvdata(vdev); | 336 | struct uvc_device *uvc = video_get_drvdata(vdev); |
337 | 337 | ||
338 | return uvc_queue_poll(&uvc->video.queue, file, wait); | 338 | return uvcg_queue_poll(&uvc->video.queue, file, wait); |
339 | } | 339 | } |
340 | 340 | ||
341 | #ifndef CONFIG_MMU | 341 | #ifndef CONFIG_MMU |
@@ -346,7 +346,7 @@ static unsigned long uvc_v4l2_get_unmapped_area(struct file *file, | |||
346 | struct video_device *vdev = video_devdata(file); | 346 | struct video_device *vdev = video_devdata(file); |
347 | struct uvc_device *uvc = video_get_drvdata(vdev); | 347 | struct uvc_device *uvc = video_get_drvdata(vdev); |
348 | 348 | ||
349 | return uvc_queue_get_unmapped_area(&uvc->video.queue, pgoff); | 349 | return uvcg_queue_get_unmapped_area(&uvc->video.queue, pgoff); |
350 | } | 350 | } |
351 | #endif | 351 | #endif |
352 | 352 | ||
@@ -358,7 +358,7 @@ static struct v4l2_file_operations uvc_v4l2_fops = { | |||
358 | .mmap = uvc_v4l2_mmap, | 358 | .mmap = uvc_v4l2_mmap, |
359 | .poll = uvc_v4l2_poll, | 359 | .poll = uvc_v4l2_poll, |
360 | #ifndef CONFIG_MMU | 360 | #ifndef CONFIG_MMU |
361 | .get_unmapped_area = uvc_v4l2_get_unmapped_area, | 361 | .get_unmapped_area = uvcg_v4l2_get_unmapped_area, |
362 | #endif | 362 | #endif |
363 | }; | 363 | }; |
364 | 364 | ||
diff --git a/drivers/usb/gadget/function/uvc_video.c b/drivers/usb/gadget/function/uvc_video.c index 1ff478a961a6..be6749ec6a9d 100644 --- a/drivers/usb/gadget/function/uvc_video.c +++ b/drivers/usb/gadget/function/uvc_video.c | |||
@@ -85,7 +85,7 @@ uvc_video_encode_bulk(struct usb_request *req, struct uvc_video *video, | |||
85 | if (buf->bytesused == video->queue.buf_used) { | 85 | if (buf->bytesused == video->queue.buf_used) { |
86 | video->queue.buf_used = 0; | 86 | video->queue.buf_used = 0; |
87 | buf->state = UVC_BUF_STATE_DONE; | 87 | buf->state = UVC_BUF_STATE_DONE; |
88 | uvc_queue_next_buffer(&video->queue, buf); | 88 | uvcg_queue_next_buffer(&video->queue, buf); |
89 | video->fid ^= UVC_STREAM_FID; | 89 | video->fid ^= UVC_STREAM_FID; |
90 | 90 | ||
91 | video->payload_size = 0; | 91 | video->payload_size = 0; |
@@ -118,7 +118,7 @@ uvc_video_encode_isoc(struct usb_request *req, struct uvc_video *video, | |||
118 | if (buf->bytesused == video->queue.buf_used) { | 118 | if (buf->bytesused == video->queue.buf_used) { |
119 | video->queue.buf_used = 0; | 119 | video->queue.buf_used = 0; |
120 | buf->state = UVC_BUF_STATE_DONE; | 120 | buf->state = UVC_BUF_STATE_DONE; |
121 | uvc_queue_next_buffer(&video->queue, buf); | 121 | uvcg_queue_next_buffer(&video->queue, buf); |
122 | video->fid ^= UVC_STREAM_FID; | 122 | video->fid ^= UVC_STREAM_FID; |
123 | } | 123 | } |
124 | } | 124 | } |
@@ -172,18 +172,18 @@ uvc_video_complete(struct usb_ep *ep, struct usb_request *req) | |||
172 | 172 | ||
173 | case -ESHUTDOWN: /* disconnect from host. */ | 173 | case -ESHUTDOWN: /* disconnect from host. */ |
174 | printk(KERN_DEBUG "VS request cancelled.\n"); | 174 | printk(KERN_DEBUG "VS request cancelled.\n"); |
175 | uvc_queue_cancel(queue, 1); | 175 | uvcg_queue_cancel(queue, 1); |
176 | goto requeue; | 176 | goto requeue; |
177 | 177 | ||
178 | default: | 178 | default: |
179 | printk(KERN_INFO "VS request completed with status %d.\n", | 179 | printk(KERN_INFO "VS request completed with status %d.\n", |
180 | req->status); | 180 | req->status); |
181 | uvc_queue_cancel(queue, 0); | 181 | uvcg_queue_cancel(queue, 0); |
182 | goto requeue; | 182 | goto requeue; |
183 | } | 183 | } |
184 | 184 | ||
185 | spin_lock_irqsave(&video->queue.irqlock, flags); | 185 | spin_lock_irqsave(&video->queue.irqlock, flags); |
186 | buf = uvc_queue_head(&video->queue); | 186 | buf = uvcg_queue_head(&video->queue); |
187 | if (buf == NULL) { | 187 | if (buf == NULL) { |
188 | spin_unlock_irqrestore(&video->queue.irqlock, flags); | 188 | spin_unlock_irqrestore(&video->queue.irqlock, flags); |
189 | goto requeue; | 189 | goto requeue; |
@@ -195,7 +195,7 @@ uvc_video_complete(struct usb_ep *ep, struct usb_request *req) | |||
195 | printk(KERN_INFO "Failed to queue request (%d).\n", ret); | 195 | printk(KERN_INFO "Failed to queue request (%d).\n", ret); |
196 | usb_ep_set_halt(ep); | 196 | usb_ep_set_halt(ep); |
197 | spin_unlock_irqrestore(&video->queue.irqlock, flags); | 197 | spin_unlock_irqrestore(&video->queue.irqlock, flags); |
198 | uvc_queue_cancel(queue, 0); | 198 | uvcg_queue_cancel(queue, 0); |
199 | goto requeue; | 199 | goto requeue; |
200 | } | 200 | } |
201 | spin_unlock_irqrestore(&video->queue.irqlock, flags); | 201 | spin_unlock_irqrestore(&video->queue.irqlock, flags); |
@@ -274,13 +274,13 @@ error: | |||
274 | */ | 274 | */ |
275 | 275 | ||
276 | /* | 276 | /* |
277 | * uvc_video_pump - Pump video data into the USB requests | 277 | * uvcg_video_pump - Pump video data into the USB requests |
278 | * | 278 | * |
279 | * This function fills the available USB requests (listed in req_free) with | 279 | * This function fills the available USB requests (listed in req_free) with |
280 | * video data from the queued buffers. | 280 | * video data from the queued buffers. |
281 | */ | 281 | */ |
282 | static int | 282 | static int |
283 | uvc_video_pump(struct uvc_video *video) | 283 | uvcg_video_pump(struct uvc_video *video) |
284 | { | 284 | { |
285 | struct uvc_video_queue *queue = &video->queue; | 285 | struct uvc_video_queue *queue = &video->queue; |
286 | struct usb_request *req; | 286 | struct usb_request *req; |
@@ -288,7 +288,7 @@ uvc_video_pump(struct uvc_video *video) | |||
288 | unsigned long flags; | 288 | unsigned long flags; |
289 | int ret; | 289 | int ret; |
290 | 290 | ||
291 | /* FIXME TODO Race between uvc_video_pump and requests completion | 291 | /* FIXME TODO Race between uvcg_video_pump and requests completion |
292 | * handler ??? | 292 | * handler ??? |
293 | */ | 293 | */ |
294 | 294 | ||
@@ -310,7 +310,7 @@ uvc_video_pump(struct uvc_video *video) | |||
310 | * request, protected by the video queue irqlock. | 310 | * request, protected by the video queue irqlock. |
311 | */ | 311 | */ |
312 | spin_lock_irqsave(&video->queue.irqlock, flags); | 312 | spin_lock_irqsave(&video->queue.irqlock, flags); |
313 | buf = uvc_queue_head(&video->queue); | 313 | buf = uvcg_queue_head(&video->queue); |
314 | if (buf == NULL) { | 314 | if (buf == NULL) { |
315 | spin_unlock_irqrestore(&video->queue.irqlock, flags); | 315 | spin_unlock_irqrestore(&video->queue.irqlock, flags); |
316 | break; | 316 | break; |
@@ -324,7 +324,7 @@ uvc_video_pump(struct uvc_video *video) | |||
324 | printk(KERN_INFO "Failed to queue request (%d)\n", ret); | 324 | printk(KERN_INFO "Failed to queue request (%d)\n", ret); |
325 | usb_ep_set_halt(video->ep); | 325 | usb_ep_set_halt(video->ep); |
326 | spin_unlock_irqrestore(&video->queue.irqlock, flags); | 326 | spin_unlock_irqrestore(&video->queue.irqlock, flags); |
327 | uvc_queue_cancel(queue, 0); | 327 | uvcg_queue_cancel(queue, 0); |
328 | break; | 328 | break; |
329 | } | 329 | } |
330 | spin_unlock_irqrestore(&video->queue.irqlock, flags); | 330 | spin_unlock_irqrestore(&video->queue.irqlock, flags); |
@@ -340,7 +340,7 @@ uvc_video_pump(struct uvc_video *video) | |||
340 | * Enable or disable the video stream. | 340 | * Enable or disable the video stream. |
341 | */ | 341 | */ |
342 | static int | 342 | static int |
343 | uvc_video_enable(struct uvc_video *video, int enable) | 343 | uvcg_video_enable(struct uvc_video *video, int enable) |
344 | { | 344 | { |
345 | unsigned int i; | 345 | unsigned int i; |
346 | int ret; | 346 | int ret; |
@@ -356,11 +356,11 @@ uvc_video_enable(struct uvc_video *video, int enable) | |||
356 | usb_ep_dequeue(video->ep, video->req[i]); | 356 | usb_ep_dequeue(video->ep, video->req[i]); |
357 | 357 | ||
358 | uvc_video_free_requests(video); | 358 | uvc_video_free_requests(video); |
359 | uvc_queue_enable(&video->queue, 0); | 359 | uvcg_queue_enable(&video->queue, 0); |
360 | return 0; | 360 | return 0; |
361 | } | 361 | } |
362 | 362 | ||
363 | if ((ret = uvc_queue_enable(&video->queue, 1)) < 0) | 363 | if ((ret = uvcg_queue_enable(&video->queue, 1)) < 0) |
364 | return ret; | 364 | return ret; |
365 | 365 | ||
366 | if ((ret = uvc_video_alloc_requests(video)) < 0) | 366 | if ((ret = uvc_video_alloc_requests(video)) < 0) |
@@ -372,14 +372,14 @@ uvc_video_enable(struct uvc_video *video, int enable) | |||
372 | } else | 372 | } else |
373 | video->encode = uvc_video_encode_isoc; | 373 | video->encode = uvc_video_encode_isoc; |
374 | 374 | ||
375 | return uvc_video_pump(video); | 375 | return uvcg_video_pump(video); |
376 | } | 376 | } |
377 | 377 | ||
378 | /* | 378 | /* |
379 | * Initialize the UVC video stream. | 379 | * Initialize the UVC video stream. |
380 | */ | 380 | */ |
381 | static int | 381 | static int |
382 | uvc_video_init(struct uvc_video *video) | 382 | uvcg_video_init(struct uvc_video *video) |
383 | { | 383 | { |
384 | INIT_LIST_HEAD(&video->req_free); | 384 | INIT_LIST_HEAD(&video->req_free); |
385 | spin_lock_init(&video->req_lock); | 385 | spin_lock_init(&video->req_lock); |
@@ -391,7 +391,7 @@ uvc_video_init(struct uvc_video *video) | |||
391 | video->imagesize = 320 * 240 * 2; | 391 | video->imagesize = 320 * 240 * 2; |
392 | 392 | ||
393 | /* Initialize the video buffers queue. */ | 393 | /* Initialize the video buffers queue. */ |
394 | uvc_queue_init(&video->queue, V4L2_BUF_TYPE_VIDEO_OUTPUT); | 394 | uvcg_queue_init(&video->queue, V4L2_BUF_TYPE_VIDEO_OUTPUT); |
395 | return 0; | 395 | return 0; |
396 | } | 396 | } |
397 | 397 | ||