Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271932
b: refs/heads/master
c: b728666
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Oct 8, 2011
1 parent 29acbce commit 13e9a83
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f4cf2c3a971c4d5154def8ef9ce4811d702852d
refs/heads/master: b728666ba5244505a80d1e395194e4b90386d504
45 changes: 31 additions & 14 deletions trunk/drivers/media/video/saa7115.c
Original file line number Diff line number Diff line change
Expand Up @@ -1344,35 +1344,52 @@ static int saa711x_g_vbi_data(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_dat
static int saa711x_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
{
struct saa711x_state *state = to_state(sd);
int reg1e;
int reg1f, reg1e;

*std = V4L2_STD_ALL;
if (state->ident != V4L2_IDENT_SAA7115) {
int reg1f = saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC);

if (reg1f & 0x20)
*std = V4L2_STD_525_60;
else
*std = V4L2_STD_625_50;

return 0;
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;
goto ret;
}
if (reg1f & 0x20)
*std = V4L2_STD_525_60;
else
*std = V4L2_STD_625_50;

if (state->ident != V4L2_IDENT_SAA7115)
goto ret;

reg1e = saa711x_read(sd, R_1E_STATUS_BYTE_1_VD_DEC);

switch (reg1e & 0x03) {
case 1:
*std = V4L2_STD_NTSC;
*std &= V4L2_STD_NTSC;
break;
case 2:
*std = V4L2_STD_PAL;
/*
* V4L2_STD_PAL just cover the european PAL standards.
* This is wrong, as the device could also be using an
* other PAL standard.
*/
*std &= V4L2_STD_PAL | V4L2_STD_PAL_N | V4L2_STD_PAL_Nc |
V4L2_STD_PAL_M | V4L2_STD_PAL_60;
break;
case 3:
*std = V4L2_STD_SECAM;
*std &= V4L2_STD_SECAM;
break;
default:
/* Can't detect anything */
*std = V4L2_STD_ALL;
break;
}

v4l2_dbg(1, debug, sd, "Status byte 1 (0x1e)=0x%02x\n", reg1e);

ret:
v4l2_dbg(1, debug, sd, "detected std mask = %08Lx\n", *std);

return 0;
}

Expand Down

0 comments on commit 13e9a83

Please sign in to comment.