aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-simple.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/tuner-simple.c')
-rw-r--r--drivers/media/video/tuner-simple.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index 2c6410cc0fe9..6f0d376f0d18 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -133,7 +133,7 @@ static int tuner_stereo(struct i2c_client *c)
133static void default_set_tv_freq(struct i2c_client *c, unsigned int freq) 133static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
134{ 134{
135 struct tuner *t = i2c_get_clientdata(c); 135 struct tuner *t = i2c_get_clientdata(c);
136 u8 cb, tuneraddr; 136 u8 config, cb, tuneraddr;
137 u16 div; 137 u16 div;
138 struct tunertype *tun; 138 struct tunertype *tun;
139 u8 buffer[4]; 139 u8 buffer[4];
@@ -152,6 +152,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
152 freq, tun->params[j].ranges[i - 1].limit); 152 freq, tun->params[j].ranges[i - 1].limit);
153 freq = tun->params[j].ranges[--i].limit; 153 freq = tun->params[j].ranges[--i].limit;
154 } 154 }
155 config = tun->params[j].ranges[i].config;
155 cb = tun->params[j].ranges[i].cb; 156 cb = tun->params[j].ranges[i].cb;
156 /* i == 0 -> VHF_LO */ 157 /* i == 0 -> VHF_LO */
157 /* i == 1 -> VHF_HI */ 158 /* i == 1 -> VHF_HI */
@@ -215,7 +216,7 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
215 216
216 case TUNER_MICROTUNE_4042FI5: 217 case TUNER_MICROTUNE_4042FI5:
217 /* Set the charge pump for fast tuning */ 218 /* Set the charge pump for fast tuning */
218 tun->params[j].config |= TUNER_CHARGE_PUMP; 219 config |= TUNER_CHARGE_PUMP;
219 break; 220 break;
220 221
221 case TUNER_PHILIPS_TUV1236D: 222 case TUNER_PHILIPS_TUV1236D:
@@ -276,14 +277,14 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
276 div); 277 div);
277 278
278 if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) { 279 if (tuners[t->type].params->cb_first_if_lower_freq && div < t->last_div) {
279 buffer[0] = tun->params[j].config; 280 buffer[0] = config;
280 buffer[1] = cb; 281 buffer[1] = cb;
281 buffer[2] = (div>>8) & 0x7f; 282 buffer[2] = (div>>8) & 0x7f;
282 buffer[3] = div & 0xff; 283 buffer[3] = div & 0xff;
283 } else { 284 } else {
284 buffer[0] = (div>>8) & 0x7f; 285 buffer[0] = (div>>8) & 0x7f;
285 buffer[1] = div & 0xff; 286 buffer[1] = div & 0xff;
286 buffer[2] = tun->params[j].config; 287 buffer[2] = config;
287 buffer[3] = cb; 288 buffer[3] = cb;
288 } 289 }
289 t->last_div = div; 290 t->last_div = div;
@@ -312,10 +313,10 @@ static void default_set_tv_freq(struct i2c_client *c, unsigned int freq)
312 } 313 }
313 314
314 /* Set the charge pump for optimized phase noise figure */ 315 /* Set the charge pump for optimized phase noise figure */
315 tun->params[j].config &= ~TUNER_CHARGE_PUMP; 316 config &= ~TUNER_CHARGE_PUMP;
316 buffer[0] = (div>>8) & 0x7f; 317 buffer[0] = (div>>8) & 0x7f;
317 buffer[1] = div & 0xff; 318 buffer[1] = div & 0xff;
318 buffer[2] = tun->params[j].config; 319 buffer[2] = config;
319 buffer[3] = cb; 320 buffer[3] = cb;
320 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n", 321 tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
321 buffer[0],buffer[1],buffer[2],buffer[3]); 322 buffer[0],buffer[1],buffer[2],buffer[3]);
@@ -337,7 +338,7 @@ static void default_set_radio_freq(struct i2c_client *c, unsigned int freq)
337 j = TUNER_PARAM_ANALOG; 338 j = TUNER_PARAM_ANALOG;
338 339
339 div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */ 340 div = (20 * freq / 16000) + (int)(20*10.7); /* IF 10.7 MHz */
340 buffer[2] = (tun->params[j].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */ 341 buffer[2] = (tun->params[j].ranges[0].config & ~TUNER_RATIO_MASK) | TUNER_RATIO_SELECT_50; /* 50 kHz step */
341 342
342 switch (t->type) { 343 switch (t->type) {
343 case TUNER_TENA_9533_DI: 344 case TUNER_TENA_9533_DI: