Commit 1bde0289 authored by Mike Isely's avatar Mike Isely Committed by Mauro Carvalho Chehab

V4L/DVB (5051): Pvrusb2: Better radio versus tv frequency handling

Separate track radio versus tv frequency so that when we switch modes
we can also switch to a sane frequency appropriate for the mode.  Also
implement logic to automate mode switching in certain cases.
Signed-off-by: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 5549f54f
...@@ -214,7 +214,6 @@ struct pvr2_hdw { ...@@ -214,7 +214,6 @@ struct pvr2_hdw {
/* Frequency table */ /* Frequency table */
unsigned int freqTable[FREQTABLE_SIZE]; unsigned int freqTable[FREQTABLE_SIZE];
unsigned int freqProgSlot; unsigned int freqProgSlot;
unsigned int freqSlot;
/* Stuff for handling low level control interaction with device */ /* Stuff for handling low level control interaction with device */
struct mutex ctl_lock_mutex; struct mutex ctl_lock_mutex;
...@@ -260,7 +259,11 @@ struct pvr2_hdw { ...@@ -260,7 +259,11 @@ struct pvr2_hdw {
/* Tuner / frequency control stuff */ /* Tuner / frequency control stuff */
unsigned int tuner_type; unsigned int tuner_type;
int tuner_updated; int tuner_updated;
unsigned int freqVal; unsigned int freqValTelevision; /* Current freq for tv mode */
unsigned int freqValRadio; /* Current freq for radio mode */
unsigned int freqSlotTelevision; /* Current slot for tv mode */
unsigned int freqSlotRadio; /* Current slot for radio mode */
unsigned int freqSelector; /* 0=radio 1=television */
int freqDirty; int freqDirty;
/* Video standard handling */ /* Video standard handling */
...@@ -323,6 +326,7 @@ struct pvr2_hdw { ...@@ -323,6 +326,7 @@ struct pvr2_hdw {
VCREATE_DATA(res_hor); VCREATE_DATA(res_hor);
VCREATE_DATA(res_ver); VCREATE_DATA(res_ver);
VCREATE_DATA(srate); VCREATE_DATA(srate);
VCREATE_DATA(automodeswitch);
#undef VCREATE_DATA #undef VCREATE_DATA
struct pvr2_ctld_info *mpeg_ctrl_info; struct pvr2_ctld_info *mpeg_ctrl_info;
...@@ -331,6 +335,9 @@ struct pvr2_hdw { ...@@ -331,6 +335,9 @@ struct pvr2_hdw {
unsigned int control_cnt; unsigned int control_cnt;
}; };
/* This function gets the current frequency */
unsigned long pvr2_hdw_get_cur_freq(struct pvr2_hdw *);
#endif /* __PVRUSB2_HDW_INTERNAL_H */ #endif /* __PVRUSB2_HDW_INTERNAL_H */
/* /*
......
This diff is collapsed.
...@@ -143,7 +143,7 @@ static void set_frequency(struct pvr2_hdw *hdw) ...@@ -143,7 +143,7 @@ static void set_frequency(struct pvr2_hdw *hdw)
{ {
unsigned long fv; unsigned long fv;
struct v4l2_frequency freq; struct v4l2_frequency freq;
fv = hdw->freqVal; fv = pvr2_hdw_get_cur_freq(hdw);
pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv); pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv);
memset(&freq,0,sizeof(freq)); memset(&freq,0,sizeof(freq));
if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment