aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttpci/budget.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/ttpci/budget.c')
-rw-r--r--drivers/media/dvb/ttpci/budget.c53
1 files changed, 41 insertions, 12 deletions
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
index 863dffb4ed8e..e58f0391e9d1 100644
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -41,6 +41,8 @@
41#include "l64781.h" 41#include "l64781.h"
42#include "tda8083.h" 42#include "tda8083.h"
43#include "s5h1420.h" 43#include "s5h1420.h"
44#include "tda10086.h"
45#include "tda826x.h"
44#include "lnbp21.h" 46#include "lnbp21.h"
45#include "bsru6.h" 47#include "bsru6.h"
46 48
@@ -342,6 +344,11 @@ static struct s5h1420_config s5h1420_config = {
342 .invert = 1, 344 .invert = 1,
343}; 345};
344 346
347static struct tda10086_config tda10086_config = {
348 .demod_address = 0x0e,
349 .invert = 0,
350};
351
345static u8 read_pwm(struct budget* budget) 352static u8 read_pwm(struct budget* budget)
346{ 353{
347 u8 b = 0xff; 354 u8 b = 0xff;
@@ -361,7 +368,7 @@ static void frontend_init(struct budget *budget)
361 case 0x1003: // Hauppauge/TT Nova budget (stv0299/ALPS BSRU6(tsa5059) OR ves1893/ALPS BSRV2(sp5659)) 368 case 0x1003: // Hauppauge/TT Nova budget (stv0299/ALPS BSRU6(tsa5059) OR ves1893/ALPS BSRV2(sp5659))
362 case 0x1013: 369 case 0x1013:
363 // try the ALPS BSRV2 first of all 370 // try the ALPS BSRV2 first of all
364 budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); 371 budget->dvb_frontend = dvb_attach(ves1x93_attach, &alps_bsrv2_config, &budget->i2c_adap);
365 if (budget->dvb_frontend) { 372 if (budget->dvb_frontend) {
366 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; 373 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params;
367 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; 374 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd;
@@ -371,7 +378,7 @@ static void frontend_init(struct budget *budget)
371 } 378 }
372 379
373 // try the ALPS BSRU6 now 380 // try the ALPS BSRU6 now
374 budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); 381 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap);
375 if (budget->dvb_frontend) { 382 if (budget->dvb_frontend) {
376 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; 383 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
377 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; 384 budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
@@ -381,7 +388,7 @@ static void frontend_init(struct budget *budget)
381 388
382 case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) 389 case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659))
383 390
384 budget->dvb_frontend = ves1820_attach(&alps_tdbe2_config, &budget->i2c_adap, read_pwm(budget)); 391 budget->dvb_frontend = dvb_attach(ves1820_attach, &alps_tdbe2_config, &budget->i2c_adap, read_pwm(budget));
385 if (budget->dvb_frontend) { 392 if (budget->dvb_frontend) {
386 budget->dvb_frontend->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; 393 budget->dvb_frontend->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params;
387 break; 394 break;
@@ -390,7 +397,7 @@ static void frontend_init(struct budget *budget)
390 397
391 case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060)) 398 case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060))
392 399
393 budget->dvb_frontend = l64781_attach(&grundig_29504_401_config, &budget->i2c_adap); 400 budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config, &budget->i2c_adap);
394 if (budget->dvb_frontend) { 401 if (budget->dvb_frontend) {
395 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params; 402 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params;
396 break; 403 break;
@@ -398,7 +405,7 @@ static void frontend_init(struct budget *budget)
398 break; 405 break;
399 406
400 case 0x4f60: // Fujitsu Siemens Activy Budget-S PCI rev AL (stv0299/ALPS BSRU6(tsa5059)) 407 case 0x4f60: // Fujitsu Siemens Activy Budget-S PCI rev AL (stv0299/ALPS BSRU6(tsa5059))
401 budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); 408 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap);
402 if (budget->dvb_frontend) { 409 if (budget->dvb_frontend) {
403 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; 410 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
404 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; 411 budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
@@ -408,7 +415,7 @@ static void frontend_init(struct budget *budget)
408 break; 415 break;
409 416
410 case 0x4f61: // Fujitsu Siemens Activy Budget-S PCI rev GR (tda8083/Grundig 29504-451(tsa5522)) 417 case 0x4f61: // Fujitsu Siemens Activy Budget-S PCI rev GR (tda8083/Grundig 29504-451(tsa5522))
411 budget->dvb_frontend = tda8083_attach(&grundig_29504_451_config, &budget->i2c_adap); 418 budget->dvb_frontend = dvb_attach(tda8083_attach, &grundig_29504_451_config, &budget->i2c_adap);
412 if (budget->dvb_frontend) { 419 if (budget->dvb_frontend) {
413 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; 420 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params;
414 budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage; 421 budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage;
@@ -417,10 +424,28 @@ static void frontend_init(struct budget *budget)
417 break; 424 break;
418 425
419 case 0x1016: // Hauppauge/TT Nova-S SE (samsung s5h1420/????(tda8260)) 426 case 0x1016: // Hauppauge/TT Nova-S SE (samsung s5h1420/????(tda8260))
420 budget->dvb_frontend = s5h1420_attach(&s5h1420_config, &budget->i2c_adap); 427 budget->dvb_frontend = dvb_attach(s5h1420_attach, &s5h1420_config, &budget->i2c_adap);
421 if (budget->dvb_frontend) { 428 if (budget->dvb_frontend) {
422 budget->dvb_frontend->ops.tuner_ops.set_params = s5h1420_tuner_set_params; 429 budget->dvb_frontend->ops.tuner_ops.set_params = s5h1420_tuner_set_params;
423 if (lnbp21_attach(budget->dvb_frontend, &budget->i2c_adap, 0, 0)) { 430 if (dvb_attach(lnbp21_attach, budget->dvb_frontend, &budget->i2c_adap, 0, 0) == NULL) {
431 printk("%s: No LNBP21 found!\n", __FUNCTION__);
432 goto error_out;
433 }
434 break;
435 }
436
437 case 0x1018: // TT Budget-S-1401 (philips tda10086/philips tda8262)
438 // gpio2 is connected to CLB - reset it + leave it high
439 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTLO);
440 msleep(1);
441 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTHI);
442 msleep(1);
443
444 budget->dvb_frontend = dvb_attach(tda10086_attach, &tda10086_config, &budget->i2c_adap);
445 if (budget->dvb_frontend) {
446 if (dvb_attach(tda826x_attach, budget->dvb_frontend, 0x60, &budget->i2c_adap, 0) == NULL)
447 printk("%s: No tda826x found!\n", __FUNCTION__);
448 if (dvb_attach(lnbp21_attach, budget->dvb_frontend, &budget->i2c_adap, 0, 0) == NULL) {
424 printk("%s: No LNBP21 found!\n", __FUNCTION__); 449 printk("%s: No LNBP21 found!\n", __FUNCTION__);
425 goto error_out; 450 goto error_out;
426 } 451 }
@@ -442,8 +467,7 @@ static void frontend_init(struct budget *budget)
442 467
443error_out: 468error_out:
444 printk("budget: Frontend registration failed!\n"); 469 printk("budget: Frontend registration failed!\n");
445 if (budget->dvb_frontend->ops.release) 470 dvb_frontend_detach(budget->dvb_frontend);
446 budget->dvb_frontend->ops.release(budget->dvb_frontend);
447 budget->dvb_frontend = NULL; 471 budget->dvb_frontend = NULL;
448 return; 472 return;
449} 473}
@@ -481,7 +505,10 @@ static int budget_detach (struct saa7146_dev* dev)
481 struct budget *budget = (struct budget*) dev->ext_priv; 505 struct budget *budget = (struct budget*) dev->ext_priv;
482 int err; 506 int err;
483 507
484 if (budget->dvb_frontend) dvb_unregister_frontend(budget->dvb_frontend); 508 if (budget->dvb_frontend) {
509 dvb_unregister_frontend(budget->dvb_frontend);
510 dvb_frontend_detach(budget->dvb_frontend);
511 }
485 512
486 err = ttpci_budget_deinit (budget); 513 err = ttpci_budget_deinit (budget);
487 514
@@ -497,6 +524,7 @@ MAKE_BUDGET_INFO(ttbs, "TT-Budget/WinTV-NOVA-S PCI", BUDGET_TT);
497MAKE_BUDGET_INFO(ttbc, "TT-Budget/WinTV-NOVA-C PCI", BUDGET_TT); 524MAKE_BUDGET_INFO(ttbc, "TT-Budget/WinTV-NOVA-C PCI", BUDGET_TT);
498MAKE_BUDGET_INFO(ttbt, "TT-Budget/WinTV-NOVA-T PCI", BUDGET_TT); 525MAKE_BUDGET_INFO(ttbt, "TT-Budget/WinTV-NOVA-T PCI", BUDGET_TT);
499MAKE_BUDGET_INFO(satel, "SATELCO Multimedia PCI", BUDGET_TT_HW_DISEQC); 526MAKE_BUDGET_INFO(satel, "SATELCO Multimedia PCI", BUDGET_TT_HW_DISEQC);
527MAKE_BUDGET_INFO(ttbs1401, "TT-Budget-S-1401 PCI", BUDGET_TT);
500MAKE_BUDGET_INFO(fsacs0, "Fujitsu Siemens Activy Budget-S PCI (rev GR/grundig frontend)", BUDGET_FS_ACTIVY); 528MAKE_BUDGET_INFO(fsacs0, "Fujitsu Siemens Activy Budget-S PCI (rev GR/grundig frontend)", BUDGET_FS_ACTIVY);
501MAKE_BUDGET_INFO(fsacs1, "Fujitsu Siemens Activy Budget-S PCI (rev AL/alps frontend)", BUDGET_FS_ACTIVY); 529MAKE_BUDGET_INFO(fsacs1, "Fujitsu Siemens Activy Budget-S PCI (rev AL/alps frontend)", BUDGET_FS_ACTIVY);
502 530
@@ -506,6 +534,7 @@ static struct pci_device_id pci_tbl[] = {
506 MAKE_EXTENSION_PCI(ttbt, 0x13c2, 0x1005), 534 MAKE_EXTENSION_PCI(ttbt, 0x13c2, 0x1005),
507 MAKE_EXTENSION_PCI(satel, 0x13c2, 0x1013), 535 MAKE_EXTENSION_PCI(satel, 0x13c2, 0x1013),
508 MAKE_EXTENSION_PCI(ttbs, 0x13c2, 0x1016), 536 MAKE_EXTENSION_PCI(ttbs, 0x13c2, 0x1016),
537 MAKE_EXTENSION_PCI(ttbs1401, 0x13c2, 0x1018),
509 MAKE_EXTENSION_PCI(fsacs1,0x1131, 0x4f60), 538 MAKE_EXTENSION_PCI(fsacs1,0x1131, 0x4f60),
510 MAKE_EXTENSION_PCI(fsacs0,0x1131, 0x4f61), 539 MAKE_EXTENSION_PCI(fsacs0,0x1131, 0x4f61),
511 { 540 {
@@ -516,7 +545,7 @@ static struct pci_device_id pci_tbl[] = {
516MODULE_DEVICE_TABLE(pci, pci_tbl); 545MODULE_DEVICE_TABLE(pci, pci_tbl);
517 546
518static struct saa7146_extension budget_extension = { 547static struct saa7146_extension budget_extension = {
519 .name = "budget dvb\0", 548 .name = "budget dvb",
520 .flags = SAA7146_I2C_SHORT_DELAY, 549 .flags = SAA7146_I2C_SHORT_DELAY,
521 550
522 .module = THIS_MODULE, 551 .module = THIS_MODULE,