From ee301396e53efa3d57d1891e236dcfb6364883f7 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 4 Oct 2011 09:40:18 -0300 Subject: [PATCH] --- yaml --- r: 271935 b: refs/heads/master c: e41567a61dff8f63ad7b56a325bd4d2350428999 h: refs/heads/master i: 271933: 771989b580012eada577ab71a02bc44596a7a884 271931: 29acbcef2c5827cc607c407389a3adcbb7ef5ecd 271927: c02d0438afd937ae78aa670fbaf6a0ae00ac759b 271919: 0302def121e78bb998203bf8a88f6f9881d10743 271903: ef69bac5db3e2fa4720903e696c9a67b92f0b9ee 271871: ccf9a98a8cbbb49efdc583fbae045b244025f890 v: v3 --- [refs] | 2 +- trunk/drivers/media/video/saa7115.c | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 3e31ddcec12c..1d8f02a2af80 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8715e6cbae2ec8b451920496a73786402a5d879d +refs/heads/master: e41567a61dff8f63ad7b56a325bd4d2350428999 diff --git a/trunk/drivers/media/video/saa7115.c b/trunk/drivers/media/video/saa7115.c index 86627a8fdbfb..5cfdbc78b918 100644 --- a/trunk/drivers/media/video/saa7115.c +++ b/trunk/drivers/media/video/saa7115.c @@ -1346,17 +1346,23 @@ static int saa711x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) struct saa711x_state *state = to_state(sd); int reg1f, reg1e; + /* + * The V4L2 core already initializes std with all supported + * Standards. All driver needs to do is to mask it, to remove + * standards that don't apply from the mask + */ + reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC); v4l2_dbg(1, debug, sd, "Status byte 2 (0x1f)=0x%02x\n", reg1f); - if (reg1f & 0x40) { - /* horizontal/vertical not locked */ - *std = V4L2_STD_ALL; + + /* horizontal/vertical not locked */ + if (reg1f & 0x40) goto ret; - } + if (reg1f & 0x20) - *std = V4L2_STD_525_60; + *std &= V4L2_STD_525_60; else - *std = V4L2_STD_625_50; + *std &= V4L2_STD_625_50; if (state->ident != V4L2_IDENT_SAA7115) goto ret; @@ -1381,7 +1387,6 @@ static int saa711x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std) break; default: /* Can't detect anything */ - *std = V4L2_STD_ALL; break; }