aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc/uvcvideo.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/uvc/uvcvideo.h')
-rw-r--r--drivers/media/video/uvc/uvcvideo.h86
1 files changed, 42 insertions, 44 deletions
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
index fcccf9c9b7ba..3cd9041e22a1 100644
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -361,26 +361,6 @@ struct uvc_streaming_header {
361 __u8 bTriggerUsage; 361 __u8 bTriggerUsage;
362}; 362};
363 363
364struct uvc_streaming {
365 struct list_head list;
366
367 struct usb_interface *intf;
368 int intfnum;
369 __u16 maxpsize;
370
371 struct uvc_streaming_header header;
372 enum v4l2_buf_type type;
373
374 unsigned int nformats;
375 struct uvc_format *format;
376
377 struct uvc_streaming_control ctrl;
378 struct uvc_format *cur_format;
379 struct uvc_frame *cur_frame;
380
381 struct mutex mutex;
382};
383
384enum uvc_buffer_state { 364enum uvc_buffer_state {
385 UVC_BUF_STATE_IDLE = 0, 365 UVC_BUF_STATE_IDLE = 0,
386 UVC_BUF_STATE_QUEUED = 1, 366 UVC_BUF_STATE_QUEUED = 1,
@@ -422,26 +402,31 @@ struct uvc_video_queue {
422 struct list_head irqqueue; 402 struct list_head irqqueue;
423}; 403};
424 404
425struct uvc_video_device { 405struct uvc_streaming {
406 struct list_head list;
426 struct uvc_device *dev; 407 struct uvc_device *dev;
427 struct video_device *vdev; 408 struct video_device *vdev;
428 atomic_t active; 409 atomic_t active;
429 unsigned int frozen : 1;
430 410
431 struct list_head iterms; /* Input terminals */ 411 struct usb_interface *intf;
432 struct uvc_entity *oterm; /* Output terminal */ 412 int intfnum;
433 struct uvc_entity *sterm; /* USB streaming terminal */ 413 __u16 maxpsize;
434 struct uvc_entity *processing;
435 struct uvc_entity *selector;
436 struct list_head extensions;
437 struct mutex ctrl_mutex;
438 414
439 struct uvc_video_queue queue; 415 struct uvc_streaming_header header;
416 enum v4l2_buf_type type;
417
418 unsigned int nformats;
419 struct uvc_format *format;
440 420
441 /* Video streaming object, must always be non-NULL. */ 421 struct uvc_streaming_control ctrl;
442 struct uvc_streaming *streaming; 422 struct uvc_format *cur_format;
423 struct uvc_frame *cur_frame;
424
425 struct mutex mutex;
443 426
444 void (*decode) (struct urb *urb, struct uvc_video_device *video, 427 unsigned int frozen : 1;
428 struct uvc_video_queue queue;
429 void (*decode) (struct urb *urb, struct uvc_streaming *video,
445 struct uvc_buffer *buf); 430 struct uvc_buffer *buf);
446 431
447 /* Context data used by the bulk completion handler. */ 432 /* Context data used by the bulk completion handler. */
@@ -461,6 +446,18 @@ struct uvc_video_device {
461 __u8 last_fid; 446 __u8 last_fid;
462}; 447};
463 448
449struct uvc_video_device {
450 struct uvc_device *dev;
451
452 struct list_head iterms; /* Input terminals */
453 struct uvc_entity *oterm; /* Output terminal */
454 struct uvc_entity *sterm; /* USB streaming terminal */
455 struct uvc_entity *processing;
456 struct uvc_entity *selector;
457 struct list_head extensions;
458 struct mutex ctrl_mutex;
459};
460
464enum uvc_device_state { 461enum uvc_device_state {
465 UVC_DEV_DISCONNECTED = 1, 462 UVC_DEV_DISCONNECTED = 1,
466}; 463};
@@ -486,15 +483,15 @@ struct uvc_device {
486 483
487 struct uvc_video_device video; 484 struct uvc_video_device video;
488 485
486 /* Video Streaming interfaces */
487 struct list_head streams;
488
489 /* Status Interrupt Endpoint */ 489 /* Status Interrupt Endpoint */
490 struct usb_host_endpoint *int_ep; 490 struct usb_host_endpoint *int_ep;
491 struct urb *int_urb; 491 struct urb *int_urb;
492 __u8 *status; 492 __u8 *status;
493 struct input_dev *input; 493 struct input_dev *input;
494 char input_phys[64]; 494 char input_phys[64];
495
496 /* Video Streaming interfaces */
497 struct list_head streaming;
498}; 495};
499 496
500enum uvc_handle_state { 497enum uvc_handle_state {
@@ -503,7 +500,8 @@ enum uvc_handle_state {
503}; 500};
504 501
505struct uvc_fh { 502struct uvc_fh {
506 struct uvc_video_device *device; 503 struct uvc_video_device *video;
504 struct uvc_streaming *stream;
507 enum uvc_handle_state state; 505 enum uvc_handle_state state;
508}; 506};
509 507
@@ -600,13 +598,13 @@ static inline int uvc_queue_streaming(struct uvc_video_queue *queue)
600extern const struct v4l2_file_operations uvc_fops; 598extern const struct v4l2_file_operations uvc_fops;
601 599
602/* Video */ 600/* Video */
603extern int uvc_video_init(struct uvc_video_device *video); 601extern int uvc_video_init(struct uvc_streaming *stream);
604extern int uvc_video_suspend(struct uvc_video_device *video); 602extern int uvc_video_suspend(struct uvc_streaming *stream);
605extern int uvc_video_resume(struct uvc_video_device *video); 603extern int uvc_video_resume(struct uvc_streaming *stream);
606extern int uvc_video_enable(struct uvc_video_device *video, int enable); 604extern int uvc_video_enable(struct uvc_streaming *stream, int enable);
607extern int uvc_probe_video(struct uvc_video_device *video, 605extern int uvc_probe_video(struct uvc_streaming *stream,
608 struct uvc_streaming_control *probe); 606 struct uvc_streaming_control *probe);
609extern int uvc_commit_video(struct uvc_video_device *video, 607extern int uvc_commit_video(struct uvc_streaming *stream,
610 struct uvc_streaming_control *ctrl); 608 struct uvc_streaming_control *ctrl);
611extern int uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit, 609extern int uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit,
612 __u8 intfnum, __u8 cs, void *data, __u16 size); 610 __u8 intfnum, __u8 cs, void *data, __u16 size);
@@ -660,7 +658,7 @@ extern struct usb_host_endpoint *uvc_find_endpoint(
660 struct usb_host_interface *alts, __u8 epaddr); 658 struct usb_host_interface *alts, __u8 epaddr);
661 659
662/* Quirks support */ 660/* Quirks support */
663void uvc_video_decode_isight(struct urb *urb, struct uvc_video_device *video, 661void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream,
664 struct uvc_buffer *buf); 662 struct uvc_buffer *buf);
665 663
666#endif /* __KERNEL__ */ 664#endif /* __KERNEL__ */