diff options
Diffstat (limited to 'drivers/media/usb/pvrusb2')
-rw-r--r-- | drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l.c | 1 | ||||
-rw-r--r-- | drivers/media/usb/pvrusb2/pvrusb2-devattr.c | 4 | ||||
-rw-r--r-- | drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 83 |
3 files changed, 33 insertions, 55 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l.c b/drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l.c index 242b213b7599..d5bec0f69bec 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l.c @@ -23,7 +23,6 @@ */ #include "pvrusb2-cx2584x-v4l.h" -#include "pvrusb2-video-v4l.h" #include "pvrusb2-hdw-internal.h" diff --git a/drivers/media/usb/pvrusb2/pvrusb2-devattr.c b/drivers/media/usb/pvrusb2/pvrusb2-devattr.c index 71537097c13f..06de1c83f444 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-devattr.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-devattr.c @@ -182,7 +182,6 @@ static const struct pvr2_device_desc pvr2_device_av400 = { #ifdef CONFIG_VIDEO_PVRUSB2_DVB static struct lgdt330x_config pvr2_lgdt3303_config = { - .demod_address = 0x0e, .demod_chip = LGDT3303, .clock_polarity_flip = 1, }; @@ -190,6 +189,7 @@ static struct lgdt330x_config pvr2_lgdt3303_config = { static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap) { adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3303_config, + 0x0e, &adap->channel.hdw->i2c_adap); if (adap->fe) return 0; @@ -243,13 +243,13 @@ static const struct pvr2_device_desc pvr2_device_onair_creator = { #ifdef CONFIG_VIDEO_PVRUSB2_DVB static struct lgdt330x_config pvr2_lgdt3302_config = { - .demod_address = 0x0e, .demod_chip = LGDT3302, }; static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap) { adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3302_config, + 0x0e, &adap->channel.hdw->i2c_adap); if (adap->fe) return 0; diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c index 9fdc57c1658f..e53a80b589a1 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c @@ -159,9 +159,12 @@ static int pvr2_s_std(struct file *file, void *priv, v4l2_std_id std) { struct pvr2_v4l2_fh *fh = file->private_data; struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; + int ret; - return pvr2_ctrl_set_value( + ret = pvr2_ctrl_set_value( pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_STDCUR), std); + pvr2_hdw_commit_ctl(hdw); + return ret; } static int pvr2_querystd(struct file *file, void *priv, v4l2_std_id *std) @@ -251,12 +254,15 @@ static int pvr2_s_input(struct file *file, void *priv, unsigned int inp) { struct pvr2_v4l2_fh *fh = file->private_data; struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; + int ret; if (inp >= fh->input_cnt) return -EINVAL; - return pvr2_ctrl_set_value( + ret = pvr2_ctrl_set_value( pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_INPUT), fh->input_map[inp]); + pvr2_hdw_commit_ctl(hdw); + return ret; } static int pvr2_enumaudio(struct file *file, void *priv, struct v4l2_audio *vin) @@ -315,13 +321,16 @@ static int pvr2_s_tuner(struct file *file, void *priv, const struct v4l2_tuner * { struct pvr2_v4l2_fh *fh = file->private_data; struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; + int ret; if (vt->index != 0) return -EINVAL; - return pvr2_ctrl_set_value( + ret = pvr2_ctrl_set_value( pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_AUDIOMODE), vt->audmode); + pvr2_hdw_commit_ctl(hdw); + return ret; } static int pvr2_s_frequency(struct file *file, void *priv, const struct v4l2_frequency *vf) @@ -353,8 +362,10 @@ static int pvr2_s_frequency(struct file *file, void *priv, const struct v4l2_fre fv = (fv * 125) / 2; else fv = fv * 62500; - return pvr2_ctrl_set_value( + ret = pvr2_ctrl_set_value( pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_FREQUENCY),fv); + pvr2_hdw_commit_ctl(hdw); + return ret; } static int pvr2_g_frequency(struct file *file, void *priv, struct v4l2_frequency *vf) @@ -470,6 +481,7 @@ static int pvr2_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format vcp = pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_VRES); pvr2_ctrl_set_value(hcp, vf->fmt.pix.width); pvr2_ctrl_set_value(vcp, vf->fmt.pix.height); + pvr2_hdw_commit_ctl(hdw); return 0; } @@ -597,9 +609,12 @@ static int pvr2_s_ctrl(struct file *file, void *priv, struct v4l2_control *vc) { struct pvr2_v4l2_fh *fh = file->private_data; struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; + int ret; - return pvr2_ctrl_set_value(pvr2_hdw_get_ctrl_v4l(hdw, vc->id), + ret = pvr2_ctrl_set_value(pvr2_hdw_get_ctrl_v4l(hdw, vc->id), vc->value); + pvr2_hdw_commit_ctl(hdw); + return ret; } static int pvr2_g_ext_ctrls(struct file *file, void *priv, @@ -658,10 +673,12 @@ static int pvr2_s_ext_ctrls(struct file *file, void *priv, ctrl->value); if (ret) { ctls->error_idx = idx; - return ret; + goto commit; } } - return 0; +commit: + pvr2_hdw_commit_ctl(hdw); + return ret; } static int pvr2_try_ext_ctrls(struct file *file, void *priv, @@ -764,23 +781,23 @@ static int pvr2_s_selection(struct file *file, void *priv, pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_CROPL), sel->r.left); if (ret != 0) - return -EINVAL; + goto commit; ret = pvr2_ctrl_set_value( pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_CROPT), sel->r.top); if (ret != 0) - return -EINVAL; + goto commit; ret = pvr2_ctrl_set_value( pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_CROPW), sel->r.width); if (ret != 0) - return -EINVAL; + goto commit; ret = pvr2_ctrl_set_value( pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_CROPH), sel->r.height); - if (ret != 0) - return -EINVAL; - return 0; +commit: + pvr2_hdw_commit_ctl(hdw); + return ret; } static int pvr2_log_status(struct file *file, void *priv) @@ -905,44 +922,6 @@ static void pvr2_v4l2_internal_check(struct pvr2_channel *chp) } -static long pvr2_v4l2_ioctl(struct file *file, - unsigned int cmd, unsigned long arg) -{ - - struct pvr2_v4l2_fh *fh = file->private_data; - struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; - long ret = -EINVAL; - - if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) - v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw), cmd); - - if (!pvr2_hdw_dev_ok(hdw)) { - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "ioctl failed - bad or no context"); - return -EFAULT; - } - - ret = video_ioctl2(file, cmd, arg); - - pvr2_hdw_commit_ctl(hdw); - - if (ret < 0) { - if (pvrusb2_debug & PVR2_TRACE_V4LIOCTL) { - pvr2_trace(PVR2_TRACE_V4LIOCTL, - "pvr2_v4l2_do_ioctl failure, ret=%ld command was:", -ret); - v4l_printk_ioctl(pvr2_hdw_get_driver_name(hdw), cmd); - } - } else { - pvr2_trace(PVR2_TRACE_V4LIOCTL, - "pvr2_v4l2_do_ioctl complete, ret=%ld (0x%lx)", - ret, ret); - } - return ret; - -} - - static int pvr2_v4l2_release(struct file *file) { struct pvr2_v4l2_fh *fhp = file->private_data; @@ -1205,7 +1184,7 @@ static const struct v4l2_file_operations vdev_fops = { .open = pvr2_v4l2_open, .release = pvr2_v4l2_release, .read = pvr2_v4l2_read, - .unlocked_ioctl = pvr2_v4l2_ioctl, + .unlocked_ioctl = video_ioctl2, .poll = pvr2_v4l2_poll, }; |