aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorJavier Martinez Canillas <martinez.javier@gmail.com>2011-11-04 12:23:21 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-08 07:24:13 -0500
commit2da12fcbea0a2faa94a5d4e58eb2f0f79f9739db (patch)
tree93e884cf8c8e8b29983e03b880c3e67db52698c0 /drivers/media/video
parent918847341af0f5f1907fc0b52549f0dc29192c03 (diff)
[media] tvp5150: replace video standard "magic" numbers
64933337e3cb61ca555969a35ab68b477db34ee2 [media] tvp5150: Add video format registers configuration values Added constants for each video standard supported by TVP5150, so this patch get rid of the magic numbers. Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/tvp5150.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c
index e927d25e0d35..2a10b03a13c7 100644
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@ -702,21 +702,21 @@ static int tvp5150_set_std(struct v4l2_subdev *sd, v4l2_std_id std)
702 /* First tests should be against specific std */ 702 /* First tests should be against specific std */
703 703
704 if (std == V4L2_STD_ALL) { 704 if (std == V4L2_STD_ALL) {
705 fmt = 0; /* Autodetect mode */ 705 fmt = VIDEO_STD_AUTO_SWITCH_BIT; /* Autodetect mode */
706 } else if (std & V4L2_STD_NTSC_443) { 706 } else if (std & V4L2_STD_NTSC_443) {
707 fmt = 0xa; 707 fmt = VIDEO_STD_NTSC_4_43_BIT;
708 } else if (std & V4L2_STD_PAL_M) { 708 } else if (std & V4L2_STD_PAL_M) {
709 fmt = 0x6; 709 fmt = VIDEO_STD_PAL_M_BIT;
710 } else if (std & (V4L2_STD_PAL_N | V4L2_STD_PAL_Nc)) { 710 } else if (std & (V4L2_STD_PAL_N | V4L2_STD_PAL_Nc)) {
711 fmt = 0x8; 711 fmt = VIDEO_STD_PAL_COMBINATION_N_BIT;
712 } else { 712 } else {
713 /* Then, test against generic ones */ 713 /* Then, test against generic ones */
714 if (std & V4L2_STD_NTSC) 714 if (std & V4L2_STD_NTSC)
715 fmt = 0x2; 715 fmt = VIDEO_STD_NTSC_MJ_BIT;
716 else if (std & V4L2_STD_PAL) 716 else if (std & V4L2_STD_PAL)
717 fmt = 0x4; 717 fmt = VIDEO_STD_PAL_BDGHIN_BIT;
718 else if (std & V4L2_STD_SECAM) 718 else if (std & V4L2_STD_SECAM)
719 fmt = 0xc; 719 fmt = VIDEO_STD_SECAM_BIT;
720 } 720 }
721 721
722 v4l2_dbg(1, debug, sd, "Set video std register to %d.\n", fmt); 722 v4l2_dbg(1, debug, sd, "Set video std register to %d.\n", fmt);