aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-hdw.c
diff options
context:
space:
mode:
authorPantelis Koukousoulas <pakt223@freemail.gr>2006-12-27 21:07:58 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:34:22 -0500
commit2fdf3d9c94f7f752dacbebb75bbecda3c1b082a0 (patch)
tree24d9c155095a642806cb3fee4210843936f220fe /drivers/media/video/pvrusb2/pvrusb2-hdw.c
parent6fcb5b3ef758ca78461d390dc07bed5a4667c521 (diff)
V4L/DVB (5037): Pvrusb2: Implement multiple minor device number handling
This is the first patch in preparation of the V4L2/IVTV radio interface. It does away with the assumption of only one minor per device. It also adds a file to show the radio minor as well. This can be useful for a program like pvr-radio.c (when it grows up), since this way it can search for the minor of the /dev/radioX device it opened and use the video minor of the same driver instance to get to the actual stream. The implementation looks kinda ugly. Feel free to improve (that is the reason behind separate patches anyway). Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr> Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index ca4ef95996be..4b45299e187d 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1898,7 +1898,9 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
1898 1898
1899 hdw->eeprom_addr = -1; 1899 hdw->eeprom_addr = -1;
1900 hdw->unit_number = -1; 1900 hdw->unit_number = -1;
1901 hdw->v4l_minor_number = -1; 1901 hdw->v4l_minor_number[0] = -1;
1902 hdw->v4l_minor_number[1] = -1;
1903 hdw->v4l_minor_number[2] = -1;
1902 hdw->ctl_write_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL); 1904 hdw->ctl_write_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL);
1903 if (!hdw->ctl_write_buffer) goto fail; 1905 if (!hdw->ctl_write_buffer) goto fail;
1904 hdw->ctl_read_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL); 1906 hdw->ctl_read_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL);
@@ -2546,16 +2548,16 @@ int pvr2_hdw_cpufw_get(struct pvr2_hdw *hdw,unsigned int offs,
2546} 2548}
2547 2549
2548 2550
2549int pvr2_hdw_v4l_get_minor_number(struct pvr2_hdw *hdw) 2551int pvr2_hdw_v4l_get_minor_number(struct pvr2_hdw *hdw,int index)
2550{ 2552{
2551 return hdw->v4l_minor_number; 2553 return hdw->v4l_minor_number[index];
2552} 2554}
2553 2555
2554 2556
2555/* Store the v4l minor device number */ 2557/* Store a v4l minor device number */
2556void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,int v) 2558void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,int index,int v)
2557{ 2559{
2558 hdw->v4l_minor_number = v; 2560 hdw->v4l_minor_number[index] = v;
2559} 2561}
2560 2562
2561 2563