V4L/DVB (3419): added some VBI macros and moved minor definitions to header file
authorMauro Carvalho Chehab <mchehab@infradead.org>
Mon, 23 Jan 2006 19:11:07 +0000 (17:11 -0200)
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>
Mon, 23 Jan 2006 19:11:07 +0000 (17:11 -0200)
- Moved some hardcoded minor numbers to videodev2.h
- Included more comments for sliced VBI standards
- Included some VBI macros to group similar standards

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/videodev.c
include/linux/videodev2.h

index 078880e4c8c0a89711a2b079d35553a0a3571e19..908fbec776ac1c9f84e73d80bed6a04f218c7870 100644 (file)
@@ -279,23 +279,23 @@ int video_register_device(struct video_device *vfd, int type, int nr)
        switch(type)
        {
                case VFL_TYPE_GRABBER:
-                       base=0;
-                       end=64;
+                       base=MINOR_VFL_TYPE_GRABBER_MIN;
+                       end=MINOR_VFL_TYPE_GRABBER_MAX+1;
                        name_base = "video";
                        break;
                case VFL_TYPE_VTX:
-                       base=192;
-                       end=224;
+                       base=MINOR_VFL_TYPE_VTX_MIN;
+                       end=MINOR_VFL_TYPE_VTX_MAX+1;
                        name_base = "vtx";
                        break;
                case VFL_TYPE_VBI:
-                       base=224;
-                       end=256;
+                       base=MINOR_VFL_TYPE_VBI_MIN;
+                       end=MINOR_VFL_TYPE_VBI_MAX+1;
                        name_base = "vbi";
                        break;
                case VFL_TYPE_RADIO:
-                       base=64;
-                       end=128;
+                       base=MINOR_VFL_TYPE_RADIO_MIN;
+                       end=MINOR_VFL_TYPE_RADIO_MAX+1;
                        name_base = "radio";
                        break;
                default:
index 27ae3d679cbeb901d9a7ffb0b025d725a2beba5e..6e33ce96cab044bd6715574c006494cdd04d7e73 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/compiler.h> /* need __user */
 
 
-#define OBSOLETE_OWNER 1 /* It will be removed for 2.6.15 */
+#define OBSOLETE_OWNER 1 /* It will be removed for 2.6.17 */
 #define HAVE_V4L2 1
 
 /*
 
 #ifdef __KERNEL__
 
+/* Minor device allocation */
+#define MINOR_VFL_TYPE_GRABBER_MIN   0
+#define MINOR_VFL_TYPE_GRABBER_MAX  63
+#define MINOR_VFL_TYPE_RADIO_MIN    64
+#define MINOR_VFL_TYPE_RADIO_MAX   127
+#define MINOR_VFL_TYPE_VTX_MIN     192
+#define MINOR_VFL_TYPE_VTX_MAX     223
+#define MINOR_VFL_TYPE_VBI_MIN     224
+#define MINOR_VFL_TYPE_VBI_MAX     255
+
 #define VFL_TYPE_GRABBER       0
 #define VFL_TYPE_VBI           1
 #define VFL_TYPE_RADIO         2
@@ -949,13 +959,15 @@ struct v4l2_sliced_vbi_format
        __u32   reserved[2];            /* must be zero */
 };
 
-/* Teletext WST, defined on ITU-R BT.653-2 */
+/* Teletext World System Teletext
+   (WST), defined on ITU-R BT.653-2 */
 #define V4L2_SLICED_TELETEXT_PAL_B      (0x000001)
 #define V4L2_SLICED_TELETEXT_PAL_C      (0x000002)
 #define V4L2_SLICED_TELETEXT_NTSC_B     (0x000010)
 #define V4L2_SLICED_TELETEXT_SECAM      (0x000020)
 
-/* Teletext NABTS, defined on ITU-R BT.653-2 */
+/* Teletext North American Broadcast Teletext Specification
+   (NABTS), defined on ITU-R BT.653-2 */
 #define V4L2_SLICED_TELETEXT_NTSC_C     (0x000040)
 #define V4L2_SLICED_TELETEXT_NTSC_D     (0x000080)
 
@@ -976,8 +988,24 @@ struct v4l2_sliced_vbi_format
 #define V4l2_SLICED_VITC_625           (0x010000)
 #define V4l2_SLICED_VITC_525           (0x020000)
 
-/* Compat macro - Should be removed for 2.6.18 */
-#define V4L2_SLICED_TELETEXT_B V4L2_SLICED_TELETEXT_PAL_B
+#define V4L2_SLICED_TELETEXT_B         (V4L2_SLICED_TELETEXT_PAL_B  |\
+                                        V4L2_SLICED_TELETEXT_NTSC_B)
+
+#define V4L2_SLICED_TELETEXT           (V4L2_SLICED_TELETEXT_PAL_B  |\
+                                        V4L2_SLICED_TELETEXT_PAL_C  |\
+                                        V4L2_SLICED_TELETEXT_SECAM  |\
+                                        V4L2_SLICED_TELETEXT_NTSC_B |\
+                                        V4L2_SLICED_TELETEXT_NTSC_C |\
+                                        V4L2_SLICED_TELETEXT_NTSC_D)
+
+#define V4L2_SLICED_CAPTION            (V4L2_SLICED_CAPTION_525     |\
+                                        V4L2_SLICED_CAPTION_625)
+
+#define V4L2_SLICED_WSS                        (V4L2_SLICED_WSS_525         |\
+                                        V4L2_SLICED_WSS_625)
+
+#define V4L2_SLICED_VITC               (V4L2_SLICED_VITC_525        |\
+                                        V4L2_SLICED_VITC_625)
 
 #define V4L2_SLICED_VBI_525             (V4L2_SLICED_TELETEXT_NTSC_B |\
                                         V4L2_SLICED_TELETEXT_NTSC_C |\