Commit 8f1a58d0 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (3277): Use default tuner_params if desired_type not available

If a given tuner definition contains more than one tuner_params array members,
it will try to select the appropriate tuner_params based on the video standard
in use. If there is no tuner_params defined for the current video standard, it
will select the default, tuner_params[0]
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 4d17d083
...@@ -163,6 +163,10 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) ...@@ -163,6 +163,10 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
continue; continue;
break; break;
} }
/* use default tuner_params if desired_type not available */
if (desired_type != tun->params[j].type)
j = 0;
for (i = 0; i < tun->params[j].count; i++) { for (i = 0; i < tun->params[j].count; i++) {
if (freq > tun->params[j].ranges[i].limit) if (freq > tun->params[j].ranges[i].limit)
continue; continue;
...@@ -340,6 +344,9 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq) ...@@ -340,6 +344,9 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
continue; continue;
break; break;
} }
/* use default tuner_params if desired_type not available */
if (desired_type != tun->params[j].type)
j = 0;
div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */ div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */
buffer[2] = (tun->params[j].ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */ buffer[2] = (tun->params[j].ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */
......
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