diff options
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c index 51da8945efe4..b1f6809625e8 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | |||
@@ -37,6 +37,7 @@ static void set_standard(struct pvr2_hdw *hdw) | |||
37 | vs = hdw->std_mask_cur; | 37 | vs = hdw->std_mask_cur; |
38 | pvr2_i2c_core_cmd(hdw,VIDIOC_S_STD,&vs); | 38 | pvr2_i2c_core_cmd(hdw,VIDIOC_S_STD,&vs); |
39 | } | 39 | } |
40 | hdw->tuner_signal_stale = !0; | ||
40 | } | 41 | } |
41 | 42 | ||
42 | 43 | ||
@@ -145,13 +146,21 @@ static void set_frequency(struct pvr2_hdw *hdw) | |||
145 | struct v4l2_frequency freq; | 146 | struct v4l2_frequency freq; |
146 | fv = pvr2_hdw_get_cur_freq(hdw); | 147 | fv = pvr2_hdw_get_cur_freq(hdw); |
147 | pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv); | 148 | pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv); |
149 | if (hdw->tuner_signal_stale) { | ||
150 | pvr2_i2c_core_status_poll(hdw); | ||
151 | } | ||
148 | memset(&freq,0,sizeof(freq)); | 152 | memset(&freq,0,sizeof(freq)); |
149 | if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { | 153 | if (hdw->tuner_signal_info.capability & V4L2_TUNER_CAP_LOW) { |
150 | // ((fv * 1000) / 62500) | 154 | // ((fv * 1000) / 62500) |
151 | freq.frequency = (fv * 2) / 125; | 155 | freq.frequency = (fv * 2) / 125; |
152 | freq.type = V4L2_TUNER_RADIO; | ||
153 | } else { | 156 | } else { |
154 | freq.frequency = fv / 62500; | 157 | freq.frequency = fv / 62500; |
158 | } | ||
159 | /* tuner-core currently doesn't seem to care about this, but | ||
160 | let's set it anyway for completeness. */ | ||
161 | if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { | ||
162 | freq.type = V4L2_TUNER_RADIO; | ||
163 | } else { | ||
155 | freq.type = V4L2_TUNER_ANALOG_TV; | 164 | freq.type = V4L2_TUNER_ANALOG_TV; |
156 | } | 165 | } |
157 | freq.tuner = 0; | 166 | freq.tuner = 0; |
@@ -230,6 +239,12 @@ void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *cp,int fl) | |||
230 | } | 239 | } |
231 | 240 | ||
232 | 241 | ||
242 | void pvr2_v4l2_cmd_status_poll(struct pvr2_i2c_client *cp) | ||
243 | { | ||
244 | pvr2_i2c_client_cmd(cp,VIDIOC_G_TUNER,&cp->hdw->tuner_signal_info); | ||
245 | } | ||
246 | |||
247 | |||
233 | /* | 248 | /* |
234 | Stuff for Emacs to see, in order to encourage consistent editing style: | 249 | Stuff for Emacs to see, in order to encourage consistent editing style: |
235 | *** Local Variables: *** | 250 | *** Local Variables: *** |