diff options
author | Mike Isely <isely@pobox.com> | 2006-04-19 23:56:17 -0500 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-04-19 23:56:17 -0500 |
commit | bbfdc6d1fdaea36ca996bb4cfdcc493d998a65f6 (patch) | |
tree | 9a781db7c357c0ce566a98a5c13f57a9f8be7fda /linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | |
parent | a3f7122e105b35188a9e1bc89fdc15758fae8b15 (diff) | |
download | mediapointer-dvb-s2-bbfdc6d1fdaea36ca996bb4cfdcc493d998a65f6.tar.gz mediapointer-dvb-s2-bbfdc6d1fdaea36ca996bb4cfdcc493d998a65f6.tar.bz2 |
Rework pvrusb2 internal controls implementation
From: Mike Isely <isely@pobox.com>
Rework controls internal architecture. Rework video standard
handling. This is a major change.
Signed-off-by: Mike Isely <isely@pobox.com>
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 | 67 |
1 files changed, 32 insertions, 35 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 25543e9b1..e6b176bf3 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c @@ -29,7 +29,7 @@ static void set_standard(struct pvr2_hdw *hdw) { v4l2_std_id vs; - vs = hdw->controls[PVR2_CID_STDCUR].value; + vs = hdw->video_std_cur; pvr2_trace(PVR2_TRACE_CHIPS, "i2c v4l2 set_standard(0x%llx)",(__u64)vs); @@ -39,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->video_std_dirty != 0; } @@ -55,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); } @@ -97,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); } @@ -142,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; @@ -154,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; } @@ -172,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); @@ -184,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); } |