diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2005-12-17 21:39:18 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2005-12-17 21:39:18 +0000 |
commit | 9708ebd3445f5f62fbc3b099159a676e46f67d95 (patch) | |
tree | 1ec3e0937d37a45156f1029e6373136e55b1c95a /linux/drivers/media/video/cx25840 | |
parent | fea800d4f5b145456eedf364aeb7a0745fbabe2a (diff) | |
download | mediapointer-dvb-s2-9708ebd3445f5f62fbc3b099159a676e46f67d95.tar.gz mediapointer-dvb-s2-9708ebd3445f5f62fbc3b099159a676e46f67d95.tar.bz2 |
Fix compilation failure with gcc 2.95.3 and corrected set video std
From:: Jean Delvare <khali@linux-fr.org>
- Fix compilation failure with gcc 2.95.3.
- Corrected a bug at video std check at cx25840 module
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media/video/cx25840')
-rw-r--r-- | linux/drivers/media/video/cx25840/cx25840-core.c | 61 |
1 files changed, 42 insertions, 19 deletions
diff --git a/linux/drivers/media/video/cx25840/cx25840-core.c b/linux/drivers/media/video/cx25840/cx25840-core.c index cfa9cca9f..df97316cf 100644 --- a/linux/drivers/media/video/cx25840/cx25840-core.c +++ b/linux/drivers/media/video/cx25840/cx25840-core.c @@ -344,25 +344,48 @@ 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 */ + + do { + /* First tests should be against specific std */ + if (std & V4L2_STD_NTSC_M_JP) { + fmt=0x2; + break; + } + if (std & V4L2_STD_NTSC_M_443) { + fmt=0x3; + break; + } + if (std & V4L2_STD_PAL_M) { + fmt=0x5; + break; + } + if (std & V4L2_STD_PAL_N) { + fmt=0x6; + break; + } + if (std & V4L2_STD_PAL_Nc) { + fmt=0x7; + break; + } + if (std & V4L2_STD_PAL_60) { + fmt=0x8; + break; + } + /* Then, test against generic ones */ + if (std & V4L2_STD_NTSC) { + fmt=0x1; + break; + } + if (std & V4L2_STD_PAL) { + fmt=0x4; + break; + } + if (std & V4L2_STD_SECAM) { + fmt=0xc; + break; + } + } while (0); cx25840_and_or(client, 0x400, ~0xf, fmt); cx25840_vbi_setup(client); |