diff options
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/b2c2/flexcop-fe-tuner.c | 26 | ||||
-rw-r--r-- | drivers/media/dvb/bt8xx/dst.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/bt8xx/dst_ca.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/bt8xx/dst_common.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/bt8xx/dvb-bt8xx.c | 36 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/cxusb.c | 10 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/digitv.c | 4 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-dvb.c | 11 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/umt-010.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/dvb-pll.c | 8 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/dvb-pll.h | 4 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/av7110.c | 39 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget-av.c | 37 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget-ci.c | 25 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget-patch.c | 19 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget.c | 26 | ||||
-rw-r--r-- | drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 26 | ||||
-rw-r--r-- | drivers/media/dvb/ttusb-dec/ttusb_dec.c | 6 |
18 files changed, 171 insertions, 118 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c index 816e700ae14b..e2d2e65dea52 100644 --- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c +++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c | |||
@@ -505,7 +505,7 @@ int flexcop_frontend_init(struct flexcop_device *fc) | |||
505 | struct dvb_frontend_ops *ops; | 505 | struct dvb_frontend_ops *ops; |
506 | 506 | ||
507 | /* try the sky v2.6 (stv0299/Samsung tbmu24112(sl1935)) */ | 507 | /* try the sky v2.6 (stv0299/Samsung tbmu24112(sl1935)) */ |
508 | if ((fc->fe = stv0299_attach(&samsung_tbmu24112_config, &fc->i2c_adap)) != NULL) { | 508 | if ((fc->fe = dvb_attach(stv0299_attach, &samsung_tbmu24112_config, &fc->i2c_adap)) != NULL) { |
509 | ops = &fc->fe->ops; | 509 | ops = &fc->fe->ops; |
510 | 510 | ||
511 | ops->tuner_ops.set_params = samsung_tbmu24112_tuner_set_params; | 511 | ops->tuner_ops.set_params = samsung_tbmu24112_tuner_set_params; |
@@ -519,36 +519,36 @@ int flexcop_frontend_init(struct flexcop_device *fc) | |||
519 | info("found the stv0299 at i2c address: 0x%02x",samsung_tbmu24112_config.demod_address); | 519 | info("found the stv0299 at i2c address: 0x%02x",samsung_tbmu24112_config.demod_address); |
520 | } else | 520 | } else |
521 | /* try the air dvb-t (mt352/Samsung tdtc9251dh0(??)) */ | 521 | /* try the air dvb-t (mt352/Samsung tdtc9251dh0(??)) */ |
522 | if ((fc->fe = mt352_attach(&samsung_tdtc9251dh0_config, &fc->i2c_adap)) != NULL ) { | 522 | if ((fc->fe = dvb_attach(mt352_attach, &samsung_tdtc9251dh0_config, &fc->i2c_adap)) != NULL ) { |
523 | fc->dev_type = FC_AIR_DVB; | 523 | fc->dev_type = FC_AIR_DVB; |
524 | fc->fe->ops.tuner_ops.calc_regs = samsung_tdtc9251dh0_calc_regs; | 524 | fc->fe->ops.tuner_ops.calc_regs = samsung_tdtc9251dh0_calc_regs; |
525 | info("found the mt352 at i2c address: 0x%02x",samsung_tdtc9251dh0_config.demod_address); | 525 | info("found the mt352 at i2c address: 0x%02x",samsung_tdtc9251dh0_config.demod_address); |
526 | } else | 526 | } else |
527 | /* try the air atsc 2nd generation (nxt2002) */ | 527 | /* try the air atsc 2nd generation (nxt2002) */ |
528 | if ((fc->fe = nxt200x_attach(&samsung_tbmv_config, &fc->i2c_adap)) != NULL) { | 528 | if ((fc->fe = dvb_attach(nxt200x_attach, &samsung_tbmv_config, &fc->i2c_adap)) != NULL) { |
529 | fc->dev_type = FC_AIR_ATSC2; | 529 | fc->dev_type = FC_AIR_ATSC2; |
530 | dvb_attach(dvb_pll_attach, fc->fe, 0x61, &fc->i2c_adap, &dvb_pll_samsung_tbmv); | 530 | dvb_attach(dvb_pll_attach, fc->fe, 0x61, &fc->i2c_adap, &dvb_pll_samsung_tbmv); |
531 | info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address); | 531 | info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address); |
532 | } else | 532 | } else |
533 | /* try the air atsc 3nd generation (lgdt3303) */ | 533 | /* try the air atsc 3nd generation (lgdt3303) */ |
534 | if ((fc->fe = lgdt330x_attach(&air2pc_atsc_hd5000_config, &fc->i2c_adap)) != NULL) { | 534 | if ((fc->fe = dvb_attach(lgdt330x_attach, &air2pc_atsc_hd5000_config, &fc->i2c_adap)) != NULL) { |
535 | fc->dev_type = FC_AIR_ATSC3; | 535 | fc->dev_type = FC_AIR_ATSC3; |
536 | fc->fe->ops.tuner_ops.set_params = lgdt3303_tuner_set_params; | 536 | fc->fe->ops.tuner_ops.set_params = lgdt3303_tuner_set_params; |
537 | info("found the lgdt3303 at i2c address: 0x%02x",air2pc_atsc_hd5000_config.demod_address); | 537 | info("found the lgdt3303 at i2c address: 0x%02x",air2pc_atsc_hd5000_config.demod_address); |
538 | } else | 538 | } else |
539 | /* try the air atsc 1nd generation (bcm3510)/panasonic ct10s */ | 539 | /* try the air atsc 1nd generation (bcm3510)/panasonic ct10s */ |
540 | if ((fc->fe = bcm3510_attach(&air2pc_atsc_first_gen_config, &fc->i2c_adap)) != NULL) { | 540 | if ((fc->fe = dvb_attach(bcm3510_attach, &air2pc_atsc_first_gen_config, &fc->i2c_adap)) != NULL) { |
541 | fc->dev_type = FC_AIR_ATSC1; | 541 | fc->dev_type = FC_AIR_ATSC1; |
542 | info("found the bcm3510 at i2c address: 0x%02x",air2pc_atsc_first_gen_config.demod_address); | 542 | info("found the bcm3510 at i2c address: 0x%02x",air2pc_atsc_first_gen_config.demod_address); |
543 | } else | 543 | } else |
544 | /* try the cable dvb (stv0297) */ | 544 | /* try the cable dvb (stv0297) */ |
545 | if ((fc->fe = stv0297_attach(&alps_tdee4_stv0297_config, &fc->i2c_adap)) != NULL) { | 545 | if ((fc->fe = dvb_attach(stv0297_attach, &alps_tdee4_stv0297_config, &fc->i2c_adap)) != NULL) { |
546 | fc->dev_type = FC_CABLE; | 546 | fc->dev_type = FC_CABLE; |
547 | fc->fe->ops.tuner_ops.set_params = alps_tdee4_stv0297_tuner_set_params; | 547 | fc->fe->ops.tuner_ops.set_params = alps_tdee4_stv0297_tuner_set_params; |
548 | info("found the stv0297 at i2c address: 0x%02x",alps_tdee4_stv0297_config.demod_address); | 548 | info("found the stv0297 at i2c address: 0x%02x",alps_tdee4_stv0297_config.demod_address); |
549 | } else | 549 | } else |
550 | /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */ | 550 | /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */ |
551 | if ((fc->fe = vp310_mt312_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) { | 551 | if ((fc->fe = dvb_attach(vp310_mt312_attach, &skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) { |
552 | ops = &fc->fe->ops; | 552 | ops = &fc->fe->ops; |
553 | 553 | ||
554 | ops->tuner_ops.set_params = skystar23_samsung_tbdu18132_tuner_set_params; | 554 | ops->tuner_ops.set_params = skystar23_samsung_tbdu18132_tuner_set_params; |
@@ -571,9 +571,9 @@ int flexcop_frontend_init(struct flexcop_device *fc) | |||
571 | } else { | 571 | } else { |
572 | if (dvb_register_frontend(&fc->dvb_adapter, fc->fe)) { | 572 | if (dvb_register_frontend(&fc->dvb_adapter, fc->fe)) { |
573 | err("frontend registration failed!"); | 573 | err("frontend registration failed!"); |
574 | ops = &fc->fe->ops; | 574 | dvb_detach(fc->fe->ops.release_sec, fc->fe); |
575 | if (ops->release != NULL) | 575 | dvb_detach(fc->fe->ops.tuner_ops.release, fc->fe); |
576 | ops->release(fc->fe); | 576 | dvb_detach(fc->fe->ops.release, fc->fe); |
577 | fc->fe = NULL; | 577 | fc->fe = NULL; |
578 | return -EINVAL; | 578 | return -EINVAL; |
579 | } | 579 | } |
@@ -584,8 +584,12 @@ int flexcop_frontend_init(struct flexcop_device *fc) | |||
584 | 584 | ||
585 | void flexcop_frontend_exit(struct flexcop_device *fc) | 585 | void flexcop_frontend_exit(struct flexcop_device *fc) |
586 | { | 586 | { |
587 | if (fc->init_state & FC_STATE_FE_INIT) | 587 | if (fc->init_state & FC_STATE_FE_INIT) { |
588 | dvb_unregister_frontend(fc->fe); | 588 | dvb_unregister_frontend(fc->fe); |
589 | dvb_detach(fc->fe->ops.release_sec, fc->fe); | ||
590 | dvb_detach(fc->fe->ops.tuner_ops.release, fc->fe); | ||
591 | dvb_detach(fc->fe->ops.release, fc->fe); | ||
592 | } | ||
589 | 593 | ||
590 | fc->init_state &= ~FC_STATE_FE_INIT; | 594 | fc->init_state &= ~FC_STATE_FE_INIT; |
591 | } | 595 | } |
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c index 06ac899a9a26..91dea91b1a43 100644 --- a/drivers/media/dvb/bt8xx/dst.c +++ b/drivers/media/dvb/bt8xx/dst.c | |||
@@ -1715,6 +1715,10 @@ static int dst_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_paramet | |||
1715 | static void dst_release(struct dvb_frontend *fe) | 1715 | static void dst_release(struct dvb_frontend *fe) |
1716 | { | 1716 | { |
1717 | struct dst_state *state = fe->demodulator_priv; | 1717 | struct dst_state *state = fe->demodulator_priv; |
1718 | |||
1719 | if (state->dst_hw_cap & DST_TYPE_HAS_CA) | ||
1720 | symbol_put(dst_ca_attach); | ||
1721 | |||
1718 | kfree(state); | 1722 | kfree(state); |
1719 | } | 1723 | } |
1720 | 1724 | ||
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c index fa923b9b346e..c4ff1abc15c3 100644 --- a/drivers/media/dvb/bt8xx/dst_ca.c +++ b/drivers/media/dvb/bt8xx/dst_ca.c | |||
@@ -699,12 +699,12 @@ static struct dvb_device dvbdev_ca = { | |||
699 | .fops = &dst_ca_fops | 699 | .fops = &dst_ca_fops |
700 | }; | 700 | }; |
701 | 701 | ||
702 | int dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter) | 702 | ssize_t dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter) |
703 | { | 703 | { |
704 | struct dvb_device *dvbdev; | 704 | struct dvb_device *dvbdev; |
705 | dprintk(verbose, DST_CA_ERROR, 1, "registering DST-CA device"); | 705 | dprintk(verbose, DST_CA_ERROR, 1, "registering DST-CA device"); |
706 | dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst, DVB_DEVICE_CA); | 706 | dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst, DVB_DEVICE_CA); |
707 | return 0; | 707 | return 1; // must return non-zero for dvb_attach() to work |
708 | } | 708 | } |
709 | 709 | ||
710 | EXPORT_SYMBOL(dst_ca_attach); | 710 | EXPORT_SYMBOL(dst_ca_attach); |
diff --git a/drivers/media/dvb/bt8xx/dst_common.h b/drivers/media/dvb/bt8xx/dst_common.h index 0677b047b3a7..383452f9e497 100644 --- a/drivers/media/dvb/bt8xx/dst_common.h +++ b/drivers/media/dvb/bt8xx/dst_common.h | |||
@@ -178,7 +178,7 @@ int write_dst(struct dst_state *state, u8 * data, u8 len); | |||
178 | int read_dst(struct dst_state *state, u8 * ret, u8 len); | 178 | int read_dst(struct dst_state *state, u8 * ret, u8 len); |
179 | u8 dst_check_sum(u8 * buf, u32 len); | 179 | u8 dst_check_sum(u8 * buf, u32 len); |
180 | struct dst_state* dst_attach(struct dst_state* state, struct dvb_adapter *dvb_adapter); | 180 | struct dst_state* dst_attach(struct dst_state* state, struct dvb_adapter *dvb_adapter); |
181 | int dst_ca_attach(struct dst_state *state, struct dvb_adapter *dvb_adapter); | 181 | ssize_t dst_ca_attach(struct dst_state *state, struct dvb_adapter *dvb_adapter); |
182 | int dst_gpio_outb(struct dst_state* state, u32 mask, u32 enbb, u32 outhigh, int delay); | 182 | int dst_gpio_outb(struct dst_state* state, u32 mask, u32 enbb, u32 outhigh, int delay); |
183 | 183 | ||
184 | int dst_command(struct dst_state* state, u8 * data, u8 len); | 184 | int dst_command(struct dst_state* state, u8 * data, u8 len); |
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index b715b972d2fc..6f0bb7360991 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -67,7 +67,7 @@ static void dvb_bt8xx_task(unsigned long data) | |||
67 | 67 | ||
68 | static int dvb_bt8xx_start_feed(struct dvb_demux_feed *dvbdmxfeed) | 68 | static int dvb_bt8xx_start_feed(struct dvb_demux_feed *dvbdmxfeed) |
69 | { | 69 | { |
70 | struct dvb_demux *dvbdmx = dvbdmxfeed->demux; | 70 | struct dvb_demux*dvbdmx = dvbdmxfeed->demux; |
71 | struct dvb_bt8xx_card *card = dvbdmx->priv; | 71 | struct dvb_bt8xx_card *card = dvbdmx->priv; |
72 | int rc; | 72 | int rc; |
73 | 73 | ||
@@ -595,15 +595,14 @@ static void lgdt330x_reset(struct dvb_bt8xx_card *bt) | |||
595 | 595 | ||
596 | static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | 596 | static void frontend_init(struct dvb_bt8xx_card *card, u32 type) |
597 | { | 597 | { |
598 | int ret; | ||
599 | struct dst_state* state = NULL; | 598 | struct dst_state* state = NULL; |
600 | 599 | ||
601 | switch(type) { | 600 | switch(type) { |
602 | case BTTV_BOARD_DVICO_DVBT_LITE: | 601 | case BTTV_BOARD_DVICO_DVBT_LITE: |
603 | card->fe = mt352_attach(&thomson_dtt7579_config, card->i2c_adapter); | 602 | card->fe = dvb_attach(mt352_attach, &thomson_dtt7579_config, card->i2c_adapter); |
604 | 603 | ||
605 | if (card->fe == NULL) | 604 | if (card->fe == NULL) |
606 | card->fe = zl10353_attach(&thomson_dtt7579_zl10353_config, | 605 | card->fe = dvb_attach(zl10353_attach, &thomson_dtt7579_zl10353_config, |
607 | card->i2c_adapter); | 606 | card->i2c_adapter); |
608 | 607 | ||
609 | if (card->fe != NULL) { | 608 | if (card->fe != NULL) { |
@@ -615,7 +614,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
615 | 614 | ||
616 | case BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE: | 615 | case BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE: |
617 | lgdt330x_reset(card); | 616 | lgdt330x_reset(card); |
618 | card->fe = lgdt330x_attach(&tdvs_tua6034_config, card->i2c_adapter); | 617 | card->fe = dvb_attach(lgdt330x_attach, &tdvs_tua6034_config, card->i2c_adapter); |
619 | if (card->fe != NULL) { | 618 | if (card->fe != NULL) { |
620 | card->fe->ops.tuner_ops.set_params = tdvs_tua6034_tuner_set_params; | 619 | card->fe->ops.tuner_ops.set_params = tdvs_tua6034_tuner_set_params; |
621 | dprintk ("dvb_bt8xx: lgdt330x detected\n"); | 620 | dprintk ("dvb_bt8xx: lgdt330x detected\n"); |
@@ -630,7 +629,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
630 | 629 | ||
631 | /* Old Nebula (marked (c)2003 on high profile pci card) has nxt6000 demod */ | 630 | /* Old Nebula (marked (c)2003 on high profile pci card) has nxt6000 demod */ |
632 | digitv_alps_tded4_reset(card); | 631 | digitv_alps_tded4_reset(card); |
633 | card->fe = nxt6000_attach(&vp3021_alps_tded4_config, card->i2c_adapter); | 632 | card->fe = dvb_attach(nxt6000_attach, &vp3021_alps_tded4_config, card->i2c_adapter); |
634 | if (card->fe != NULL) { | 633 | if (card->fe != NULL) { |
635 | card->fe->ops.tuner_ops.set_params = vp3021_alps_tded4_tuner_set_params; | 634 | card->fe->ops.tuner_ops.set_params = vp3021_alps_tded4_tuner_set_params; |
636 | dprintk ("dvb_bt8xx: an nxt6000 was detected on your digitv card\n"); | 635 | dprintk ("dvb_bt8xx: an nxt6000 was detected on your digitv card\n"); |
@@ -639,7 +638,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
639 | 638 | ||
640 | /* New Nebula (marked (c)2005 on low profile pci card) has mt352 demod */ | 639 | /* New Nebula (marked (c)2005 on low profile pci card) has mt352 demod */ |
641 | digitv_alps_tded4_reset(card); | 640 | digitv_alps_tded4_reset(card); |
642 | card->fe = mt352_attach(&digitv_alps_tded4_config, card->i2c_adapter); | 641 | card->fe = dvb_attach(mt352_attach, &digitv_alps_tded4_config, card->i2c_adapter); |
643 | 642 | ||
644 | if (card->fe != NULL) { | 643 | if (card->fe != NULL) { |
645 | card->fe->ops.tuner_ops.calc_regs = digitv_alps_tded4_tuner_calc_regs; | 644 | card->fe->ops.tuner_ops.calc_regs = digitv_alps_tded4_tuner_calc_regs; |
@@ -648,14 +647,14 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
648 | break; | 647 | break; |
649 | 648 | ||
650 | case BTTV_BOARD_AVDVBT_761: | 649 | case BTTV_BOARD_AVDVBT_761: |
651 | card->fe = sp887x_attach(µtune_mt7202dtf_config, card->i2c_adapter); | 650 | card->fe = dvb_attach(sp887x_attach, µtune_mt7202dtf_config, card->i2c_adapter); |
652 | if (card->fe) { | 651 | if (card->fe) { |
653 | card->fe->ops.tuner_ops.set_params = microtune_mt7202dtf_tuner_set_params; | 652 | card->fe->ops.tuner_ops.set_params = microtune_mt7202dtf_tuner_set_params; |
654 | } | 653 | } |
655 | break; | 654 | break; |
656 | 655 | ||
657 | case BTTV_BOARD_AVDVBT_771: | 656 | case BTTV_BOARD_AVDVBT_771: |
658 | card->fe = mt352_attach(&advbt771_samsung_tdtc9251dh0_config, card->i2c_adapter); | 657 | card->fe = dvb_attach(mt352_attach, &advbt771_samsung_tdtc9251dh0_config, card->i2c_adapter); |
659 | if (card->fe != NULL) { | 658 | if (card->fe != NULL) { |
660 | card->fe->ops.tuner_ops.calc_regs = advbt771_samsung_tdtc9251dh0_tuner_calc_regs; | 659 | card->fe->ops.tuner_ops.calc_regs = advbt771_samsung_tdtc9251dh0_tuner_calc_regs; |
661 | card->fe->ops.info.frequency_min = 174000000; | 660 | card->fe->ops.info.frequency_min = 174000000; |
@@ -672,7 +671,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
672 | state->bt = card->bt; | 671 | state->bt = card->bt; |
673 | 672 | ||
674 | /* DST is not a frontend, attaching the ASIC */ | 673 | /* DST is not a frontend, attaching the ASIC */ |
675 | if ((dst_attach(state, &card->dvb_adapter)) == NULL) { | 674 | if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) { |
676 | printk("%s: Could not find a Twinhan DST.\n", __FUNCTION__); | 675 | printk("%s: Could not find a Twinhan DST.\n", __FUNCTION__); |
677 | break; | 676 | break; |
678 | } | 677 | } |
@@ -681,11 +680,11 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
681 | /* Attach other DST peripherals if any */ | 680 | /* Attach other DST peripherals if any */ |
682 | /* Conditional Access device */ | 681 | /* Conditional Access device */ |
683 | if (state->dst_hw_cap & DST_TYPE_HAS_CA) | 682 | if (state->dst_hw_cap & DST_TYPE_HAS_CA) |
684 | ret = dst_ca_attach(state, &card->dvb_adapter); | 683 | dvb_attach(dst_ca_attach, state, &card->dvb_adapter); |
685 | break; | 684 | break; |
686 | 685 | ||
687 | case BTTV_BOARD_PINNACLESAT: | 686 | case BTTV_BOARD_PINNACLESAT: |
688 | card->fe = cx24110_attach(&pctvsat_config, card->i2c_adapter); | 687 | card->fe = dvb_attach(cx24110_attach, &pctvsat_config, card->i2c_adapter); |
689 | if (card->fe) { | 688 | if (card->fe) { |
690 | card->fe->ops.tuner_ops.init = pinnsat_tuner_init; | 689 | card->fe->ops.tuner_ops.init = pinnsat_tuner_init; |
691 | card->fe->ops.tuner_ops.sleep = pinnsat_tuner_sleep; | 690 | card->fe->ops.tuner_ops.sleep = pinnsat_tuner_sleep; |
@@ -694,7 +693,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
694 | break; | 693 | break; |
695 | 694 | ||
696 | case BTTV_BOARD_PC_HDTV: | 695 | case BTTV_BOARD_PC_HDTV: |
697 | card->fe = or51211_attach(&or51211_config, card->i2c_adapter); | 696 | card->fe = dvb_attach(or51211_attach, &or51211_config, card->i2c_adapter); |
698 | break; | 697 | break; |
699 | } | 698 | } |
700 | 699 | ||
@@ -707,8 +706,9 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
707 | else | 706 | else |
708 | if (dvb_register_frontend(&card->dvb_adapter, card->fe)) { | 707 | if (dvb_register_frontend(&card->dvb_adapter, card->fe)) { |
709 | printk("dvb-bt8xx: Frontend registration failed!\n"); | 708 | printk("dvb-bt8xx: Frontend registration failed!\n"); |
710 | if (card->fe->ops.release) | 709 | dvb_detach(card->fe->ops.release_sec, card->fe); |
711 | card->fe->ops.release(card->fe); | 710 | dvb_detach(card->fe->ops.tuner_ops.release, card->fe); |
711 | dvb_detach(card->fe->ops.release, card->fe); | ||
712 | card->fe = NULL; | 712 | card->fe = NULL; |
713 | } | 713 | } |
714 | } | 714 | } |
@@ -925,8 +925,12 @@ static void dvb_bt8xx_remove(struct bttv_sub_device *sub) | |||
925 | card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw); | 925 | card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw); |
926 | dvb_dmxdev_release(&card->dmxdev); | 926 | dvb_dmxdev_release(&card->dmxdev); |
927 | dvb_dmx_release(&card->demux); | 927 | dvb_dmx_release(&card->demux); |
928 | if (card->fe) | 928 | if (card->fe) { |
929 | dvb_unregister_frontend(card->fe); | 929 | dvb_unregister_frontend(card->fe); |
930 | dvb_detach(card->fe->ops.release_sec, card->fe); | ||
931 | dvb_detach(card->fe->ops.tuner_ops.release, card->fe); | ||
932 | dvb_detach(card->fe->ops.release, card->fe); | ||
933 | } | ||
930 | dvb_unregister_adapter(&card->dvb_adapter); | 934 | dvb_unregister_adapter(&card->dvb_adapter); |
931 | 935 | ||
932 | kfree(card); | 936 | kfree(card); |
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index ae23bdde42a8..ac72e7ed9fcc 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -409,7 +409,7 @@ static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) | |||
409 | 409 | ||
410 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, &b, 1); | 410 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, &b, 1); |
411 | 411 | ||
412 | if ((d->fe = cx22702_attach(&cxusb_cx22702_config, &d->i2c_adap)) != NULL) | 412 | if ((d->fe = dvb_attach(cx22702_attach, &cxusb_cx22702_config, &d->i2c_adap)) != NULL) |
413 | return 0; | 413 | return 0; |
414 | 414 | ||
415 | return -EIO; | 415 | return -EIO; |
@@ -422,7 +422,7 @@ static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_device *d) | |||
422 | 422 | ||
423 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); | 423 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); |
424 | 424 | ||
425 | if ((d->fe = lgdt330x_attach(&cxusb_lgdt3303_config, &d->i2c_adap)) != NULL) | 425 | if ((d->fe = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config, &d->i2c_adap)) != NULL) |
426 | return 0; | 426 | return 0; |
427 | 427 | ||
428 | return -EIO; | 428 | return -EIO; |
@@ -435,7 +435,7 @@ static int cxusb_mt352_frontend_attach(struct dvb_usb_device *d) | |||
435 | 435 | ||
436 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); | 436 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); |
437 | 437 | ||
438 | if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL) | 438 | if ((d->fe = dvb_attach(mt352_attach, &cxusb_mt352_config, &d->i2c_adap)) != NULL) |
439 | return 0; | 439 | return 0; |
440 | 440 | ||
441 | return -EIO; | 441 | return -EIO; |
@@ -448,8 +448,8 @@ static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d) | |||
448 | 448 | ||
449 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); | 449 | cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); |
450 | 450 | ||
451 | if (((d->fe = mt352_attach(&cxusb_dee1601_config, &d->i2c_adap)) != NULL) || | 451 | if (((d->fe = dvb_attach(mt352_attach, &cxusb_dee1601_config, &d->i2c_adap)) != NULL) || |
452 | ((d->fe = zl10353_attach(&cxusb_zl10353_dee1601_config, &d->i2c_adap)) != NULL)) | 452 | ((d->fe = dvb_attach(zl10353_attach, &cxusb_zl10353_dee1601_config, &d->i2c_adap)) != NULL)) |
453 | return 0; | 453 | return 0; |
454 | 454 | ||
455 | return -EIO; | 455 | return -EIO; |
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index c14d9efb48fd..f5cd3a4f82a8 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -128,11 +128,11 @@ static struct nxt6000_config digitv_nxt6000_config = { | |||
128 | 128 | ||
129 | static int digitv_frontend_attach(struct dvb_usb_device *d) | 129 | static int digitv_frontend_attach(struct dvb_usb_device *d) |
130 | { | 130 | { |
131 | if ((d->fe = mt352_attach(&digitv_mt352_config, &d->i2c_adap)) != NULL) { | 131 | if ((d->fe = dvb_attach(mt352_attach, &digitv_mt352_config, &d->i2c_adap)) != NULL) { |
132 | d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; | 132 | d->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs; |
133 | return 0; | 133 | return 0; |
134 | } | 134 | } |
135 | if ((d->fe = nxt6000_attach(&digitv_nxt6000_config, &d->i2c_adap)) != NULL) { | 135 | if ((d->fe = dvb_attach(nxt6000_attach, &digitv_nxt6000_config, &d->i2c_adap)) != NULL) { |
136 | d->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params; | 136 | d->fe->ops.tuner_ops.set_params = digitv_nxt6000_tuner_set_params; |
137 | return 0; | 137 | return 0; |
138 | } | 138 | } |
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c index ec631708c394..f0da15ebe33b 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c | |||
@@ -188,8 +188,9 @@ int dvb_usb_fe_init(struct dvb_usb_device* d) | |||
188 | 188 | ||
189 | if (dvb_register_frontend(&d->dvb_adap, d->fe)) { | 189 | if (dvb_register_frontend(&d->dvb_adap, d->fe)) { |
190 | err("Frontend registration failed."); | 190 | err("Frontend registration failed."); |
191 | if (d->fe->ops.release) | 191 | dvb_detach(d->fe->ops.release_sec, d->fe); |
192 | d->fe->ops.release(d->fe); | 192 | dvb_detach(d->fe->ops.tuner_ops.release, d->fe); |
193 | dvb_detach(d->fe->ops.release, d->fe); | ||
193 | d->fe = NULL; | 194 | d->fe = NULL; |
194 | return -ENODEV; | 195 | return -ENODEV; |
195 | } | 196 | } |
@@ -204,7 +205,11 @@ int dvb_usb_fe_init(struct dvb_usb_device* d) | |||
204 | 205 | ||
205 | int dvb_usb_fe_exit(struct dvb_usb_device *d) | 206 | int dvb_usb_fe_exit(struct dvb_usb_device *d) |
206 | { | 207 | { |
207 | if (d->fe != NULL) | 208 | if (d->fe != NULL) { |
208 | dvb_unregister_frontend(d->fe); | 209 | dvb_unregister_frontend(d->fe); |
210 | dvb_detach(d->fe->ops.release_sec, d->fe); | ||
211 | dvb_detach(d->fe->ops.tuner_ops.release, d->fe); | ||
212 | dvb_detach(d->fe->ops.release, d->fe); | ||
213 | } | ||
209 | return 0; | 214 | return 0; |
210 | } | 215 | } |
diff --git a/drivers/media/dvb/dvb-usb/umt-010.c b/drivers/media/dvb/dvb-usb/umt-010.c index 97d74da0dad8..418a0b707151 100644 --- a/drivers/media/dvb/dvb-usb/umt-010.c +++ b/drivers/media/dvb/dvb-usb/umt-010.c | |||
@@ -58,7 +58,7 @@ static int umt_mt352_frontend_attach(struct dvb_usb_device *d) | |||
58 | umt_config.demod_init = umt_mt352_demod_init; | 58 | umt_config.demod_init = umt_mt352_demod_init; |
59 | umt_config.demod_address = 0xf; | 59 | umt_config.demod_address = 0xf; |
60 | 60 | ||
61 | d->fe = mt352_attach(&umt_config, &d->i2c_adap); | 61 | d->fe = dvb_attach(mt352_attach, &umt_config, &d->i2c_adap); |
62 | 62 | ||
63 | return 0; | 63 | return 0; |
64 | } | 64 | } |
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index 2be33f27c69f..c92877baada2 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c | |||
@@ -611,7 +611,7 @@ static struct dvb_tuner_ops dvb_pll_tuner_ops = { | |||
611 | .get_bandwidth = dvb_pll_get_bandwidth, | 611 | .get_bandwidth = dvb_pll_get_bandwidth, |
612 | }; | 612 | }; |
613 | 613 | ||
614 | int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc) | 614 | struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc) |
615 | { | 615 | { |
616 | u8 b1 [] = { 0 }; | 616 | u8 b1 [] = { 0 }; |
617 | struct i2c_msg msg = { .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 }; | 617 | struct i2c_msg msg = { .addr = pll_addr, .flags = I2C_M_RD, .buf = b1, .len = 1 }; |
@@ -624,14 +624,14 @@ int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2 | |||
624 | 624 | ||
625 | ret = i2c_transfer (i2c, &msg, 1); | 625 | ret = i2c_transfer (i2c, &msg, 1); |
626 | if (ret != 1) | 626 | if (ret != 1) |
627 | return -1; | 627 | return NULL; |
628 | if (fe->ops.i2c_gate_ctrl) | 628 | if (fe->ops.i2c_gate_ctrl) |
629 | fe->ops.i2c_gate_ctrl(fe, 0); | 629 | fe->ops.i2c_gate_ctrl(fe, 0); |
630 | } | 630 | } |
631 | 631 | ||
632 | priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL); | 632 | priv = kzalloc(sizeof(struct dvb_pll_priv), GFP_KERNEL); |
633 | if (priv == NULL) | 633 | if (priv == NULL) |
634 | return -ENOMEM; | 634 | return NULL; |
635 | 635 | ||
636 | priv->pll_i2c_address = pll_addr; | 636 | priv->pll_i2c_address = pll_addr; |
637 | priv->i2c = i2c; | 637 | priv->i2c = i2c; |
@@ -643,7 +643,7 @@ int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2 | |||
643 | fe->ops.tuner_ops.info.frequency_min = desc->max; | 643 | fe->ops.tuner_ops.info.frequency_min = desc->max; |
644 | 644 | ||
645 | fe->tuner_priv = priv; | 645 | fe->tuner_priv = priv; |
646 | return 0; | 646 | return fe; |
647 | } | 647 | } |
648 | EXPORT_SYMBOL(dvb_pll_attach); | 648 | EXPORT_SYMBOL(dvb_pll_attach); |
649 | 649 | ||
diff --git a/drivers/media/dvb/frontends/dvb-pll.h b/drivers/media/dvb/frontends/dvb-pll.h index 66361cd18807..ed5ac5a361ae 100644 --- a/drivers/media/dvb/frontends/dvb-pll.h +++ b/drivers/media/dvb/frontends/dvb-pll.h | |||
@@ -57,8 +57,8 @@ extern int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf, | |||
57 | * @param pll_addr i2c address of the PLL (if used). | 57 | * @param pll_addr i2c address of the PLL (if used). |
58 | * @param i2c i2c adapter to use (set to NULL if not used). | 58 | * @param i2c i2c adapter to use (set to NULL if not used). |
59 | * @param desc dvb_pll_desc to use. | 59 | * @param desc dvb_pll_desc to use. |
60 | * @return 0 on success, nonzero on failure. | 60 | * @return Frontend pointer on success, NULL on failure |
61 | */ | 61 | */ |
62 | extern int dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc); | 62 | extern struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, struct i2c_adapter *i2c, struct dvb_pll_desc *desc); |
63 | 63 | ||
64 | #endif | 64 | #endif |
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index fa0bed6779b5..d195cf591081 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c | |||
@@ -1383,8 +1383,12 @@ static void dvb_unregister(struct av7110 *av7110) | |||
1383 | dvb_dmxdev_release(&av7110->dmxdev); | 1383 | dvb_dmxdev_release(&av7110->dmxdev); |
1384 | dvb_dmx_release(&av7110->demux); | 1384 | dvb_dmx_release(&av7110->demux); |
1385 | 1385 | ||
1386 | if (av7110->fe != NULL) | 1386 | if (av7110->fe != NULL) { |
1387 | dvb_unregister_frontend(av7110->fe); | 1387 | dvb_unregister_frontend(av7110->fe); |
1388 | dvb_detach(av7110->fe->ops.release_sec, av7110->fe); | ||
1389 | dvb_detach(av7110->fe->ops.tuner_ops.release, av7110->fe); | ||
1390 | dvb_detach(av7110->fe->ops.release, av7110->fe); | ||
1391 | } | ||
1388 | dvb_unregister_device(av7110->osd_dev); | 1392 | dvb_unregister_device(av7110->osd_dev); |
1389 | av7110_av_unregister(av7110); | 1393 | av7110_av_unregister(av7110); |
1390 | av7110_ca_unregister(av7110); | 1394 | av7110_ca_unregister(av7110); |
@@ -2077,7 +2081,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2077 | if (av7110->dev->pci->subsystem_vendor == 0x110a) { | 2081 | if (av7110->dev->pci->subsystem_vendor == 0x110a) { |
2078 | switch(av7110->dev->pci->subsystem_device) { | 2082 | switch(av7110->dev->pci->subsystem_device) { |
2079 | case 0x0000: // Fujitsu/Siemens DVB-Cable (ves1820/Philips CD1516(??)) | 2083 | case 0x0000: // Fujitsu/Siemens DVB-Cable (ves1820/Philips CD1516(??)) |
2080 | av7110->fe = ves1820_attach(&philips_cd1516_config, | 2084 | av7110->fe = dvb_attach(ves1820_attach, &philips_cd1516_config, |
2081 | &av7110->i2c_adap, read_pwm(av7110)); | 2085 | &av7110->i2c_adap, read_pwm(av7110)); |
2082 | if (av7110->fe) { | 2086 | if (av7110->fe) { |
2083 | av7110->fe->ops.tuner_ops.set_params = philips_cd1516_tuner_set_params; | 2087 | av7110->fe->ops.tuner_ops.set_params = philips_cd1516_tuner_set_params; |
@@ -2092,7 +2096,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2092 | case 0x1002: // Hauppauge/TT WinTV DVB-S rev1.3SE | 2096 | case 0x1002: // Hauppauge/TT WinTV DVB-S rev1.3SE |
2093 | 2097 | ||
2094 | // try the ALPS BSRV2 first of all | 2098 | // try the ALPS BSRV2 first of all |
2095 | av7110->fe = ves1x93_attach(&alps_bsrv2_config, &av7110->i2c_adap); | 2099 | av7110->fe = dvb_attach(ves1x93_attach, &alps_bsrv2_config, &av7110->i2c_adap); |
2096 | if (av7110->fe) { | 2100 | if (av7110->fe) { |
2097 | av7110->fe->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; | 2101 | av7110->fe->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; |
2098 | av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; | 2102 | av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; |
@@ -2103,7 +2107,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2103 | } | 2107 | } |
2104 | 2108 | ||
2105 | // try the ALPS BSRU6 now | 2109 | // try the ALPS BSRU6 now |
2106 | av7110->fe = stv0299_attach(&alps_bsru6_config, &av7110->i2c_adap); | 2110 | av7110->fe = dvb_attach(stv0299_attach, &alps_bsru6_config, &av7110->i2c_adap); |
2107 | if (av7110->fe) { | 2111 | if (av7110->fe) { |
2108 | av7110->fe->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; | 2112 | av7110->fe->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; |
2109 | av7110->fe->tuner_priv = &av7110->i2c_adap; | 2113 | av7110->fe->tuner_priv = &av7110->i2c_adap; |
@@ -2116,7 +2120,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2116 | } | 2120 | } |
2117 | 2121 | ||
2118 | // Try the grundig 29504-451 | 2122 | // Try the grundig 29504-451 |
2119 | av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap); | 2123 | av7110->fe = dvb_attach(tda8083_attach, &grundig_29504_451_config, &av7110->i2c_adap); |
2120 | if (av7110->fe) { | 2124 | if (av7110->fe) { |
2121 | av7110->fe->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; | 2125 | av7110->fe->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; |
2122 | av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; | 2126 | av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; |
@@ -2130,7 +2134,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2130 | switch(av7110->dev->pci->subsystem_device) { | 2134 | switch(av7110->dev->pci->subsystem_device) { |
2131 | case 0x0000: | 2135 | case 0x0000: |
2132 | /* Siemens DVB-C (full-length card) VES1820/Philips CD1516 */ | 2136 | /* Siemens DVB-C (full-length card) VES1820/Philips CD1516 */ |
2133 | av7110->fe = ves1820_attach(&philips_cd1516_config, &av7110->i2c_adap, | 2137 | av7110->fe = dvb_attach(ves1820_attach, &philips_cd1516_config, &av7110->i2c_adap, |
2134 | read_pwm(av7110)); | 2138 | read_pwm(av7110)); |
2135 | if (av7110->fe) { | 2139 | if (av7110->fe) { |
2136 | av7110->fe->ops.tuner_ops.set_params = philips_cd1516_tuner_set_params; | 2140 | av7110->fe->ops.tuner_ops.set_params = philips_cd1516_tuner_set_params; |
@@ -2138,7 +2142,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2138 | break; | 2142 | break; |
2139 | case 0x0003: | 2143 | case 0x0003: |
2140 | /* Hauppauge DVB-C 2.1 VES1820/ALPS TDBE2 */ | 2144 | /* Hauppauge DVB-C 2.1 VES1820/ALPS TDBE2 */ |
2141 | av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, | 2145 | av7110->fe = dvb_attach(ves1820_attach, &alps_tdbe2_config, &av7110->i2c_adap, |
2142 | read_pwm(av7110)); | 2146 | read_pwm(av7110)); |
2143 | if (av7110->fe) { | 2147 | if (av7110->fe) { |
2144 | av7110->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; | 2148 | av7110->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; |
@@ -2150,7 +2154,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2150 | case 0x0001: // Hauppauge/TT Nexus-T premium rev1.X | 2154 | case 0x0001: // Hauppauge/TT Nexus-T premium rev1.X |
2151 | 2155 | ||
2152 | // ALPS TDLB7 | 2156 | // ALPS TDLB7 |
2153 | av7110->fe = sp8870_attach(&alps_tdlb7_config, &av7110->i2c_adap); | 2157 | av7110->fe = dvb_attach(sp8870_attach, &alps_tdlb7_config, &av7110->i2c_adap); |
2154 | if (av7110->fe) { | 2158 | if (av7110->fe) { |
2155 | av7110->fe->ops.tuner_ops.set_params = alps_tdlb7_tuner_set_params; | 2159 | av7110->fe->ops.tuner_ops.set_params = alps_tdlb7_tuner_set_params; |
2156 | } | 2160 | } |
@@ -2158,7 +2162,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2158 | 2162 | ||
2159 | case 0x0002: // Hauppauge/TT DVB-C premium rev2.X | 2163 | case 0x0002: // Hauppauge/TT DVB-C premium rev2.X |
2160 | 2164 | ||
2161 | av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110)); | 2165 | av7110->fe = dvb_attach(ves1820_attach, &alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110)); |
2162 | if (av7110->fe) { | 2166 | if (av7110->fe) { |
2163 | av7110->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; | 2167 | av7110->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; |
2164 | } | 2168 | } |
@@ -2166,7 +2170,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2166 | 2170 | ||
2167 | case 0x0004: // Galaxis DVB-S rev1.3 | 2171 | case 0x0004: // Galaxis DVB-S rev1.3 |
2168 | /* ALPS BSRV2 */ | 2172 | /* ALPS BSRV2 */ |
2169 | av7110->fe = ves1x93_attach(&alps_bsrv2_config, &av7110->i2c_adap); | 2173 | av7110->fe = dvb_attach(ves1x93_attach, &alps_bsrv2_config, &av7110->i2c_adap); |
2170 | if (av7110->fe) { | 2174 | if (av7110->fe) { |
2171 | av7110->fe->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; | 2175 | av7110->fe->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; |
2172 | av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; | 2176 | av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; |
@@ -2178,7 +2182,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2178 | 2182 | ||
2179 | case 0x0006: /* Fujitsu-Siemens DVB-S rev 1.6 */ | 2183 | case 0x0006: /* Fujitsu-Siemens DVB-S rev 1.6 */ |
2180 | /* Grundig 29504-451 */ | 2184 | /* Grundig 29504-451 */ |
2181 | av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap); | 2185 | av7110->fe = dvb_attach(tda8083_attach, &grundig_29504_451_config, &av7110->i2c_adap); |
2182 | if (av7110->fe) { | 2186 | if (av7110->fe) { |
2183 | av7110->fe->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; | 2187 | av7110->fe->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; |
2184 | av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; | 2188 | av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; |
@@ -2190,7 +2194,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2190 | 2194 | ||
2191 | case 0x0008: // Hauppauge/TT DVB-T | 2195 | case 0x0008: // Hauppauge/TT DVB-T |
2192 | 2196 | ||
2193 | av7110->fe = l64781_attach(&grundig_29504_401_config, &av7110->i2c_adap); | 2197 | av7110->fe = dvb_attach(l64781_attach, &grundig_29504_401_config, &av7110->i2c_adap); |
2194 | if (av7110->fe) { | 2198 | if (av7110->fe) { |
2195 | av7110->fe->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params; | 2199 | av7110->fe->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params; |
2196 | } | 2200 | } |
@@ -2198,7 +2202,7 @@ static int frontend_init(struct av7110 *av7110) | |||
2198 | 2202 | ||
2199 | case 0x000A: // Hauppauge/TT Nexus-CA rev1.X | 2203 | case 0x000A: // Hauppauge/TT Nexus-CA rev1.X |
2200 | 2204 | ||
2201 | av7110->fe = stv0297_attach(&nexusca_stv0297_config, &av7110->i2c_adap); | 2205 | av7110->fe = dvb_attach(stv0297_attach, &nexusca_stv0297_config, &av7110->i2c_adap); |
2202 | if (av7110->fe) { | 2206 | if (av7110->fe) { |
2203 | av7110->fe->ops.tuner_ops.set_params = nexusca_stv0297_tuner_set_params; | 2207 | av7110->fe->ops.tuner_ops.set_params = nexusca_stv0297_tuner_set_params; |
2204 | 2208 | ||
@@ -2214,12 +2218,12 @@ static int frontend_init(struct av7110 *av7110) | |||
2214 | 2218 | ||
2215 | case 0x000E: /* Hauppauge/TT Nexus-S rev 2.3 */ | 2219 | case 0x000E: /* Hauppauge/TT Nexus-S rev 2.3 */ |
2216 | /* ALPS BSBE1 */ | 2220 | /* ALPS BSBE1 */ |
2217 | av7110->fe = stv0299_attach(&alps_bsbe1_config, &av7110->i2c_adap); | 2221 | av7110->fe = dvb_attach(stv0299_attach, &alps_bsbe1_config, &av7110->i2c_adap); |
2218 | if (av7110->fe) { | 2222 | if (av7110->fe) { |
2219 | av7110->fe->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params; | 2223 | av7110->fe->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params; |
2220 | av7110->fe->tuner_priv = &av7110->i2c_adap; | 2224 | av7110->fe->tuner_priv = &av7110->i2c_adap; |
2221 | 2225 | ||
2222 | if (lnbp21_attach(av7110->fe, &av7110->i2c_adap, 0, 0) == NULL) { | 2226 | if (dvb_attach(lnbp21_attach, av7110->fe, &av7110->i2c_adap, 0, 0) == NULL) { |
2223 | printk("dvb-ttpci: LNBP21 not found!\n"); | 2227 | printk("dvb-ttpci: LNBP21 not found!\n"); |
2224 | if (av7110->fe->ops.release) | 2228 | if (av7110->fe->ops.release) |
2225 | av7110->fe->ops.release(av7110->fe); | 2229 | av7110->fe->ops.release(av7110->fe); |
@@ -2255,8 +2259,9 @@ static int frontend_init(struct av7110 *av7110) | |||
2255 | ret = dvb_register_frontend(&av7110->dvb_adapter, av7110->fe); | 2259 | ret = dvb_register_frontend(&av7110->dvb_adapter, av7110->fe); |
2256 | if (ret < 0) { | 2260 | if (ret < 0) { |
2257 | printk("av7110: Frontend registration failed!\n"); | 2261 | printk("av7110: Frontend registration failed!\n"); |
2258 | if (av7110->fe->ops.release) | 2262 | dvb_detach(av7110->fe->ops.release_sec, av7110->fe); |
2259 | av7110->fe->ops.release(av7110->fe); | 2263 | dvb_detach(av7110->fe->ops.tuner_ops.release, av7110->fe); |
2264 | dvb_detach(av7110->fe->ops.release, av7110->fe); | ||
2260 | av7110->fe = NULL; | 2265 | av7110->fe = NULL; |
2261 | } | 2266 | } |
2262 | } | 2267 | } |
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index 2d21fec23b4d..c648c01c8ec5 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c | |||
@@ -235,7 +235,7 @@ static int ciintf_slot_reset(struct dvb_ca_en50221 *ca, int slot) | |||
235 | 235 | ||
236 | /* set tda10021 back to original clock configuration on reset */ | 236 | /* set tda10021 back to original clock configuration on reset */ |
237 | if (budget_av->tda10021_poclkp) { | 237 | if (budget_av->tda10021_poclkp) { |
238 | tda10021_write_byte(budget_av->budget.dvb_frontend, 0x12, 0xa0); | 238 | tda10021_writereg(budget_av->budget.dvb_frontend, 0x12, 0xa0); |
239 | budget_av->tda10021_ts_enabled = 0; | 239 | budget_av->tda10021_ts_enabled = 0; |
240 | } | 240 | } |
241 | 241 | ||
@@ -257,7 +257,7 @@ static int ciintf_slot_shutdown(struct dvb_ca_en50221 *ca, int slot) | |||
257 | 257 | ||
258 | /* set tda10021 back to original clock configuration when cam removed */ | 258 | /* set tda10021 back to original clock configuration when cam removed */ |
259 | if (budget_av->tda10021_poclkp) { | 259 | if (budget_av->tda10021_poclkp) { |
260 | tda10021_write_byte(budget_av->budget.dvb_frontend, 0x12, 0xa0); | 260 | tda10021_writereg(budget_av->budget.dvb_frontend, 0x12, 0xa0); |
261 | budget_av->tda10021_ts_enabled = 0; | 261 | budget_av->tda10021_ts_enabled = 0; |
262 | } | 262 | } |
263 | return 0; | 263 | return 0; |
@@ -277,7 +277,7 @@ static int ciintf_slot_ts_enable(struct dvb_ca_en50221 *ca, int slot) | |||
277 | 277 | ||
278 | /* tda10021 seems to need a different TS clock config when data is routed to the CAM */ | 278 | /* tda10021 seems to need a different TS clock config when data is routed to the CAM */ |
279 | if (budget_av->tda10021_poclkp) { | 279 | if (budget_av->tda10021_poclkp) { |
280 | tda10021_write_byte(budget_av->budget.dvb_frontend, 0x12, 0xa1); | 280 | tda10021_writereg(budget_av->budget.dvb_frontend, 0x12, 0xa1); |
281 | budget_av->tda10021_ts_enabled = 1; | 281 | budget_av->tda10021_ts_enabled = 1; |
282 | } | 282 | } |
283 | 283 | ||
@@ -1068,9 +1068,9 @@ static int tda10021_set_frontend(struct dvb_frontend *fe, | |||
1068 | 1068 | ||
1069 | result = budget_av->tda10021_set_frontend(fe, p); | 1069 | result = budget_av->tda10021_set_frontend(fe, p); |
1070 | if (budget_av->tda10021_ts_enabled) { | 1070 | if (budget_av->tda10021_ts_enabled) { |
1071 | tda10021_write_byte(budget_av->budget.dvb_frontend, 0x12, 0xa1); | 1071 | tda10021_writereg(budget_av->budget.dvb_frontend, 0x12, 0xa1); |
1072 | } else { | 1072 | } else { |
1073 | tda10021_write_byte(budget_av->budget.dvb_frontend, 0x12, 0xa0); | 1073 | tda10021_writereg(budget_av->budget.dvb_frontend, 0x12, 0xa0); |
1074 | } | 1074 | } |
1075 | 1075 | ||
1076 | return result; | 1076 | return result; |
@@ -1098,13 +1098,13 @@ static void frontend_init(struct budget_av *budget_av) | |||
1098 | case SUBID_DVBS_KNC1: | 1098 | case SUBID_DVBS_KNC1: |
1099 | case SUBID_DVBS_EASYWATCH_1: | 1099 | case SUBID_DVBS_EASYWATCH_1: |
1100 | if (saa->pci->subsystem_vendor == 0x1894) { | 1100 | if (saa->pci->subsystem_vendor == 0x1894) { |
1101 | fe = stv0299_attach(&cinergy_1200s_1894_0010_config, | 1101 | fe = dvb_attach(stv0299_attach, &cinergy_1200s_1894_0010_config, |
1102 | &budget_av->budget.i2c_adap); | 1102 | &budget_av->budget.i2c_adap); |
1103 | if (fe) { | 1103 | if (fe) { |
1104 | fe->ops.tuner_ops.set_params = philips_su1278sh2_tua6100_tuner_set_params; | 1104 | fe->ops.tuner_ops.set_params = philips_su1278sh2_tua6100_tuner_set_params; |
1105 | } | 1105 | } |
1106 | } else { | 1106 | } else { |
1107 | fe = stv0299_attach(&typhoon_config, | 1107 | fe = dvb_attach(stv0299_attach, &typhoon_config, |
1108 | &budget_av->budget.i2c_adap); | 1108 | &budget_av->budget.i2c_adap); |
1109 | if (fe) { | 1109 | if (fe) { |
1110 | fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params; | 1110 | fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params; |
@@ -1116,7 +1116,7 @@ static void frontend_init(struct budget_av *budget_av) | |||
1116 | case SUBID_DVBS_TV_STAR_CI: | 1116 | case SUBID_DVBS_TV_STAR_CI: |
1117 | case SUBID_DVBS_CYNERGY1200N: | 1117 | case SUBID_DVBS_CYNERGY1200N: |
1118 | case SUBID_DVBS_EASYWATCH: | 1118 | case SUBID_DVBS_EASYWATCH: |
1119 | fe = stv0299_attach(&philips_sd1878_config, | 1119 | fe = dvb_attach(stv0299_attach, &philips_sd1878_config, |
1120 | &budget_av->budget.i2c_adap); | 1120 | &budget_av->budget.i2c_adap); |
1121 | if (fe) { | 1121 | if (fe) { |
1122 | fe->ops.tuner_ops.set_params = philips_sd1878_tda8261_tuner_set_params; | 1122 | fe->ops.tuner_ops.set_params = philips_sd1878_tda8261_tuner_set_params; |
@@ -1125,7 +1125,7 @@ static void frontend_init(struct budget_av *budget_av) | |||
1125 | 1125 | ||
1126 | case SUBID_DVBS_KNC1_PLUS: | 1126 | case SUBID_DVBS_KNC1_PLUS: |
1127 | case SUBID_DVBS_TYPHOON: | 1127 | case SUBID_DVBS_TYPHOON: |
1128 | fe = stv0299_attach(&typhoon_config, | 1128 | fe = dvb_attach(stv0299_attach, &typhoon_config, |
1129 | &budget_av->budget.i2c_adap); | 1129 | &budget_av->budget.i2c_adap); |
1130 | if (fe) { | 1130 | if (fe) { |
1131 | fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params; | 1131 | fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params; |
@@ -1133,7 +1133,7 @@ static void frontend_init(struct budget_av *budget_av) | |||
1133 | break; | 1133 | break; |
1134 | 1134 | ||
1135 | case SUBID_DVBS_CINERGY1200: | 1135 | case SUBID_DVBS_CINERGY1200: |
1136 | fe = stv0299_attach(&cinergy_1200s_config, | 1136 | fe = dvb_attach(stv0299_attach, &cinergy_1200s_config, |
1137 | &budget_av->budget.i2c_adap); | 1137 | &budget_av->budget.i2c_adap); |
1138 | if (fe) { | 1138 | if (fe) { |
1139 | fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params; | 1139 | fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params; |
@@ -1142,7 +1142,7 @@ static void frontend_init(struct budget_av *budget_av) | |||
1142 | 1142 | ||
1143 | case SUBID_DVBC_KNC1: | 1143 | case SUBID_DVBC_KNC1: |
1144 | budget_av->reinitialise_demod = 1; | 1144 | budget_av->reinitialise_demod = 1; |
1145 | fe = tda10021_attach(&philips_cu1216_config, | 1145 | fe = dvb_attach(tda10021_attach, &philips_cu1216_config, |
1146 | &budget_av->budget.i2c_adap, | 1146 | &budget_av->budget.i2c_adap, |
1147 | read_pwm(budget_av)); | 1147 | read_pwm(budget_av)); |
1148 | if (fe) { | 1148 | if (fe) { |
@@ -1153,7 +1153,7 @@ static void frontend_init(struct budget_av *budget_av) | |||
1153 | case SUBID_DVBC_KNC1_PLUS: | 1153 | case SUBID_DVBC_KNC1_PLUS: |
1154 | case SUBID_DVBC_CINERGY1200: | 1154 | case SUBID_DVBC_CINERGY1200: |
1155 | budget_av->reinitialise_demod = 1; | 1155 | budget_av->reinitialise_demod = 1; |
1156 | fe = tda10021_attach(&philips_cu1216_config, | 1156 | fe = dvb_attach(tda10021_attach, &philips_cu1216_config, |
1157 | &budget_av->budget.i2c_adap, | 1157 | &budget_av->budget.i2c_adap, |
1158 | read_pwm(budget_av)); | 1158 | read_pwm(budget_av)); |
1159 | if (fe) { | 1159 | if (fe) { |
@@ -1168,7 +1168,7 @@ static void frontend_init(struct budget_av *budget_av) | |||
1168 | case SUBID_DVBT_KNC1_PLUS: | 1168 | case SUBID_DVBT_KNC1_PLUS: |
1169 | case SUBID_DVBT_CINERGY1200: | 1169 | case SUBID_DVBT_CINERGY1200: |
1170 | budget_av->reinitialise_demod = 1; | 1170 | budget_av->reinitialise_demod = 1; |
1171 | fe = tda10046_attach(&philips_tu1216_config, | 1171 | fe = dvb_attach(tda10046_attach, &philips_tu1216_config, |
1172 | &budget_av->budget.i2c_adap); | 1172 | &budget_av->budget.i2c_adap); |
1173 | if (fe) { | 1173 | if (fe) { |
1174 | fe->ops.tuner_ops.init = philips_tu1216_tuner_init; | 1174 | fe->ops.tuner_ops.init = philips_tu1216_tuner_init; |
@@ -1192,8 +1192,9 @@ static void frontend_init(struct budget_av *budget_av) | |||
1192 | if (dvb_register_frontend(&budget_av->budget.dvb_adapter, | 1192 | if (dvb_register_frontend(&budget_av->budget.dvb_adapter, |
1193 | budget_av->budget.dvb_frontend)) { | 1193 | budget_av->budget.dvb_frontend)) { |
1194 | printk(KERN_ERR "budget-av: Frontend registration failed!\n"); | 1194 | printk(KERN_ERR "budget-av: Frontend registration failed!\n"); |
1195 | if (budget_av->budget.dvb_frontend->ops.release) | 1195 | dvb_detach(budget_av->budget.dvb_frontend->ops.release_sec, budget_av->budget.dvb_frontend); |
1196 | budget_av->budget.dvb_frontend->ops.release(budget_av->budget.dvb_frontend); | 1196 | dvb_detach(budget_av->budget.dvb_frontend->ops.tuner_ops.release, budget_av->budget.dvb_frontend); |
1197 | dvb_detach(budget_av->budget.dvb_frontend->ops.release, budget_av->budget.dvb_frontend); | ||
1197 | budget_av->budget.dvb_frontend = NULL; | 1198 | budget_av->budget.dvb_frontend = NULL; |
1198 | } | 1199 | } |
1199 | } | 1200 | } |
@@ -1227,8 +1228,12 @@ static int budget_av_detach(struct saa7146_dev *dev) | |||
1227 | if (budget_av->budget.ci_present) | 1228 | if (budget_av->budget.ci_present) |
1228 | ciintf_deinit(budget_av); | 1229 | ciintf_deinit(budget_av); |
1229 | 1230 | ||
1230 | if (budget_av->budget.dvb_frontend != NULL) | 1231 | if (budget_av->budget.dvb_frontend != NULL) { |
1231 | dvb_unregister_frontend(budget_av->budget.dvb_frontend); | 1232 | dvb_unregister_frontend(budget_av->budget.dvb_frontend); |
1233 | dvb_detach(budget_av->budget.dvb_frontend->ops.release_sec, budget_av->budget.dvb_frontend); | ||
1234 | dvb_detach(budget_av->budget.dvb_frontend->ops.tuner_ops.release, budget_av->budget.dvb_frontend); | ||
1235 | dvb_detach(budget_av->budget.dvb_frontend->ops.release, budget_av->budget.dvb_frontend); | ||
1236 | } | ||
1232 | err = ttpci_budget_deinit(&budget_av->budget); | 1237 | err = ttpci_budget_deinit(&budget_av->budget); |
1233 | 1238 | ||
1234 | kfree(budget_av); | 1239 | kfree(budget_av); |
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 8710813668f1..20b5e8dc8739 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c | |||
@@ -988,7 +988,7 @@ static void frontend_init(struct budget_ci *budget_ci) | |||
988 | switch (budget_ci->budget.dev->pci->subsystem_device) { | 988 | switch (budget_ci->budget.dev->pci->subsystem_device) { |
989 | case 0x100c: // Hauppauge/TT Nova-CI budget (stv0299/ALPS BSRU6(tsa5059)) | 989 | case 0x100c: // Hauppauge/TT Nova-CI budget (stv0299/ALPS BSRU6(tsa5059)) |
990 | budget_ci->budget.dvb_frontend = | 990 | budget_ci->budget.dvb_frontend = |
991 | stv0299_attach(&alps_bsru6_config, &budget_ci->budget.i2c_adap); | 991 | dvb_attach(stv0299_attach, &alps_bsru6_config, &budget_ci->budget.i2c_adap); |
992 | if (budget_ci->budget.dvb_frontend) { | 992 | if (budget_ci->budget.dvb_frontend) { |
993 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; | 993 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; |
994 | budget_ci->budget.dvb_frontend->tuner_priv = &budget_ci->budget.i2c_adap; | 994 | budget_ci->budget.dvb_frontend->tuner_priv = &budget_ci->budget.i2c_adap; |
@@ -998,7 +998,7 @@ static void frontend_init(struct budget_ci *budget_ci) | |||
998 | 998 | ||
999 | case 0x100f: // Hauppauge/TT Nova-CI budget (stv0299b/Philips su1278(tsa5059)) | 999 | case 0x100f: // Hauppauge/TT Nova-CI budget (stv0299b/Philips su1278(tsa5059)) |
1000 | budget_ci->budget.dvb_frontend = | 1000 | budget_ci->budget.dvb_frontend = |
1001 | stv0299_attach(&philips_su1278_tt_config, &budget_ci->budget.i2c_adap); | 1001 | dvb_attach(stv0299_attach, &philips_su1278_tt_config, &budget_ci->budget.i2c_adap); |
1002 | if (budget_ci->budget.dvb_frontend) { | 1002 | if (budget_ci->budget.dvb_frontend) { |
1003 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_su1278_tt_tuner_set_params; | 1003 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_su1278_tt_tuner_set_params; |
1004 | break; | 1004 | break; |
@@ -1008,7 +1008,7 @@ static void frontend_init(struct budget_ci *budget_ci) | |||
1008 | case 0x1010: // TT DVB-C CI budget (stv0297/Philips tdm1316l(tda6651tt)) | 1008 | case 0x1010: // TT DVB-C CI budget (stv0297/Philips tdm1316l(tda6651tt)) |
1009 | budget_ci->tuner_pll_address = 0x61; | 1009 | budget_ci->tuner_pll_address = 0x61; |
1010 | budget_ci->budget.dvb_frontend = | 1010 | budget_ci->budget.dvb_frontend = |
1011 | stv0297_attach(&dvbc_philips_tdm1316l_config, &budget_ci->budget.i2c_adap); | 1011 | dvb_attach(stv0297_attach, &dvbc_philips_tdm1316l_config, &budget_ci->budget.i2c_adap); |
1012 | if (budget_ci->budget.dvb_frontend) { | 1012 | if (budget_ci->budget.dvb_frontend) { |
1013 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = dvbc_philips_tdm1316l_tuner_set_params; | 1013 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = dvbc_philips_tdm1316l_tuner_set_params; |
1014 | break; | 1014 | break; |
@@ -1018,7 +1018,7 @@ static void frontend_init(struct budget_ci *budget_ci) | |||
1018 | case 0x1011: // Hauppauge/TT Nova-T budget (tda10045/Philips tdm1316l(tda6651tt) + TDA9889) | 1018 | case 0x1011: // Hauppauge/TT Nova-T budget (tda10045/Philips tdm1316l(tda6651tt) + TDA9889) |
1019 | budget_ci->tuner_pll_address = 0x63; | 1019 | budget_ci->tuner_pll_address = 0x63; |
1020 | budget_ci->budget.dvb_frontend = | 1020 | budget_ci->budget.dvb_frontend = |
1021 | tda10045_attach(&philips_tdm1316l_config, &budget_ci->budget.i2c_adap); | 1021 | dvb_attach(tda10045_attach, &philips_tdm1316l_config, &budget_ci->budget.i2c_adap); |
1022 | if (budget_ci->budget.dvb_frontend) { | 1022 | if (budget_ci->budget.dvb_frontend) { |
1023 | budget_ci->budget.dvb_frontend->ops.tuner_ops.init = philips_tdm1316l_tuner_init; | 1023 | budget_ci->budget.dvb_frontend->ops.tuner_ops.init = philips_tdm1316l_tuner_init; |
1024 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params; | 1024 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params; |
@@ -1029,7 +1029,7 @@ static void frontend_init(struct budget_ci *budget_ci) | |||
1029 | case 0x1012: // TT DVB-T CI budget (tda10046/Philips tdm1316l(tda6651tt)) | 1029 | case 0x1012: // TT DVB-T CI budget (tda10046/Philips tdm1316l(tda6651tt)) |
1030 | budget_ci->tuner_pll_address = 0x60; | 1030 | budget_ci->tuner_pll_address = 0x60; |
1031 | budget_ci->budget.dvb_frontend = | 1031 | budget_ci->budget.dvb_frontend = |
1032 | tda10046_attach(&philips_tdm1316l_config, &budget_ci->budget.i2c_adap); | 1032 | dvb_attach(tda10046_attach, &philips_tdm1316l_config, &budget_ci->budget.i2c_adap); |
1033 | if (budget_ci->budget.dvb_frontend) { | 1033 | if (budget_ci->budget.dvb_frontend) { |
1034 | budget_ci->budget.dvb_frontend->ops.tuner_ops.init = philips_tdm1316l_tuner_init; | 1034 | budget_ci->budget.dvb_frontend->ops.tuner_ops.init = philips_tdm1316l_tuner_init; |
1035 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params; | 1035 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params; |
@@ -1038,13 +1038,13 @@ static void frontend_init(struct budget_ci *budget_ci) | |||
1038 | break; | 1038 | break; |
1039 | 1039 | ||
1040 | case 0x1017: // TT S-1500 PCI | 1040 | case 0x1017: // TT S-1500 PCI |
1041 | budget_ci->budget.dvb_frontend = stv0299_attach(&alps_bsbe1_config, &budget_ci->budget.i2c_adap); | 1041 | budget_ci->budget.dvb_frontend = dvb_attach(stv0299_attach, &alps_bsbe1_config, &budget_ci->budget.i2c_adap); |
1042 | if (budget_ci->budget.dvb_frontend) { | 1042 | if (budget_ci->budget.dvb_frontend) { |
1043 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params; | 1043 | budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params; |
1044 | budget_ci->budget.dvb_frontend->tuner_priv = &budget_ci->budget.i2c_adap; | 1044 | budget_ci->budget.dvb_frontend->tuner_priv = &budget_ci->budget.i2c_adap; |
1045 | 1045 | ||
1046 | budget_ci->budget.dvb_frontend->ops.dishnetwork_send_legacy_command = NULL; | 1046 | budget_ci->budget.dvb_frontend->ops.dishnetwork_send_legacy_command = NULL; |
1047 | if (lnbp21_attach(budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, LNBP21_LLC, 0) == NULL) { | 1047 | if (dvb_attach(lnbp21_attach, budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, LNBP21_LLC, 0) == NULL) { |
1048 | printk("%s: No LNBP21 found!\n", __FUNCTION__); | 1048 | printk("%s: No LNBP21 found!\n", __FUNCTION__); |
1049 | if (budget_ci->budget.dvb_frontend->ops.release) | 1049 | if (budget_ci->budget.dvb_frontend->ops.release) |
1050 | budget_ci->budget.dvb_frontend->ops.release(budget_ci->budget.dvb_frontend); | 1050 | budget_ci->budget.dvb_frontend->ops.release(budget_ci->budget.dvb_frontend); |
@@ -1065,8 +1065,9 @@ static void frontend_init(struct budget_ci *budget_ci) | |||
1065 | if (dvb_register_frontend | 1065 | if (dvb_register_frontend |
1066 | (&budget_ci->budget.dvb_adapter, budget_ci->budget.dvb_frontend)) { | 1066 | (&budget_ci->budget.dvb_adapter, budget_ci->budget.dvb_frontend)) { |
1067 | printk("budget-ci: Frontend registration failed!\n"); | 1067 | printk("budget-ci: Frontend registration failed!\n"); |
1068 | if (budget_ci->budget.dvb_frontend->ops.release) | 1068 | dvb_detach(budget_ci->budget.dvb_frontend->ops.release_sec, budget_ci->budget.dvb_frontend); |
1069 | budget_ci->budget.dvb_frontend->ops.release(budget_ci->budget.dvb_frontend); | 1069 | dvb_detach(budget_ci->budget.dvb_frontend->ops.tuner_ops.release, budget_ci->budget.dvb_frontend); |
1070 | dvb_detach(budget_ci->budget.dvb_frontend->ops.release, budget_ci->budget.dvb_frontend); | ||
1070 | budget_ci->budget.dvb_frontend = NULL; | 1071 | budget_ci->budget.dvb_frontend = NULL; |
1071 | } | 1072 | } |
1072 | } | 1073 | } |
@@ -1114,8 +1115,12 @@ static int budget_ci_detach(struct saa7146_dev *dev) | |||
1114 | 1115 | ||
1115 | if (budget_ci->budget.ci_present) | 1116 | if (budget_ci->budget.ci_present) |
1116 | ciintf_deinit(budget_ci); | 1117 | ciintf_deinit(budget_ci); |
1117 | if (budget_ci->budget.dvb_frontend) | 1118 | if (budget_ci->budget.dvb_frontend) { |
1118 | dvb_unregister_frontend(budget_ci->budget.dvb_frontend); | 1119 | dvb_unregister_frontend(budget_ci->budget.dvb_frontend); |
1120 | dvb_detach(budget_ci->budget.dvb_frontend->ops.release_sec, budget_ci->budget.dvb_frontend); | ||
1121 | dvb_detach(budget_ci->budget.dvb_frontend->ops.tuner_ops.release, budget_ci->budget.dvb_frontend); | ||
1122 | dvb_detach(budget_ci->budget.dvb_frontend->ops.release, budget_ci->budget.dvb_frontend); | ||
1123 | } | ||
1119 | err = ttpci_budget_deinit(&budget_ci->budget); | 1124 | err = ttpci_budget_deinit(&budget_ci->budget); |
1120 | 1125 | ||
1121 | tasklet_kill(&budget_ci->msp430_irq_tasklet); | 1126 | tasklet_kill(&budget_ci->msp430_irq_tasklet); |
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c index 57227441891e..82dbef863e51 100644 --- a/drivers/media/dvb/ttpci/budget-patch.c +++ b/drivers/media/dvb/ttpci/budget-patch.c | |||
@@ -325,7 +325,7 @@ static void frontend_init(struct budget_patch* budget) | |||
325 | case 0x1013: // SATELCO Multimedia PCI | 325 | case 0x1013: // SATELCO Multimedia PCI |
326 | 326 | ||
327 | // try the ALPS BSRV2 first of all | 327 | // try the ALPS BSRV2 first of all |
328 | budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); | 328 | budget->dvb_frontend = dvb_attach(ves1x93_attach, &alps_bsrv2_config, &budget->i2c_adap); |
329 | if (budget->dvb_frontend) { | 329 | if (budget->dvb_frontend) { |
330 | budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; | 330 | budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; |
331 | budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_patch_diseqc_send_master_cmd; | 331 | budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_patch_diseqc_send_master_cmd; |
@@ -335,7 +335,7 @@ static void frontend_init(struct budget_patch* budget) | |||
335 | } | 335 | } |
336 | 336 | ||
337 | // try the ALPS BSRU6 now | 337 | // try the ALPS BSRU6 now |
338 | budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); | 338 | budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap); |
339 | if (budget->dvb_frontend) { | 339 | if (budget->dvb_frontend) { |
340 | budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; | 340 | budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; |
341 | budget->dvb_frontend->tuner_priv = &budget->i2c_adap; | 341 | budget->dvb_frontend->tuner_priv = &budget->i2c_adap; |
@@ -347,7 +347,7 @@ static void frontend_init(struct budget_patch* budget) | |||
347 | } | 347 | } |
348 | 348 | ||
349 | // Try the grundig 29504-451 | 349 | // Try the grundig 29504-451 |
350 | budget->dvb_frontend = tda8083_attach(&grundig_29504_451_config, &budget->i2c_adap); | 350 | budget->dvb_frontend = dvb_attach(tda8083_attach, &grundig_29504_451_config, &budget->i2c_adap); |
351 | if (budget->dvb_frontend) { | 351 | if (budget->dvb_frontend) { |
352 | budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; | 352 | budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; |
353 | budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; | 353 | budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; |
@@ -367,8 +367,9 @@ static void frontend_init(struct budget_patch* budget) | |||
367 | } else { | 367 | } else { |
368 | if (dvb_register_frontend(&budget->dvb_adapter, budget->dvb_frontend)) { | 368 | if (dvb_register_frontend(&budget->dvb_adapter, budget->dvb_frontend)) { |
369 | printk("budget-av: Frontend registration failed!\n"); | 369 | printk("budget-av: Frontend registration failed!\n"); |
370 | if (budget->dvb_frontend->ops.release) | 370 | dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend); |
371 | budget->dvb_frontend->ops.release(budget->dvb_frontend); | 371 | dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend); |
372 | dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend); | ||
372 | budget->dvb_frontend = NULL; | 373 | budget->dvb_frontend = NULL; |
373 | } | 374 | } |
374 | } | 375 | } |
@@ -627,8 +628,12 @@ static int budget_patch_detach (struct saa7146_dev* dev) | |||
627 | struct budget_patch *budget = (struct budget_patch*) dev->ext_priv; | 628 | struct budget_patch *budget = (struct budget_patch*) dev->ext_priv; |
628 | int err; | 629 | int err; |
629 | 630 | ||
630 | if (budget->dvb_frontend) dvb_unregister_frontend(budget->dvb_frontend); | 631 | if (budget->dvb_frontend) { |
631 | 632 | dvb_unregister_frontend(budget->dvb_frontend); | |
633 | dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend); | ||
634 | dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend); | ||
635 | dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend); | ||
636 | } | ||
632 | err = ttpci_budget_deinit (budget); | 637 | err = ttpci_budget_deinit (budget); |
633 | 638 | ||
634 | kfree (budget); | 639 | kfree (budget); |
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c index c21ee5a05fe8..19beb11f9664 100644 --- a/drivers/media/dvb/ttpci/budget.c +++ b/drivers/media/dvb/ttpci/budget.c | |||
@@ -361,7 +361,7 @@ static void frontend_init(struct budget *budget) | |||
361 | case 0x1003: // Hauppauge/TT Nova budget (stv0299/ALPS BSRU6(tsa5059) OR ves1893/ALPS BSRV2(sp5659)) | 361 | case 0x1003: // Hauppauge/TT Nova budget (stv0299/ALPS BSRU6(tsa5059) OR ves1893/ALPS BSRV2(sp5659)) |
362 | case 0x1013: | 362 | case 0x1013: |
363 | // try the ALPS BSRV2 first of all | 363 | // try the ALPS BSRV2 first of all |
364 | budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); | 364 | budget->dvb_frontend = dvb_attach(ves1x93_attach, &alps_bsrv2_config, &budget->i2c_adap); |
365 | if (budget->dvb_frontend) { | 365 | if (budget->dvb_frontend) { |
366 | budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; | 366 | 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; | 367 | budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; |
@@ -371,7 +371,7 @@ static void frontend_init(struct budget *budget) | |||
371 | } | 371 | } |
372 | 372 | ||
373 | // try the ALPS BSRU6 now | 373 | // try the ALPS BSRU6 now |
374 | budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); | 374 | budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap); |
375 | if (budget->dvb_frontend) { | 375 | if (budget->dvb_frontend) { |
376 | budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; | 376 | budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; |
377 | budget->dvb_frontend->tuner_priv = &budget->i2c_adap; | 377 | budget->dvb_frontend->tuner_priv = &budget->i2c_adap; |
@@ -381,7 +381,7 @@ static void frontend_init(struct budget *budget) | |||
381 | 381 | ||
382 | case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) | 382 | case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) |
383 | 383 | ||
384 | budget->dvb_frontend = ves1820_attach(&alps_tdbe2_config, &budget->i2c_adap, read_pwm(budget)); | 384 | budget->dvb_frontend = dvb_attach(ves1820_attach, &alps_tdbe2_config, &budget->i2c_adap, read_pwm(budget)); |
385 | if (budget->dvb_frontend) { | 385 | if (budget->dvb_frontend) { |
386 | budget->dvb_frontend->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; | 386 | budget->dvb_frontend->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; |
387 | break; | 387 | break; |
@@ -390,7 +390,7 @@ static void frontend_init(struct budget *budget) | |||
390 | 390 | ||
391 | case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060)) | 391 | case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060)) |
392 | 392 | ||
393 | budget->dvb_frontend = l64781_attach(&grundig_29504_401_config, &budget->i2c_adap); | 393 | budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config, &budget->i2c_adap); |
394 | if (budget->dvb_frontend) { | 394 | if (budget->dvb_frontend) { |
395 | budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params; | 395 | budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params; |
396 | break; | 396 | break; |
@@ -398,7 +398,7 @@ static void frontend_init(struct budget *budget) | |||
398 | break; | 398 | break; |
399 | 399 | ||
400 | case 0x4f60: // Fujitsu Siemens Activy Budget-S PCI rev AL (stv0299/ALPS BSRU6(tsa5059)) | 400 | 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); | 401 | budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap); |
402 | if (budget->dvb_frontend) { | 402 | if (budget->dvb_frontend) { |
403 | budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; | 403 | budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; |
404 | budget->dvb_frontend->tuner_priv = &budget->i2c_adap; | 404 | budget->dvb_frontend->tuner_priv = &budget->i2c_adap; |
@@ -408,7 +408,7 @@ static void frontend_init(struct budget *budget) | |||
408 | break; | 408 | break; |
409 | 409 | ||
410 | case 0x4f61: // Fujitsu Siemens Activy Budget-S PCI rev GR (tda8083/Grundig 29504-451(tsa5522)) | 410 | 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); | 411 | budget->dvb_frontend = dvb_attach(tda8083_attach, &grundig_29504_451_config, &budget->i2c_adap); |
412 | if (budget->dvb_frontend) { | 412 | if (budget->dvb_frontend) { |
413 | budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; | 413 | 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; | 414 | budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage; |
@@ -417,7 +417,7 @@ static void frontend_init(struct budget *budget) | |||
417 | break; | 417 | break; |
418 | 418 | ||
419 | case 0x1016: // Hauppauge/TT Nova-S SE (samsung s5h1420/????(tda8260)) | 419 | case 0x1016: // Hauppauge/TT Nova-S SE (samsung s5h1420/????(tda8260)) |
420 | budget->dvb_frontend = s5h1420_attach(&s5h1420_config, &budget->i2c_adap); | 420 | budget->dvb_frontend = dvb_attach(s5h1420_attach, &s5h1420_config, &budget->i2c_adap); |
421 | if (budget->dvb_frontend) { | 421 | if (budget->dvb_frontend) { |
422 | budget->dvb_frontend->ops.tuner_ops.set_params = s5h1420_tuner_set_params; | 422 | budget->dvb_frontend->ops.tuner_ops.set_params = s5h1420_tuner_set_params; |
423 | if (lnbp21_attach(budget->dvb_frontend, &budget->i2c_adap, 0, 0) == NULL) { | 423 | if (lnbp21_attach(budget->dvb_frontend, &budget->i2c_adap, 0, 0) == NULL) { |
@@ -442,8 +442,9 @@ static void frontend_init(struct budget *budget) | |||
442 | 442 | ||
443 | error_out: | 443 | error_out: |
444 | printk("budget: Frontend registration failed!\n"); | 444 | printk("budget: Frontend registration failed!\n"); |
445 | if (budget->dvb_frontend->ops.release) | 445 | dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend); |
446 | budget->dvb_frontend->ops.release(budget->dvb_frontend); | 446 | dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend); |
447 | dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend); | ||
447 | budget->dvb_frontend = NULL; | 448 | budget->dvb_frontend = NULL; |
448 | return; | 449 | return; |
449 | } | 450 | } |
@@ -481,7 +482,12 @@ static int budget_detach (struct saa7146_dev* dev) | |||
481 | struct budget *budget = (struct budget*) dev->ext_priv; | 482 | struct budget *budget = (struct budget*) dev->ext_priv; |
482 | int err; | 483 | int err; |
483 | 484 | ||
484 | if (budget->dvb_frontend) dvb_unregister_frontend(budget->dvb_frontend); | 485 | if (budget->dvb_frontend) { |
486 | dvb_unregister_frontend(budget->dvb_frontend); | ||
487 | dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend); | ||
488 | dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend); | ||
489 | dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend); | ||
490 | } | ||
485 | 491 | ||
486 | err = ttpci_budget_deinit (budget); | 492 | err = ttpci_budget_deinit (budget); |
487 | 493 | ||
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 3c299df89410..6f58c66d6ef9 100644 --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | |||
@@ -1564,13 +1564,13 @@ static void frontend_init(struct ttusb* ttusb) | |||
1564 | switch(le16_to_cpu(ttusb->dev->descriptor.idProduct)) { | 1564 | switch(le16_to_cpu(ttusb->dev->descriptor.idProduct)) { |
1565 | case 0x1003: // Hauppauge/TT Nova-USB-S budget (stv0299/ALPS BSRU6|BSBE1(tsa5059)) | 1565 | case 0x1003: // Hauppauge/TT Nova-USB-S budget (stv0299/ALPS BSRU6|BSBE1(tsa5059)) |
1566 | // try the stv0299 based first | 1566 | // try the stv0299 based first |
1567 | ttusb->fe = stv0299_attach(&alps_stv0299_config, &ttusb->i2c_adap); | 1567 | ttusb->fe = dvb_attach(stv0299_attach, &alps_stv0299_config, &ttusb->i2c_adap); |
1568 | if (ttusb->fe != NULL) { | 1568 | if (ttusb->fe != NULL) { |
1569 | ttusb->fe->ops.tuner_ops.set_params = philips_tsa5059_tuner_set_params; | 1569 | ttusb->fe->ops.tuner_ops.set_params = philips_tsa5059_tuner_set_params; |
1570 | 1570 | ||
1571 | if(ttusb->revision == TTUSB_REV_2_2) { // ALPS BSBE1 | 1571 | if(ttusb->revision == TTUSB_REV_2_2) { // ALPS BSBE1 |
1572 | alps_stv0299_config.inittab = alps_bsbe1_inittab; | 1572 | alps_stv0299_config.inittab = alps_bsbe1_inittab; |
1573 | lnbp21_attach(ttusb->fe, &ttusb->i2c_adap, 0, 0); | 1573 | dvb_attach(lnbp21_attach, ttusb->fe, &ttusb->i2c_adap, 0, 0); |
1574 | } else { // ALPS BSRU6 | 1574 | } else { // ALPS BSRU6 |
1575 | ttusb->fe->ops.set_voltage = ttusb_set_voltage; | 1575 | ttusb->fe->ops.set_voltage = ttusb_set_voltage; |
1576 | } | 1576 | } |
@@ -1578,7 +1578,7 @@ static void frontend_init(struct ttusb* ttusb) | |||
1578 | } | 1578 | } |
1579 | 1579 | ||
1580 | // Grundig 29504-491 | 1580 | // Grundig 29504-491 |
1581 | ttusb->fe = tda8083_attach(&ttusb_novas_grundig_29504_491_config, &ttusb->i2c_adap); | 1581 | ttusb->fe = dvb_attach(tda8083_attach, &ttusb_novas_grundig_29504_491_config, &ttusb->i2c_adap); |
1582 | if (ttusb->fe != NULL) { | 1582 | if (ttusb->fe != NULL) { |
1583 | ttusb->fe->ops.tuner_ops.set_params = ttusb_novas_grundig_29504_491_tuner_set_params; | 1583 | ttusb->fe->ops.tuner_ops.set_params = ttusb_novas_grundig_29504_491_tuner_set_params; |
1584 | ttusb->fe->ops.set_voltage = ttusb_set_voltage; | 1584 | ttusb->fe->ops.set_voltage = ttusb_set_voltage; |
@@ -1587,13 +1587,13 @@ static void frontend_init(struct ttusb* ttusb) | |||
1587 | break; | 1587 | break; |
1588 | 1588 | ||
1589 | case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) | 1589 | case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) |
1590 | ttusb->fe = ves1820_attach(&alps_tdbe2_config, &ttusb->i2c_adap, read_pwm(ttusb)); | 1590 | ttusb->fe = dvb_attach(ves1820_attach, &alps_tdbe2_config, &ttusb->i2c_adap, read_pwm(ttusb)); |
1591 | if (ttusb->fe != NULL) { | 1591 | if (ttusb->fe != NULL) { |
1592 | ttusb->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; | 1592 | ttusb->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; |
1593 | break; | 1593 | break; |
1594 | } | 1594 | } |
1595 | 1595 | ||
1596 | ttusb->fe = stv0297_attach(&dvbc_philips_tdm1316l_config, &ttusb->i2c_adap); | 1596 | ttusb->fe = dvb_attach(stv0297_attach, &dvbc_philips_tdm1316l_config, &ttusb->i2c_adap); |
1597 | if (ttusb->fe != NULL) { | 1597 | if (ttusb->fe != NULL) { |
1598 | ttusb->fe->ops.tuner_ops.set_params = dvbc_philips_tdm1316l_tuner_set_params; | 1598 | ttusb->fe->ops.tuner_ops.set_params = dvbc_philips_tdm1316l_tuner_set_params; |
1599 | break; | 1599 | break; |
@@ -1602,14 +1602,14 @@ static void frontend_init(struct ttusb* ttusb) | |||
1602 | 1602 | ||
1603 | case 0x1005: // Hauppauge/TT Nova-USB-t budget (tda10046/Philips td1316(tda6651tt) OR cx22700/ALPS TDMB7(??)) | 1603 | case 0x1005: // Hauppauge/TT Nova-USB-t budget (tda10046/Philips td1316(tda6651tt) OR cx22700/ALPS TDMB7(??)) |
1604 | // try the ALPS TDMB7 first | 1604 | // try the ALPS TDMB7 first |
1605 | ttusb->fe = cx22700_attach(&alps_tdmb7_config, &ttusb->i2c_adap); | 1605 | ttusb->fe = dvb_attach(cx22700_attach, &alps_tdmb7_config, &ttusb->i2c_adap); |
1606 | if (ttusb->fe != NULL) { | 1606 | if (ttusb->fe != NULL) { |
1607 | ttusb->fe->ops.tuner_ops.set_params = alps_tdmb7_tuner_set_params; | 1607 | ttusb->fe->ops.tuner_ops.set_params = alps_tdmb7_tuner_set_params; |
1608 | break; | 1608 | break; |
1609 | } | 1609 | } |
1610 | 1610 | ||
1611 | // Philips td1316 | 1611 | // Philips td1316 |
1612 | ttusb->fe = tda10046_attach(&philips_tdm1316l_config, &ttusb->i2c_adap); | 1612 | ttusb->fe = dvb_attach(tda10046_attach, &philips_tdm1316l_config, &ttusb->i2c_adap); |
1613 | if (ttusb->fe != NULL) { | 1613 | if (ttusb->fe != NULL) { |
1614 | ttusb->fe->ops.tuner_ops.init = philips_tdm1316l_tuner_init; | 1614 | ttusb->fe->ops.tuner_ops.init = philips_tdm1316l_tuner_init; |
1615 | ttusb->fe->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params; | 1615 | ttusb->fe->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params; |
@@ -1625,8 +1625,9 @@ static void frontend_init(struct ttusb* ttusb) | |||
1625 | } else { | 1625 | } else { |
1626 | if (dvb_register_frontend(&ttusb->adapter, ttusb->fe)) { | 1626 | if (dvb_register_frontend(&ttusb->adapter, ttusb->fe)) { |
1627 | printk("dvb-ttusb-budget: Frontend registration failed!\n"); | 1627 | printk("dvb-ttusb-budget: Frontend registration failed!\n"); |
1628 | if (ttusb->fe->ops.release) | 1628 | dvb_detach(ttusb->fe->ops.release_sec, ttusb->fe); |
1629 | ttusb->fe->ops.release(ttusb->fe); | 1629 | dvb_detach(ttusb->fe->ops.tuner_ops.release, ttusb->fe); |
1630 | dvb_detach(ttusb->fe->ops.release, ttusb->fe); | ||
1630 | ttusb->fe = NULL; | 1631 | ttusb->fe = NULL; |
1631 | } | 1632 | } |
1632 | } | 1633 | } |
@@ -1763,7 +1764,12 @@ static void ttusb_disconnect(struct usb_interface *intf) | |||
1763 | dvb_net_release(&ttusb->dvbnet); | 1764 | dvb_net_release(&ttusb->dvbnet); |
1764 | dvb_dmxdev_release(&ttusb->dmxdev); | 1765 | dvb_dmxdev_release(&ttusb->dmxdev); |
1765 | dvb_dmx_release(&ttusb->dvb_demux); | 1766 | dvb_dmx_release(&ttusb->dvb_demux); |
1766 | if (ttusb->fe != NULL) dvb_unregister_frontend(ttusb->fe); | 1767 | if (ttusb->fe != NULL) { |
1768 | dvb_unregister_frontend(ttusb->fe); | ||
1769 | dvb_detach(ttusb->fe->ops.release_sec, ttusb->fe); | ||
1770 | dvb_detach(ttusb->fe->ops.tuner_ops.release, ttusb->fe); | ||
1771 | dvb_detach(ttusb->fe->ops.release, ttusb->fe); | ||
1772 | } | ||
1767 | i2c_del_adapter(&ttusb->i2c_adap); | 1773 | i2c_del_adapter(&ttusb->i2c_adap); |
1768 | dvb_unregister_adapter(&ttusb->adapter); | 1774 | dvb_unregister_adapter(&ttusb->adapter); |
1769 | 1775 | ||
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c index 6c1cb770bcf5..02651998f8db 100644 --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c | |||
@@ -1512,7 +1512,11 @@ static void ttusb_dec_exit_dvb(struct ttusb_dec *dec) | |||
1512 | dec->demux.dmx.remove_frontend(&dec->demux.dmx, &dec->frontend); | 1512 | dec->demux.dmx.remove_frontend(&dec->demux.dmx, &dec->frontend); |
1513 | dvb_dmxdev_release(&dec->dmxdev); | 1513 | dvb_dmxdev_release(&dec->dmxdev); |
1514 | dvb_dmx_release(&dec->demux); | 1514 | dvb_dmx_release(&dec->demux); |
1515 | if (dec->fe) dvb_unregister_frontend(dec->fe); | 1515 | if (dec->fe) { |
1516 | dvb_unregister_frontend(dec->fe); | ||
1517 | if (dec->fe->ops.release) | ||
1518 | dec->fe->ops.release(dec->fe); | ||
1519 | } | ||
1516 | dvb_unregister_adapter(&dec->adapter); | 1520 | dvb_unregister_adapter(&dec->adapter); |
1517 | } | 1521 | } |
1518 | 1522 | ||