diff options
-rw-r--r-- | drivers/media/video/v4l2-common.c | 9 | ||||
-rw-r--r-- | include/linux/videodev2.h | 9 |
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index 752c82c37f55..b87d571e0463 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c | |||
@@ -90,8 +90,15 @@ MODULE_LICENSE("GPL"); | |||
90 | char *v4l2_norm_to_name(v4l2_std_id id) | 90 | char *v4l2_norm_to_name(v4l2_std_id id) |
91 | { | 91 | { |
92 | char *name; | 92 | char *name; |
93 | u32 myid = id; | ||
93 | 94 | ||
94 | switch (id) { | 95 | /* HACK: ppc32 architecture doesn't have __ucmpdi2 function to handle |
96 | 64 bit comparations. So, on that architecture, with some gcc variants, | ||
97 | compilation fails. Currently, the max value is 30bit wide. | ||
98 | */ | ||
99 | BUG_ON(myid != id); | ||
100 | |||
101 | switch (myid) { | ||
95 | case V4L2_STD_PAL: | 102 | case V4L2_STD_PAL: |
96 | name="PAL"; break; | 103 | name="PAL"; break; |
97 | case V4L2_STD_PAL_BG: | 104 | case V4L2_STD_PAL_BG: |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 5cb380a559fd..d94e2683be52 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -662,6 +662,15 @@ typedef __u64 v4l2_std_id; | |||
662 | #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) | 662 | #define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) |
663 | #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000) | 663 | #define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000) |
664 | 664 | ||
665 | /* FIXME: | ||
666 | Although std_id is 64 bits, there is an issue on PPC32 architecture that | ||
667 | makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding | ||
668 | this value to 32 bits. | ||
669 | As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide), | ||
670 | it should work fine. However, if needed to add more than two standards, | ||
671 | v4l2-common.c should be fixed. | ||
672 | */ | ||
673 | |||
665 | /* some merged standards */ | 674 | /* some merged standards */ |
666 | #define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) | 675 | #define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC) |
667 | #define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B) | 676 | #define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B) |