aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7115.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-10-04 08:40:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-10-08 07:00:44 -0400
commite41567a61dff8f63ad7b56a325bd4d2350428999 (patch)
tree40c797a50b5e22ddda17386ba8234e3bff8937be /drivers/media/video/saa7115.c
parent8715e6cbae2ec8b451920496a73786402a5d879d (diff)
[media] saa7115: Trust that V4L2 core will fill the mask
Instead of using V4L2_STD_ALL when no standard is detected, trust that the maximum allowed standards are already filled by the V4L2 core. It is better this way, as the bridge and/or the audio decoder may have some extra restrictions to some video standards. This also allow other devices like audio and tuners to contribute to standards detection, when they support such feature. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7115.c')
-rw-r--r--drivers/media/video/saa7115.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index 86627a8fdbfb..5cfdbc78b918 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -1346,17 +1346,23 @@ static int saa711x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
1346 struct saa711x_state *state = to_state(sd); 1346 struct saa711x_state *state = to_state(sd);
1347 int reg1f, reg1e; 1347 int reg1f, reg1e;
1348 1348
1349 /*
1350 * The V4L2 core already initializes std with all supported
1351 * Standards. All driver needs to do is to mask it, to remove
1352 * standards that don't apply from the mask
1353 */
1354
1349 reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC); 1355 reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC);
1350 v4l2_dbg(1, debug, sd, "Status byte 2 (0x1f)=0x%02x\n", reg1f); 1356 v4l2_dbg(1, debug, sd, "Status byte 2 (0x1f)=0x%02x\n", reg1f);
1351 if (reg1f & 0x40) { 1357
1352 /* horizontal/vertical not locked */ 1358 /* horizontal/vertical not locked */
1353 *std = V4L2_STD_ALL; 1359 if (reg1f & 0x40)
1354 goto ret; 1360 goto ret;
1355 } 1361
1356 if (reg1f & 0x20) 1362 if (reg1f & 0x20)
1357 *std = V4L2_STD_525_60; 1363 *std &= V4L2_STD_525_60;
1358 else 1364 else
1359 *std = V4L2_STD_625_50; 1365 *std &= V4L2_STD_625_50;
1360 1366
1361 if (state->ident != V4L2_IDENT_SAA7115) 1367 if (state->ident != V4L2_IDENT_SAA7115)
1362 goto ret; 1368 goto ret;
@@ -1381,7 +1387,6 @@ static int saa711x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
1381 break; 1387 break;
1382 default: 1388 default:
1383 /* Can't detect anything */ 1389 /* Can't detect anything */
1384 *std = V4L2_STD_ALL;
1385 break; 1390 break;
1386 } 1391 }
1387 1392