summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorAbylay Ospan <aospan@netup.ru>2016-05-13 23:08:40 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-06-07 11:16:37 -0400
commit3f3b48a0c6caba3b1a16a79d6a75a6ea4eac6b9c (patch)
treeea84466b66190941b0dc6abeb925a2a094d92fd9 /drivers/media/pci
parent6c77161a18baa506bd5343c98764789146b72b7a (diff)
[media] Change frontend allocation strategy for NetUP Universal DVB cards
Old behaviour: frontend0 - DVB-S/S2 frontend1 - DVB-T/T2 frontend2 - DVB-C frontend3 - ISDB-T New behaviour (DVBv5 API compliant): frontend0 - DVB-S/S2 frontend1 - DVB-T/T2/C/ISDB-T DTV standard should be selected by DTV_DELIVERY_SYSTEM call. And DVB-C default bandwidth now 8MHz Signed-off-by: Abylay Ospan <aospan@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/netup_unidvb/netup_unidvb_core.c66
1 files changed, 7 insertions, 59 deletions
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
index 950092344eb3..d278d4e151a0 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
@@ -385,18 +385,15 @@ static int netup_unidvb_queue_init(struct netup_dma *dma,
385static int netup_unidvb_dvb_init(struct netup_unidvb_dev *ndev, 385static int netup_unidvb_dvb_init(struct netup_unidvb_dev *ndev,
386 int num) 386 int num)
387{ 387{
388 int fe_count = 0; 388 int fe_count = 2;
389 int i = 0; 389 int i = 0;
390 struct vb2_dvb_frontend *fes[4]; 390 struct vb2_dvb_frontend *fes[2];
391 u8 fe_name[32]; 391 u8 fe_name[32];
392 392
393 if (ndev->rev == NETUP_HW_REV_1_3) { 393 if (ndev->rev == NETUP_HW_REV_1_3)
394 fe_count = 3;
395 demod_config.xtal = SONY_XTAL_20500; 394 demod_config.xtal = SONY_XTAL_20500;
396 } else { 395 else
397 fe_count = 4;
398 demod_config.xtal = SONY_XTAL_24000; 396 demod_config.xtal = SONY_XTAL_24000;
399 }
400 397
401 if (num < 0 || num > 1) { 398 if (num < 0 || num > 1) {
402 dev_dbg(&ndev->pci_dev->dev, 399 dev_dbg(&ndev->pci_dev->dev,
@@ -469,11 +466,11 @@ static int netup_unidvb_dvb_init(struct netup_unidvb_dev *ndev,
469 } 466 }
470 467
471 /* DVB-T/T2 frontend */ 468 /* DVB-T/T2 frontend */
472 fes[1]->dvb.frontend = dvb_attach(cxd2841er_attach_t, 469 fes[1]->dvb.frontend = dvb_attach(cxd2841er_attach_t_c,
473 &demod_config, &ndev->i2c[num].adap); 470 &demod_config, &ndev->i2c[num].adap);
474 if (fes[1]->dvb.frontend == NULL) { 471 if (fes[1]->dvb.frontend == NULL) {
475 dev_dbg(&ndev->pci_dev->dev, 472 dev_dbg(&ndev->pci_dev->dev,
476 "%s(): unable to attach DVB-T frontend\n", __func__); 473 "%s(): unable to attach Ter frontend\n", __func__);
477 goto frontend_detach; 474 goto frontend_detach;
478 } 475 }
479 fes[1]->dvb.frontend->id = 1; 476 fes[1]->dvb.frontend->id = 1;
@@ -482,7 +479,7 @@ static int netup_unidvb_dvb_init(struct netup_unidvb_dev *ndev,
482 if (!dvb_attach(ascot2e_attach, fes[1]->dvb.frontend, 479 if (!dvb_attach(ascot2e_attach, fes[1]->dvb.frontend,
483 &ascot2e_conf, &ndev->i2c[num].adap)) { 480 &ascot2e_conf, &ndev->i2c[num].adap)) {
484 dev_dbg(&ndev->pci_dev->dev, 481 dev_dbg(&ndev->pci_dev->dev,
485 "%s(): unable to attach DVB-T tuner frontend\n", 482 "%s(): unable to attach Ter tuner frontend\n",
486 __func__); 483 __func__);
487 goto frontend_detach; 484 goto frontend_detach;
488 } 485 }
@@ -491,55 +488,6 @@ static int netup_unidvb_dvb_init(struct netup_unidvb_dev *ndev,
491 if (!dvb_attach(helene_attach, fes[1]->dvb.frontend, 488 if (!dvb_attach(helene_attach, fes[1]->dvb.frontend,
492 &helene_conf, &ndev->i2c[num].adap)) { 489 &helene_conf, &ndev->i2c[num].adap)) {
493 dev_err(&ndev->pci_dev->dev, 490 dev_err(&ndev->pci_dev->dev,
494 "%s(): unable to attach HELENE DVB-T/T2 tuner frontend\n",
495 __func__);
496 goto frontend_detach;
497 }
498 }
499
500 /* DVB-C/C2 frontend */
501 fes[2]->dvb.frontend = dvb_attach(cxd2841er_attach_c,
502 &demod_config, &ndev->i2c[num].adap);
503 if (fes[2]->dvb.frontend == NULL) {
504 dev_dbg(&ndev->pci_dev->dev,
505 "%s(): unable to attach DVB-C frontend\n", __func__);
506 goto frontend_detach;
507 }
508 fes[2]->dvb.frontend->id = 2;
509 if (ndev->rev == NETUP_HW_REV_1_3) {
510 if (!dvb_attach(ascot2e_attach, fes[2]->dvb.frontend,
511 &ascot2e_conf, &ndev->i2c[num].adap)) {
512 dev_dbg(&ndev->pci_dev->dev,
513 "%s(): unable to attach DVB-T/C tuner frontend\n",
514 __func__);
515 goto frontend_detach;
516 }
517 } else {
518 helene_conf.set_tuner_priv = &ndev->dma[num];
519 if (!dvb_attach(helene_attach, fes[2]->dvb.frontend,
520 &helene_conf, &ndev->i2c[num].adap)) {
521 dev_err(&ndev->pci_dev->dev,
522 "%s(): unable to attach HELENE Ter tuner frontend\n",
523 __func__);
524 goto frontend_detach;
525 }
526 }
527
528 if (ndev->rev == NETUP_HW_REV_1_4) {
529 /* ISDB-T frontend */
530 fes[3]->dvb.frontend = dvb_attach(cxd2841er_attach_i,
531 &demod_config, &ndev->i2c[num].adap);
532 if (fes[3]->dvb.frontend == NULL) {
533 dev_dbg(&ndev->pci_dev->dev,
534 "%s(): unable to attach ISDB-T frontend\n",
535 __func__);
536 goto frontend_detach;
537 }
538 fes[3]->dvb.frontend->id = 3;
539 helene_conf.set_tuner_priv = &ndev->dma[num];
540 if (!dvb_attach(helene_attach, fes[3]->dvb.frontend,
541 &helene_conf, &ndev->i2c[num].adap)) {
542 dev_err(&ndev->pci_dev->dev,
543 "%s(): unable to attach HELENE Ter tuner frontend\n", 491 "%s(): unable to attach HELENE Ter tuner frontend\n",
544 __func__); 492 __func__);
545 goto frontend_detach; 493 goto frontend_detach;