aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-xc2028.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-07-18 22:14:25 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:01:04 -0500
commitd4e7668104f7f17fa093121bf13e9728b88da57d (patch)
treec90e0e26cdc43b3e495f4b6b720dc691af3d5f12 /drivers/media/video/tuner-xc2028.c
parent2e4160ca8046e3c35277bed62b2c180427d57dd7 (diff)
V4L/DVB (6427): Some cleanups at tuner-xc2028 driver
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tuner-xc2028.c')
-rw-r--r--drivers/media/video/tuner-xc2028.c41
1 files changed, 10 insertions, 31 deletions
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c
index 838db8187a9c..f514c5ce5c8f 100644
--- a/drivers/media/video/tuner-xc2028.c
+++ b/drivers/media/video/tuner-xc2028.c
@@ -314,28 +314,11 @@ static void generic_set_tv_freq(struct i2c_client *c, u32 freq /* in Hz */,
314 struct tuner *t = i2c_get_clientdata(c); 314 struct tuner *t = i2c_get_clientdata(c);
315 u32 div, offset = 0; 315 u32 div, offset = 0;
316 316
317 printk("xc3028: should set frequency %d kHz)\n", freq / 1000); 317 /* HACK: It seems that specific firmware need to be reloaded
318 318 when freq is changed */
319 if (check_firmware(c, new_mode, bandwidth)<0) 319 struct xc2028_data *xc2028 = t->priv;
320 return;
321
322 if(new_mode == T_DIGITAL_TV) {
323 switch(bandwidth) {
324 case BANDWIDTH_8_MHZ:
325 offset = 2750000;
326 break;
327
328 case BANDWIDTH_7_MHZ:
329 offset = 2750000;
330 break;
331
332 case BANDWIDTH_6_MHZ:
333 default:
334 printk(KERN_ERR "xc2028: bandwidth not implemented!\n");
335 }
336 }
337 320
338 div = (freq - offset + DIV/2)/DIV; 321 xc2028->firm_type=0;
339 322
340 /* Reset GPIO 1 */ 323 /* Reset GPIO 1 */
341 if (t->tuner_callback) { 324 if (t->tuner_callback) {
@@ -345,17 +328,16 @@ static void generic_set_tv_freq(struct i2c_client *c, u32 freq /* in Hz */,
345 return; 328 return;
346 } 329 }
347 msleep(10); 330 msleep(10);
331 printk("xc3028: should set frequency %d kHz)\n", freq / 1000);
348 332
349 char *name; 333 if (check_firmware(c, new_mode, bandwidth)<0)
334 return;
350 335
351 rc = load_firmware(c,firmware_INIT1); 336 if(new_mode == T_DIGITAL_TV)
337 offset = 2750000;
352 338
353 if (t->std & V4L2_STD_MN) 339 div = (freq - offset + DIV/2)/DIV;
354 name=firmware_MN;
355 else
356 name=firmware_DK;
357 340
358 rc = load_firmware(c,name);
359 /* CMD= Set frequency */ 341 /* CMD= Set frequency */
360 send_seq(c, {0x00, 0x02, 0x00, 0x00}); 342 send_seq(c, {0x00, 0x02, 0x00, 0x00});
361 if (t->tuner_callback) { 343 if (t->tuner_callback) {
@@ -366,8 +348,6 @@ static void generic_set_tv_freq(struct i2c_client *c, u32 freq /* in Hz */,
366 } 348 }
367 349
368 msleep(10); 350 msleep(10);
369// send_seq(c, {0x00, 0x00, 0x10, 0xd0, 0x00});
370// msleep(100);
371 351
372 buf[0]= 0xff & (div>>24); 352 buf[0]= 0xff & (div>>24);
373 buf[1]= 0xff & (div>>16); 353 buf[1]= 0xff & (div>>16);
@@ -383,7 +363,6 @@ static void generic_set_tv_freq(struct i2c_client *c, u32 freq /* in Hz */,
383 printk("divider= %02x %02x %02x %02x (freq=%d.%02d)\n", 363 printk("divider= %02x %02x %02x %02x (freq=%d.%02d)\n",
384 buf[1],buf[2],buf[3],buf[4], 364 buf[1],buf[2],buf[3],buf[4],
385 freq / 16, freq % 16 * 100 / 16); 365 freq / 16, freq % 16 * 100 / 16);
386// printk("signal=%d\n",xc2028_signal(c));
387} 366}
388 367
389 368