diff options
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c index fb83cd2c9..9f81aff2b 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c @@ -24,13 +24,12 @@ #include "pvrusb2-hdw-internal.h" #include "pvrusb2-debug.h" #include <linux/videodev2.h> -#include <linux/videodev2.h> static void set_standard(struct pvr2_hdw *hdw) { v4l2_std_id vs; - vs = hdw->controls[PVR2_CID_STDCUR].value; + vs = hdw->std_mask_cur; pvr2_trace(PVR2_TRACE_CHIPS, "i2c v4l2 set_standard(0x%llx)",(__u64)vs); @@ -40,7 +39,7 @@ static void set_standard(struct pvr2_hdw *hdw) static int check_standard(struct pvr2_hdw *hdw) { - return hdw->controls[PVR2_CID_STDCUR].dirty != 0; + return hdw->std_dirty != 0; } @@ -56,32 +55,30 @@ static void set_bcsh(struct pvr2_hdw *hdw) struct v4l2_control ctrl; pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_bcsh" " b=%d c=%d s=%d h=%d", - hdw->controls[PVR2_CID_BRIGHTNESS].value, - hdw->controls[PVR2_CID_CONTRAST].value, - hdw->controls[PVR2_CID_SATURATION].value, - hdw->controls[PVR2_CID_HUE].value); + hdw->brightness_val,hdw->contrast_val, + hdw->saturation_val,hdw->hue_val); memset(&ctrl,0,sizeof(ctrl)); ctrl.id = V4L2_CID_BRIGHTNESS; - ctrl.value = hdw->controls[PVR2_CID_BRIGHTNESS].value; + ctrl.value = hdw->brightness_val; pvr2_i2c_core_cmd(hdw,VIDIOC_S_CTRL,&ctrl); ctrl.id = V4L2_CID_CONTRAST; - ctrl.value = hdw->controls[PVR2_CID_CONTRAST].value; + ctrl.value = hdw->contrast_val; pvr2_i2c_core_cmd(hdw,VIDIOC_S_CTRL,&ctrl); ctrl.id = V4L2_CID_SATURATION; - ctrl.value = hdw->controls[PVR2_CID_SATURATION].value; + ctrl.value = hdw->saturation_val; pvr2_i2c_core_cmd(hdw,VIDIOC_S_CTRL,&ctrl); ctrl.id = V4L2_CID_HUE; - ctrl.value = hdw->controls[PVR2_CID_HUE].value; + ctrl.value = hdw->hue_val; pvr2_i2c_core_cmd(hdw,VIDIOC_S_CTRL,&ctrl); } static int check_bcsh(struct pvr2_hdw *hdw) { - return (hdw->controls[PVR2_CID_BRIGHTNESS].dirty || - hdw->controls[PVR2_CID_CONTRAST].dirty || - hdw->controls[PVR2_CID_SATURATION].dirty || - hdw->controls[PVR2_CID_HUE].dirty); + return (hdw->brightness_dirty || + hdw->contrast_dirty || + hdw->saturation_dirty || + hdw->hue_dirty); } @@ -98,37 +95,37 @@ static void set_volume(struct pvr2_hdw *hdw) pvr2_trace(PVR2_TRACE_CHIPS, "i2c v4l2 set_volume" "(vol=%d bal=%d bas=%d treb=%d mute=%d)", - hdw->controls[PVR2_CID_VOLUME].value, - hdw->controls[PVR2_CID_BALANCE].value, - hdw->controls[PVR2_CID_BASS].value, - hdw->controls[PVR2_CID_TREBLE].value, - hdw->controls[PVR2_CID_MUTE].value); + hdw->volume_val, + hdw->balance_val, + hdw->bass_val, + hdw->treble_val, + hdw->mute_val); memset(&ctrl,0,sizeof(ctrl)); ctrl.id = V4L2_CID_AUDIO_MUTE; - ctrl.value = hdw->controls[PVR2_CID_MUTE].value ? 1 : 0; + ctrl.value = hdw->mute_val ? 1 : 0; pvr2_i2c_core_cmd(hdw,VIDIOC_S_CTRL,&ctrl); ctrl.id = V4L2_CID_AUDIO_VOLUME; - ctrl.value = hdw->controls[PVR2_CID_VOLUME].value; + ctrl.value = hdw->volume_val; pvr2_i2c_core_cmd(hdw,VIDIOC_S_CTRL,&ctrl); ctrl.id = V4L2_CID_AUDIO_BALANCE; - ctrl.value = hdw->controls[PVR2_CID_BALANCE].value; + ctrl.value = hdw->balance_val; pvr2_i2c_core_cmd(hdw,VIDIOC_S_CTRL,&ctrl); ctrl.id = V4L2_CID_AUDIO_BASS; - ctrl.value = hdw->controls[PVR2_CID_BASS].value; + ctrl.value = hdw->bass_val; pvr2_i2c_core_cmd(hdw,VIDIOC_S_CTRL,&ctrl); ctrl.id = V4L2_CID_AUDIO_TREBLE; - ctrl.value = hdw->controls[PVR2_CID_TREBLE].value; + ctrl.value = hdw->treble_val; pvr2_i2c_core_cmd(hdw,VIDIOC_S_CTRL,&ctrl); } static int check_volume(struct pvr2_hdw *hdw) { - return (hdw->controls[PVR2_CID_VOLUME].dirty || - hdw->controls[PVR2_CID_BALANCE].dirty || - hdw->controls[PVR2_CID_BASS].dirty || - hdw->controls[PVR2_CID_TREBLE].dirty || - hdw->controls[PVR2_CID_MUTE].dirty); + return (hdw->volume_dirty || + hdw->balance_dirty || + hdw->bass_dirty || + hdw->treble_dirty || + hdw->mute_dirty); } @@ -143,7 +140,7 @@ static void set_frequency(struct pvr2_hdw *hdw) { unsigned long fv; struct v4l2_frequency freq; - fv = hdw->controls[PVR2_CID_FREQUENCY].value; + fv = hdw->freqVal; pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv); memset(&freq,0,sizeof(freq)); freq.frequency = fv / 62500; @@ -155,7 +152,7 @@ static void set_frequency(struct pvr2_hdw *hdw) static int check_frequency(struct pvr2_hdw *hdw) { - return hdw->controls[PVR2_CID_FREQUENCY].dirty != 0; + return hdw->freqDirty != 0; } @@ -173,8 +170,8 @@ static void set_size(struct pvr2_hdw *hdw) memset(&fmt,0,sizeof(fmt)); fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - fmt.fmt.pix.width = hdw->controls[PVR2_CID_HRES].value; - fmt.fmt.pix.height = hdw->controls[PVR2_CID_VRES].value; + fmt.fmt.pix.width = hdw->res_hor_val; + fmt.fmt.pix.height = hdw->res_ver_val; pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_size(%dx%d)", fmt.fmt.pix.width,fmt.fmt.pix.height); @@ -185,8 +182,7 @@ static void set_size(struct pvr2_hdw *hdw) static int check_size(struct pvr2_hdw *hdw) { - return (hdw->controls[PVR2_CID_HRES].dirty || - hdw->controls[PVR2_CID_VRES].dirty); + return (hdw->res_hor_dirty || hdw->res_ver_dirty); } |