Lines Matching full:uvc
14 #include <linux/usb/uvc.h>
24 #include "uvc.h"
76 static struct uvcg_format *find_format_by_index(struct uvc_device *uvc, int index) in find_format_by_index() argument
82 list_for_each_entry(format, &uvc->header->formats, entry) { in find_format_by_index()
93 static struct uvcg_frame *find_frame_by_index(struct uvc_device *uvc, in find_frame_by_index() argument
101 list_for_each_entry(format, &uvc->header->formats, entry) { in find_frame_by_index()
115 static struct uvcg_format *find_format_by_pix(struct uvc_device *uvc, in find_format_by_pix() argument
121 list_for_each_entry(format, &uvc->header->formats, entry) { in find_format_by_pix()
136 static struct uvcg_frame *find_closest_frame_by_size(struct uvc_device *uvc, in find_closest_frame_by_size() argument
140 struct uvc_video *video = &uvc->video; in find_closest_frame_by_size()
152 list_for_each_entry(format, &uvc->header->formats, entry) { in find_closest_frame_by_size()
175 uvcg_dbg(&video->uvc->func, "Unsupported size %ux%u\n", rw, rh); in find_closest_frame_by_size()
185 uvc_send_response(struct uvc_device *uvc, struct uvc_request_data *data) in uvc_send_response() argument
187 struct usb_composite_dev *cdev = uvc->func.config->cdev; in uvc_send_response()
188 struct usb_request *req = uvc->control_req; in uvc_send_response()
193 req->length = min_t(unsigned int, uvc->event_length, data->length); in uvc_send_response()
194 req->zero = data->length < uvc->event_length; in uvc_send_response()
209 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_querycap() local
210 struct usb_composite_dev *cdev = uvc->func.config->cdev; in uvc_v4l2_querycap()
223 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_get_format() local
224 struct uvc_video *video = &uvc->video; in uvc_v4l2_get_format()
242 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_try_format() local
243 struct uvc_video *video = &uvc->video; in uvc_v4l2_try_format()
253 uvcg_dbg(&uvc->func, "Trying format 0x%08x (%c%c%c%c): %ux%u\n", in uvc_v4l2_try_format()
258 uformat = find_format_by_pix(uvc, fmt->fmt.pix.pixelformat); in uvc_v4l2_try_format()
262 uframe = find_closest_frame_by_size(uvc, uformat, in uvc_v4l2_try_format()
300 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_set_format() local
301 struct uvc_video *video = &uvc->video; in uvc_v4l2_set_format()
322 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_enum_frameintervals() local
327 uformat = find_format_by_pix(uvc, fival->pixel_format); in uvc_v4l2_enum_frameintervals()
361 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_enum_framesizes() local
365 uformat = find_format_by_pix(uvc, fsize->pixel_format); in uvc_v4l2_enum_framesizes()
372 uframe = find_frame_by_index(uvc, uformat, fsize->index + 1); in uvc_v4l2_enum_framesizes()
387 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_enum_format() local
391 if (f->index >= uvc->header->num_fmt) in uvc_v4l2_enum_format()
394 uformat = find_format_by_index(uvc, f->index + 1); in uvc_v4l2_enum_format()
411 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_reqbufs() local
412 struct uvc_video *video = &uvc->video; in uvc_v4l2_reqbufs()
424 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_querybuf() local
425 struct uvc_video *video = &uvc->video; in uvc_v4l2_querybuf()
434 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_qbuf() local
435 struct uvc_video *video = &uvc->video; in uvc_v4l2_qbuf()
442 if (uvc->state == UVC_STATE_STREAMING) in uvc_v4l2_qbuf()
452 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_dqbuf() local
453 struct uvc_video *video = &uvc->video; in uvc_v4l2_dqbuf()
462 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_streamon() local
463 struct uvc_video *video = &uvc->video; in uvc_v4l2_streamon()
469 /* Enable UVC video. */ in uvc_v4l2_streamon()
478 uvc_function_setup_continue(uvc, 0); in uvc_v4l2_streamon()
479 uvc->state = UVC_STATE_STREAMING; in uvc_v4l2_streamon()
488 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_streamoff() local
489 struct uvc_video *video = &uvc->video; in uvc_v4l2_streamoff()
499 uvc->state = UVC_STATE_CONNECTED; in uvc_v4l2_streamoff()
500 uvc_function_setup_continue(uvc, 1); in uvc_v4l2_streamoff()
508 struct uvc_device *uvc = video_get_drvdata(fh->vdev); in uvc_v4l2_subscribe_event() local
515 if (sub->type == UVC_EVENT_SETUP && uvc->func_connected) in uvc_v4l2_subscribe_event()
523 uvc->func_connected = true; in uvc_v4l2_subscribe_event()
525 uvc_function_connect(uvc); in uvc_v4l2_subscribe_event()
531 static void uvc_v4l2_disable(struct uvc_device *uvc) in uvc_v4l2_disable() argument
533 uvc_function_disconnect(uvc); in uvc_v4l2_disable()
534 uvcg_video_disable(&uvc->video); in uvc_v4l2_disable()
535 uvcg_free_buffers(&uvc->video.queue); in uvc_v4l2_disable()
536 uvc->func_connected = false; in uvc_v4l2_disable()
537 wake_up_interruptible(&uvc->func_connected_queue); in uvc_v4l2_disable()
544 struct uvc_device *uvc = video_get_drvdata(fh->vdev); in uvc_v4l2_unsubscribe_event() local
553 uvc_v4l2_disable(uvc); in uvc_v4l2_unsubscribe_event()
565 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_ioctl_default() local
569 return uvc_send_response(uvc, arg); in uvc_v4l2_ioctl_default()
603 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_open() local
613 handle->device = &uvc->video; in uvc_v4l2_open()
623 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_release() local
629 uvc_v4l2_disable(uvc); in uvc_v4l2_release()
644 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_mmap() local
646 return uvcg_queue_mmap(&uvc->video.queue, vma); in uvc_v4l2_mmap()
653 struct uvc_device *uvc = video_get_drvdata(vdev); in uvc_v4l2_poll() local
655 return uvcg_queue_poll(&uvc->video.queue, file, wait); in uvc_v4l2_poll()
664 struct uvc_device *uvc = video_get_drvdata(vdev); in uvcg_v4l2_get_unmapped_area() local
666 return uvcg_queue_get_unmapped_area(&uvc->video.queue, pgoff); in uvcg_v4l2_get_unmapped_area()