diff options
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 17 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h | 10 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 12 |
5 files changed, 31 insertions, 15 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h index 966dd49f5..d366cff16 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h @@ -300,7 +300,8 @@ struct pvr2_hdw { /* Minor numbers used by v4l logic (yes, this is a hack, as there should be no v4l junk here). Probably a better way to do this. */ - int v4l_minor_number_mpeg; + int v4l_minor_number_video; + int v4l_minor_number_vbi; int v4l_minor_number_radio; /* Location of eeprom or a negative number if none */ diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 4dea1e78f..6ba2c52d1 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -1925,7 +1925,8 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, hdw->eeprom_addr = -1; hdw->unit_number = -1; - hdw->v4l_minor_number_mpeg = -1; + hdw->v4l_minor_number_video = -1; + hdw->v4l_minor_number_vbi = -1; hdw->v4l_minor_number_radio = -1; hdw->ctl_write_buffer = kmalloc(PVR2_CTL_BUFFSIZE,GFP_KERNEL); if (!hdw->ctl_write_buffer) goto fail; @@ -2587,11 +2588,12 @@ int pvr2_hdw_cpufw_get(struct pvr2_hdw *hdw,unsigned int offs, int pvr2_hdw_v4l_get_minor_number(struct pvr2_hdw *hdw, - enum pvr2_config index) + enum pvr2_v4l_type index) { switch (index) { - case pvr2_config_mpeg: return hdw->v4l_minor_number_mpeg; - case pvr2_config_radio: return hdw->v4l_minor_number_radio; + case pvr2_v4l_type_video: return hdw->v4l_minor_number_video; + case pvr2_v4l_type_vbi: return hdw->v4l_minor_number_vbi; + case pvr2_v4l_type_radio: return hdw->v4l_minor_number_radio; default: return -1; } } @@ -2599,11 +2601,12 @@ int pvr2_hdw_v4l_get_minor_number(struct pvr2_hdw *hdw, /* Store a v4l minor device number */ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw, - enum pvr2_config index,int v) + enum pvr2_v4l_type index,int v) { switch (index) { - case pvr2_config_mpeg: hdw->v4l_minor_number_mpeg = v; - case pvr2_config_radio: hdw->v4l_minor_number_radio = v; + case pvr2_v4l_type_video: hdw->v4l_minor_number_video = v; + case pvr2_v4l_type_vbi: hdw->v4l_minor_number_vbi = v; + case pvr2_v4l_type_radio: hdw->v4l_minor_number_radio = v; default: break; } } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h index b39fb01c8..9c5aa0447 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -79,6 +79,12 @@ enum pvr2_config { pvr2_config_radio, }; +enum pvr2_v4l_type { + pvr2_v4l_type_video, + pvr2_v4l_type_vbi, + pvr2_v4l_type_radio, +}; + const char *pvr2_config_get_name(enum pvr2_config); struct pvr2_hdw; @@ -215,11 +221,11 @@ int pvr2_hdw_cpufw_get(struct pvr2_hdw *,unsigned int offs, char *buf,unsigned int cnt); /* Retrieve a previously stored v4l minor device number */ -int pvr2_hdw_v4l_get_minor_number(struct pvr2_hdw *,enum pvr2_config index); +int pvr2_hdw_v4l_get_minor_number(struct pvr2_hdw *,enum pvr2_v4l_type index); /* Store a v4l minor device number */ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *, - enum pvr2_config index,int); + enum pvr2_v4l_type index,int); /* Direct read/write access to chip's registers: chip_id - unique id of chip (e.g. I2C_DRIVERD_xxxx) diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c index e587416f3..45add19b9 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c @@ -734,7 +734,7 @@ static ssize_t v4l_minor_number_show(struct class_device *class_dev,char *buf) if (!sfp) return -EINVAL; return scnprintf(buf,PAGE_SIZE,"%d\n", pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, - pvr2_config_mpeg)); + pvr2_v4l_type_video)); } @@ -746,7 +746,7 @@ static ssize_t v4l_radio_minor_number_show(struct class_device *class_dev, if (!sfp) return -EINVAL; return scnprintf(buf,PAGE_SIZE,"%d\n", pvr2_hdw_v4l_get_minor_number(sfp->channel.hdw, - pvr2_config_radio)); + pvr2_v4l_type_radio)); } diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index ba18b9680..0d1dcd11c 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -741,9 +741,11 @@ static void pvr2_v4l2_dev_destroy(struct pvr2_v4l2_dev *dip) static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp) { pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw, - pvr2_config_mpeg,-1); + pvr2_v4l_type_video,-1); pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw, - pvr2_config_radio,-1); + pvr2_v4l_type_vbi,-1); + pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw, + pvr2_v4l_type_radio,-1); pvr2_v4l2_dev_destroy(vp->vdev); pvr2_trace(PVR2_TRACE_STRUCT,"Destroying pvr2_v4l2 id=%p",vp); @@ -1091,6 +1093,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, int mindevnum; int unit_number; int v4l_type; + enum pvr2_v4l_type pvt; dip->v4lp = vp; dip->config = cfg; @@ -1101,13 +1104,16 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, switch (cfg) { case pvr2_config_mpeg: v4l_type = VFL_TYPE_GRABBER; + pvt = pvr2_v4l_type_video; dip->stream = &vp->channel.mc_head->video_stream; break; case pvr2_config_vbi: v4l_type = VFL_TYPE_VBI; + pvt = pvr2_v4l_type_vbi; break; case pvr2_config_radio: v4l_type = VFL_TYPE_RADIO; + pvt = pvr2_v4l_type_radio; break; default: /* Bail out (this should be impossible) */ @@ -1162,7 +1168,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, } pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw, - cfg,dip->devbase.minor); + pvt,dip->devbase.minor); } |