aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-01-20 00:15:41 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 13:34:38 -0200
commit7c74e57e6fb2ce986134e74634aeb78b3ea41a97 (patch)
tree32a6a3be3f7bd94006f5d17789bc6f566827d1be /drivers/media/video/pvrusb2
parentfe23a2809d1f88887f7df7da38652826933b8ce6 (diff)
V4L/DVB (5083): Pvrusb2: Remove automodeswitch control
The automodeswitch control was a feature that enable automatic radio / tv switching based on the selected frequency. However since frequency ranges can overlap and also since apparently in some cases it's possible for the same frequency range to be both tv and radio in a specific region, then this feature can't safely work. So it's removed. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h1
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c66
2 files changed, 4 insertions, 63 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
index bc911ff7530..16bd7419960 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
@@ -318,7 +318,6 @@ struct pvr2_hdw {
VCREATE_DATA(res_hor);
VCREATE_DATA(res_ver);
VCREATE_DATA(srate);
- VCREATE_DATA(automodeswitch);
#undef VCREATE_DATA
struct pvr2_ctld_info *mpeg_ctrl_info;
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 776125491c8..11890a0a72a 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -94,7 +94,6 @@ static int procreload = 0;
static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 };
static int tolerance[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 };
static int video_std[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 };
-static int auto_mode_switch[PVR_NUM];
static int init_pause_msec = 0;
module_param(ctlchg, int, S_IRUGO|S_IWUSR);
@@ -112,8 +111,6 @@ module_param_array(video_std, int, NULL, 0444);
MODULE_PARM_DESC(video_std,"specify initial video standard");
module_param_array(tolerance, int, NULL, 0444);
MODULE_PARM_DESC(tolerance,"specify stream error tolerance");
-module_param_array(auto_mode_switch, int, NULL, 0444);
-MODULE_PARM_DESC(auto_mode_switch,"Enable TV/Radio automatic mode switch based on freq");
#define PVR2_CTL_WRITE_ENDPOINT 0x01
#define PVR2_CTL_READ_ENDPOINT 0x81
@@ -759,7 +756,6 @@ VCREATE_FUNCS(audiomode)
VCREATE_FUNCS(res_hor)
VCREATE_FUNCS(res_ver)
VCREATE_FUNCS(srate)
-VCREATE_FUNCS(automodeswitch)
/* Table definition of all controls which can be manipulated */
static const struct pvr2_ctl_info control_defs[] = {
@@ -859,12 +855,6 @@ static const struct pvr2_ctl_info control_defs[] = {
.get_max_value = ctrl_vres_max_get,
.get_min_value = ctrl_vres_min_get,
},{
- .desc = "Automatic TV / Radio mode switch based on frequency",
- .name = "auto_mode_switch",
- .default_value = 0,
- DEFREF(automodeswitch),
- DEFBOOL,
- },{
.v4l_id = V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ,
.default_value = V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000,
.desc = "Audio Sampling Frequency",
@@ -1022,71 +1012,28 @@ unsigned long pvr2_hdw_get_cur_freq(struct pvr2_hdw *hdw)
driver-core side effects of this action. */
void pvr2_hdw_set_cur_freq(struct pvr2_hdw *hdw,unsigned long val)
{
- int mode = 0;
-
- /* If hdw->automodeswitch_val is set, then we do something clever:
- Look at the desired frequency and see if it looks like FM or TV.
- Execute a possible mode switch based on this result. Otherwise
- we use the current input setting to determine which frequency
- register we need to adjust. */
- if (hdw->automodeswitch_val) {
- /* Note that since FM RADIO frequency range sits *inside*
- the TV spectrum that we must therefore check the radio
- range first... */
- if ((val >= RADIO_MIN_FREQ) && (val <= RADIO_MAX_FREQ)) {
- mode = 1;
- } else if ((val >= TV_MIN_FREQ) && (val <= TV_MAX_FREQ)) {
- mode = 2;
- }
- } else {
- if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
- mode = 1;
- } else {
- mode = 2;
- }
- }
-
- switch (mode) {
- case 1:
+ if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
if (hdw->freqSelector) {
/* Swing over to radio frequency selection */
hdw->freqSelector = 0;
hdw->freqDirty = !0;
}
- if (hdw->input_val == PVR2_CVAL_INPUT_TV) {
- /* Force switch to radio mode */
- hdw->input_val = PVR2_CVAL_INPUT_RADIO;
- hdw->input_dirty = !0;
- }
if (hdw->freqValRadio != val) {
hdw->freqValRadio = val;
hdw->freqSlotRadio = 0;
- if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
- hdw->freqDirty = !0;
- }
+ hdw->freqDirty = !0;
}
- break;
- case 2:
+ } else {
if (!(hdw->freqSelector)) {
/* Swing over to television frequency selection */
hdw->freqSelector = 1;
hdw->freqDirty = !0;
}
- if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
- /* Force switch to television mode */
- hdw->input_val = PVR2_CVAL_INPUT_TV;
- hdw->input_dirty = !0;
- }
if (hdw->freqValTelevision != val) {
hdw->freqValTelevision = val;
hdw->freqSlotTelevision = 0;
- if (hdw->input_val == PVR2_CVAL_INPUT_TV) {
- hdw->freqDirty = !0;
- }
+ hdw->freqDirty = !0;
}
- break;
- default:
- break;
}
}
@@ -1839,11 +1786,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
/* 104.3 MHz, a usable FM station for my area */
hdw->freqValRadio = 104300000L;
- /* Default value for auto mode switch based on module option */
- if ((hdw->unit_number >= 0) && (hdw->unit_number < PVR_NUM)) {
- hdw->automodeswitch_val = auto_mode_switch[hdw->unit_number];
- }
-
// Do not use pvr2_reset_ctl_endpoints() here. It is not
// thread-safe against the normal pvr2_send_request() mechanism.
// (We should make it thread safe).