Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15250
b: refs/heads/master
c: 468a0a5
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Dec 19, 2005
1 parent cc64c08 commit 6e81d85
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 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: 60edb13759096097b7208843dc9b7582a7d14c61
refs/heads/master: 468a0a54aabdac72e9c7bbd4f8372f1df2d9f0ae
42 changes: 24 additions & 18 deletions trunk/drivers/media/video/cx25840/cx25840-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,24 +333,30 @@ static int set_input(struct i2c_client *client, enum cx25840_input input)

static int set_v4lstd(struct i2c_client *client, v4l2_std_id std)
{
u8 fmt;

switch (std) {
/* zero is autodetect */
case 0: fmt = 0x0; break;
/* default ntsc to ntsc-m */
case V4L2_STD_NTSC:
case V4L2_STD_NTSC_M: fmt = 0x1; break;
case V4L2_STD_NTSC_M_JP: fmt = 0x2; break;
case V4L2_STD_NTSC_443: fmt = 0x3; break;
case V4L2_STD_PAL: fmt = 0x4; break;
case V4L2_STD_PAL_M: fmt = 0x5; break;
case V4L2_STD_PAL_N: fmt = 0x6; break;
case V4L2_STD_PAL_Nc: fmt = 0x7; break;
case V4L2_STD_PAL_60: fmt = 0x8; break;
case V4L2_STD_SECAM: fmt = 0xc; break;
default:
return -ERANGE;
u8 fmt=0; /* zero is autodetect */

/* First tests should be against specific std */
if (std & V4L2_STD_NTSC_M_JP) {
fmt=0x2;
} else if (std & V4L2_STD_NTSC_443) {
fmt=0x3;
} else if (std & V4L2_STD_PAL_M) {
fmt=0x5;
} else if (std & V4L2_STD_PAL_N) {
fmt=0x6;
} else if (std & V4L2_STD_PAL_Nc) {
fmt=0x7;
} else if (std & V4L2_STD_PAL_60) {
fmt=0x8;
} else {
/* Then, test against generic ones */
if (std & V4L2_STD_NTSC) {
fmt=0x1;
} else if (std & V4L2_STD_PAL) {
fmt=0x4;
} else if (std & V4L2_STD_SECAM) {
fmt=0xc;
}
}

cx25840_and_or(client, 0x400, ~0xf, fmt);
Expand Down

0 comments on commit 6e81d85

Please sign in to comment.