aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-10-04 07:36:54 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:37:16 -0400
commitdd89601d47e2eeab7c17b25f2549444751bcffe4 (patch)
treeda21e8b17e49d175f5b8cbd14a772bf00f7fb63a /include/media
parente86a93dc3c870c412592c1f298c1425d80c58c6e (diff)
V4L/DVB (9133): v4l: disconnect kernel number from minor
The v4l core creates four different video devices (video, vbi, radio, vtx) and each has its own range of minor numbers. However, modern devices keep increasing the number of devices that they need so a maximum of 64 video devices will not be enough in the future. In addition this scheme makes it very hard to add new device types. This patch disconnects the kernel number allocation (e.g. video0, video1, etc.) from the actual minor number (just pick the first free minor). This allows for much more flexibility in the future. However, it does require the use of udev. For those who cannot use udev a new CONFIG option was created that changes the allocation scheme back to the old behavior. Thanks to Greg KH for suggesting this approach during the 2008 LPC. In addition, several bugs were fixed in the ivtv and cx18 drivers: these drivers try to allocate specific kernel numbers but that scheme contained a bug which caused what should have been e.g. video17 to appear as e.g. video2. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-dev.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index d129b56e1a9f..a0a6b41c5e09 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -18,20 +18,11 @@
18 18
19#define VIDEO_MAJOR 81 19#define VIDEO_MAJOR 81
20 20
21/* Minor device allocation */
22#define MINOR_VFL_TYPE_GRABBER_MIN 0
23#define MINOR_VFL_TYPE_GRABBER_MAX 63
24#define MINOR_VFL_TYPE_RADIO_MIN 64
25#define MINOR_VFL_TYPE_RADIO_MAX 127
26#define MINOR_VFL_TYPE_VTX_MIN 192
27#define MINOR_VFL_TYPE_VTX_MAX 223
28#define MINOR_VFL_TYPE_VBI_MIN 224
29#define MINOR_VFL_TYPE_VBI_MAX 255
30
31#define VFL_TYPE_GRABBER 0 21#define VFL_TYPE_GRABBER 0
32#define VFL_TYPE_VBI 1 22#define VFL_TYPE_VBI 1
33#define VFL_TYPE_RADIO 2 23#define VFL_TYPE_RADIO 2
34#define VFL_TYPE_VTX 3 24#define VFL_TYPE_VTX 3
25#define VFL_TYPE_MAX 4
35 26
36struct v4l2_ioctl_callbacks; 27struct v4l2_ioctl_callbacks;
37 28
@@ -56,6 +47,7 @@ struct video_device
56 char name[32]; 47 char name[32];
57 int vfl_type; 48 int vfl_type;
58 int minor; 49 int minor;
50 u16 num;
59 /* attribute to differentiate multiple indices on one physical device */ 51 /* attribute to differentiate multiple indices on one physical device */
60 int index; 52 int index;
61 53