/* 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 */
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;
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;
}
}
/* 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;
}
}
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;
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)
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));
}
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));
}
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);
int mindevnum;
int unit_number;
int v4l_type;
+ enum pvr2_v4l_type pvt;
dip->v4lp = vp;
dip->config = cfg;
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) */
}
pvr2_hdw_v4l_store_minor_number(vp->channel.mc_head->hdw,
- cfg,dip->devbase.minor);
+ pvt,dip->devbase.minor);
}