From 1d1d8c51837235a37f0b81fbb4d452bfb94a81b1 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 7 Jan 2007 08:51:05 -0300 Subject: [PATCH] --- yaml --- r: 45518 b: refs/heads/master c: 412297d31d439ba56cd4faeb3a49a6f569f40702 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/media/video/v4l2-common.c | 9 ++++++++- trunk/include/linux/videodev2.h | 9 +++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 4b8b039aef87..d409a7da5131 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1323fbda1343f50f198bc8bd6d1d59c8b7fc45bf +refs/heads/master: 412297d31d439ba56cd4faeb3a49a6f569f40702 diff --git a/trunk/drivers/media/video/v4l2-common.c b/trunk/drivers/media/video/v4l2-common.c index 752c82c37f55..b87d571e0463 100644 --- a/trunk/drivers/media/video/v4l2-common.c +++ b/trunk/drivers/media/video/v4l2-common.c @@ -90,8 +90,15 @@ MODULE_LICENSE("GPL"); char *v4l2_norm_to_name(v4l2_std_id id) { char *name; + u32 myid = id; - switch (id) { + /* HACK: ppc32 architecture doesn't have __ucmpdi2 function to handle + 64 bit comparations. So, on that architecture, with some gcc variants, + compilation fails. Currently, the max value is 30bit wide. + */ + BUG_ON(myid != id); + + switch (myid) { case V4L2_STD_PAL: name="PAL"; break; case V4L2_STD_PAL_BG: diff --git a/trunk/include/linux/videodev2.h b/trunk/include/linux/videodev2.h index 5cb380a559fd..d94e2683be52 100644 --- a/trunk/include/linux/videodev2.h +++ b/trunk/include/linux/videodev2.h @@ -662,6 +662,15 @@ typedef __u64 v4l2_std_id; #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000) +/* FIXME: + Although std_id is 64 bits, there is an issue on PPC32 architecture that + makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding + this value to 32 bits. + As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide), + it should work fine. However, if needed to add more than two standards, + v4l2-common.c should be fixed. + */ + /* some merged standards */ #define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) #define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B)