From 8be8ec6ea58bd77338f6ffa2f6d2acfc88b835f4 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Fri, 3 Aug 2012 04:35:10 -0300
Subject: [media] uvcvideo: Mark first output terminal as default video node

The MEDIA_ENT_FL_DEFAULT identifies entities that are considered as
default for their group and type. For video nodes, it identifies the
node that application should use by default.
UVC devices don't report which output terminal should be considered as
the default, use the first one. Most devices have a single output
terminal anyway.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/usb/uvc/uvc_driver.c | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'drivers/media/usb/uvc/uvc_driver.c')

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 22f14d286fbb..5dbefa68b1d2 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1564,6 +1564,8 @@ static int uvc_scan_device(struct uvc_device *dev)
 		chain->dev = dev;
 		v4l2_prio_init(&chain->prio);
 
+		term->flags |= UVC_ENTITY_FLAG_DEFAULT;
+
 		if (uvc_scan_chain(chain, term) < 0) {
 			kfree(chain);
 			continue;
-- 
cgit v1.2.1