aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-simple.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2006-02-07 03:25:39 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-02-07 03:25:39 -0500
commit8f1a58d0fccacb5d61aed8a63c3920c8acc155e7 (patch)
treed229a08c9f0f90db266ec09c62d8282b9fb0158e /drivers/media/video/tuner-simple.c
parent4d17d0834a2e6a5cba096ea09592a4a096183300 (diff)
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: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tuner-simple.c')
-rw-r--r--drivers/media/video/tuner-simple.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index 2e680cf515a2..61dd26a43976 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -163,6 +163,10 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
163 continue; 163 continue;
164 break; 164 break;
165 } 165 }
166 /* use default tuner_params if desired_type not available */
167 if (desired_type != tun->params[j].type)
168 j = 0;
169
166 for (i = 0; i < tun->params[j].count; i++) { 170 for (i = 0; i < tun->params[j].count; i++) {
167 if (freq > tun->params[j].ranges[i].limit) 171 if (freq > tun->params[j].ranges[i].limit)
168 continue; 172 continue;
@@ -340,6 +344,9 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
340 continue; 344 continue;
341 break; 345 break;
342 } 346 }
347 /* use default tuner_params if desired_type not available */
348 if (desired_type != tun->params[j].type)
349 j = 0;
343 350
344 div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */ 351 div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */
345 buffer[2] = (tun->params[j].ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */ 352 buffer[2] = (tun->params[j].ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */