Lines Matching +full:gpio +full:- +full:op +full:- +full:cfg

1 // SPDX-License-Identifier: GPL-2.0-or-later
23 #include "dvb-bt8xx.h"
45 struct dvb_bt8xx_card *card = dev_get_drvdata(&bt->adapter->dev); in dvb_bt8xx_work()
47 dprintk("%d\n", card->bt->finished_block); in dvb_bt8xx_work()
49 while (card->bt->last_block != card->bt->finished_block) { in dvb_bt8xx_work()
50 (card->bt->TS_Size ? dvb_dmx_swfilter_204 : dvb_dmx_swfilter) in dvb_bt8xx_work()
51 (&card->demux, in dvb_bt8xx_work()
52 &card->bt->buf_cpu[card->bt->last_block * in dvb_bt8xx_work()
53 card->bt->block_bytes], in dvb_bt8xx_work()
54 card->bt->block_bytes); in dvb_bt8xx_work()
55 card->bt->last_block = (card->bt->last_block + 1) % in dvb_bt8xx_work()
56 card->bt->block_count; in dvb_bt8xx_work()
62 struct dvb_demux*dvbdmx = dvbdmxfeed->demux; in dvb_bt8xx_start_feed()
63 struct dvb_bt8xx_card *card = dvbdmx->priv; in dvb_bt8xx_start_feed()
68 if (!dvbdmx->dmx.frontend) in dvb_bt8xx_start_feed()
69 return -EINVAL; in dvb_bt8xx_start_feed()
71 mutex_lock(&card->lock); in dvb_bt8xx_start_feed()
72 card->nfeeds++; in dvb_bt8xx_start_feed()
73 rc = card->nfeeds; in dvb_bt8xx_start_feed()
74 if (card->nfeeds == 1) in dvb_bt8xx_start_feed()
75 bt878_start(card->bt, card->gpio_mode, in dvb_bt8xx_start_feed()
76 card->op_sync_orin, card->irq_err_ignore); in dvb_bt8xx_start_feed()
77 mutex_unlock(&card->lock); in dvb_bt8xx_start_feed()
83 struct dvb_demux *dvbdmx = dvbdmxfeed->demux; in dvb_bt8xx_stop_feed()
84 struct dvb_bt8xx_card *card = dvbdmx->priv; in dvb_bt8xx_stop_feed()
88 if (!dvbdmx->dmx.frontend) in dvb_bt8xx_stop_feed()
89 return -EINVAL; in dvb_bt8xx_stop_feed()
91 mutex_lock(&card->lock); in dvb_bt8xx_stop_feed()
92 card->nfeeds--; in dvb_bt8xx_stop_feed()
93 if (card->nfeeds == 0) in dvb_bt8xx_stop_feed()
94 bt878_stop(card->bt); in dvb_bt8xx_stop_feed()
95 mutex_unlock(&card->lock); in dvb_bt8xx_stop_feed()
102 if ((adev->subsystem_vendor == bdev->subsystem_vendor) && in is_pci_slot_eq()
103 (adev->subsystem_device == bdev->subsystem_device) && in is_pci_slot_eq()
104 (adev->bus->number == bdev->bus->number) && in is_pci_slot_eq()
105 (PCI_SLOT(adev->devfn) == PCI_SLOT(bdev->devfn))) in is_pci_slot_eq()
145 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in thomson_dtt7579_tuner_calc_regs()
151 return -EINVAL; in thomson_dtt7579_tuner_calc_regs()
153 div = (((c->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; in thomson_dtt7579_tuner_calc_regs()
155 if (c->frequency < 542000000) in thomson_dtt7579_tuner_calc_regs()
157 else if (c->frequency < 771000000) in thomson_dtt7579_tuner_calc_regs()
162 if (c->frequency == 0) in thomson_dtt7579_tuner_calc_regs()
164 else if (c->frequency < 443250000) in thomson_dtt7579_tuner_calc_regs()
189 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in cx24108_tuner_set_params()
190 u32 freq = c->frequency; in cx24108_tuner_set_params()
214 for(i = 1; (i < ARRAY_SIZE(osci) - 1) && (osci[i] < freq); i++); in cx24108_tuner_set_params()
223 a=n%32; n/=32; if(a==0) n--; in cx24108_tuner_set_params()
224 pump=(freq<(osci[i-1]+osci[i])/2); in cx24108_tuner_set_params()
229 /* everything is shifted left 11 bits to left-align the bits in the in cx24108_tuner_set_params()
230 32bit word. Output to the tuner goes MSB-aligned, after all */ in cx24108_tuner_set_params()
233 /* set vga and vca to their widest-band settings, as a precaution. in cx24108_tuner_set_params()
245 struct dvb_bt8xx_card *card = fe->dvb->priv; in pinnsat_tuner_init()
247 bttv_gpio_enable(card->bttv_nr, 1, 1); /* output */ in pinnsat_tuner_init()
248 bttv_write_gpio(card->bttv_nr, 1, 1); /* relay on */ in pinnsat_tuner_init()
255 struct dvb_bt8xx_card *card = fe->dvb->priv; in pinnsat_tuner_sleep()
257 bttv_write_gpio(card->bttv_nr, 1, 0); /* relay off */ in pinnsat_tuner_sleep()
268 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in microtune_mt7202dtf_tuner_set_params()
269 struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv; in microtune_mt7202dtf_tuner_set_params()
270 u8 cfg, cpump, band_select; in microtune_mt7202dtf_tuner_set_params() local
275 div = (36000000 + c->frequency + 83333) / 166666; in microtune_mt7202dtf_tuner_set_params()
276 cfg = 0x88; in microtune_mt7202dtf_tuner_set_params()
278 if (c->frequency < 175000000) in microtune_mt7202dtf_tuner_set_params()
280 else if (c->frequency < 390000000) in microtune_mt7202dtf_tuner_set_params()
282 else if (c->frequency < 470000000) in microtune_mt7202dtf_tuner_set_params()
284 else if (c->frequency < 750000000) in microtune_mt7202dtf_tuner_set_params()
289 if (c->frequency < 175000000) in microtune_mt7202dtf_tuner_set_params()
291 else if (c->frequency < 470000000) in microtune_mt7202dtf_tuner_set_params()
298 data[2] = ((div >> 10) & 0x60) | cfg; in microtune_mt7202dtf_tuner_set_params()
301 if (fe->ops.i2c_gate_ctrl) in microtune_mt7202dtf_tuner_set_params()
302 fe->ops.i2c_gate_ctrl(fe, 1); in microtune_mt7202dtf_tuner_set_params()
303 i2c_transfer(card->i2c_adapter, &msg, 1); in microtune_mt7202dtf_tuner_set_params()
304 return (div * 166666 - 36000000); in microtune_mt7202dtf_tuner_set_params()
309 struct dvb_bt8xx_card* bt = (struct dvb_bt8xx_card*) fe->dvb->priv; in microtune_mt7202dtf_request_firmware()
311 return request_firmware(fw, name, &bt->bt->dev->dev); in microtune_mt7202dtf_request_firmware()
344 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
349 if (buf_len < 5) return -EINVAL; in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
351 div = (((c->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
353 if (c->frequency < 150000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
355 else if (c->frequency < 173000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
357 else if (c->frequency < 250000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
359 else if (c->frequency < 400000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
361 else if (c->frequency < 420000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
363 else if (c->frequency < 470000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
365 else if (c->frequency < 600000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
367 else if (c->frequency < 730000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
372 if (c->frequency < 150000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
374 else if (c->frequency < 173000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
376 else if (c->frequency < 250000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
378 else if (c->frequency < 400000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
380 else if (c->frequency < 420000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
382 else if (c->frequency < 470000000) in advbt771_samsung_tdtc9251dh0_tuner_calc_regs()
407 struct dvb_bt8xx_card* bt = (struct dvb_bt8xx_card*) fe->dvb->priv; in or51211_request_firmware()
409 return request_firmware(fw, name, &bt->bt->dev->dev); in or51211_request_firmware()
414 struct dvb_bt8xx_card *bt = fe->dvb->priv; in or51211_setmode()
415 bttv_write_gpio(bt->bttv_nr, 0x0002, mode); /* Reset */ in or51211_setmode()
421 struct dvb_bt8xx_card *bt = fe->dvb->priv; in or51211_reset()
424 * reset is controlled by GPIO-0 in or51211_reset()
425 * when set to 0 causes reset and when to 1 for normal op in or51211_reset()
427 * also PRM1 PRM2 & PRM4 are controlled by GPIO-1,GPIO-2 & GPIO-4 in or51211_reset()
433 int ret = bttv_gpio_enable(bt->bttv_nr, 0x001F, 0x001F); in or51211_reset()
435 pr_warn("or51211: Init Error - Can't Reset DVR (%i)\n", ret); in or51211_reset()
436 bttv_write_gpio(bt->bttv_nr, 0x001F, 0x0000); /* Reset */ in or51211_reset()
439 bttv_write_gpio(bt->bttv_nr, 0x0001F, 0x0001); in or51211_reset()
446 struct dvb_bt8xx_card *bt = fe->dvb->priv; in or51211_sleep()
447 bttv_write_gpio(bt->bttv_nr, 0x0001, 0x0000); in or51211_sleep()
460 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in vp3021_alps_tded4_tuner_set_params()
461 struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv; in vp3021_alps_tded4_tuner_set_params()
466 div = (c->frequency + 36166667) / 166667; in vp3021_alps_tded4_tuner_set_params()
471 if ((c->frequency >= 47000000) && (c->frequency < 153000000)) in vp3021_alps_tded4_tuner_set_params()
473 else if ((c->frequency >= 153000000) && (c->frequency < 430000000)) in vp3021_alps_tded4_tuner_set_params()
475 else if ((c->frequency >= 430000000) && (c->frequency < 824000000)) in vp3021_alps_tded4_tuner_set_params()
477 else if ((c->frequency >= 824000000) && (c->frequency < 863000000)) in vp3021_alps_tded4_tuner_set_params()
480 return -EINVAL; in vp3021_alps_tded4_tuner_set_params()
482 if (fe->ops.i2c_gate_ctrl) in vp3021_alps_tded4_tuner_set_params()
483 fe->ops.i2c_gate_ctrl(fe, 1); in vp3021_alps_tded4_tuner_set_params()
484 i2c_transfer(card->i2c_adapter, &msg, 1); in vp3021_alps_tded4_tuner_set_params()
514 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in digitv_alps_tded4_tuner_calc_regs()
517 return -EINVAL; in digitv_alps_tded4_tuner_calc_regs()
519 div = (((c->frequency + 83333) * 3) / 500000) + IF_FREQUENCYx6; in digitv_alps_tded4_tuner_calc_regs()
526 dprintk("frequency %u, div %u\n", c->frequency, div); in digitv_alps_tded4_tuner_calc_regs()
528 if (c->frequency < 470000000) in digitv_alps_tded4_tuner_calc_regs()
530 else if (c->frequency > 823000000) in digitv_alps_tded4_tuner_calc_regs()
535 if (c->bandwidth_hz == 8000000) in digitv_alps_tded4_tuner_calc_regs()
550 int ret = bttv_gpio_enable(bt->bttv_nr, 0x08, 0x08); in digitv_alps_tded4_reset()
552 pr_warn("digitv_alps_tded4: Init Error - Can't Reset DVR (%i)\n", in digitv_alps_tded4_reset()
556 bttv_write_gpio(bt->bttv_nr, 0x08, 0x08); /* High */ in digitv_alps_tded4_reset()
557 bttv_write_gpio(bt->bttv_nr, 0x08, 0x00); /* Low */ in digitv_alps_tded4_reset()
560 bttv_write_gpio(bt->bttv_nr, 0x08, 0x08); /* High */ in digitv_alps_tded4_reset()
578 bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000001); /* High */ in lgdt330x_reset()
579 bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000000); /* Low */ in lgdt330x_reset()
582 bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000001); /* High */ in lgdt330x_reset()
592 card->fe = dvb_attach(mt352_attach, &thomson_dtt7579_config, card->i2c_adapter); in frontend_init()
594 if (card->fe == NULL) in frontend_init()
595 card->fe = dvb_attach(zl10353_attach, &thomson_dtt7579_zl10353_config, in frontend_init()
596 card->i2c_adapter); in frontend_init()
598 if (card->fe != NULL) { in frontend_init()
599 card->fe->ops.tuner_ops.calc_regs = thomson_dtt7579_tuner_calc_regs; in frontend_init()
600 card->fe->ops.info.frequency_min_hz = 174 * MHz; in frontend_init()
601 card->fe->ops.info.frequency_max_hz = 862 * MHz; in frontend_init()
607 card->fe = dvb_attach(lgdt330x_attach, &tdvs_tua6034_config, in frontend_init()
608 0x0e, card->i2c_adapter); in frontend_init()
609 if (card->fe != NULL) { in frontend_init()
610 dvb_attach(simple_tuner_attach, card->fe, in frontend_init()
611 card->i2c_adapter, 0x61, in frontend_init()
625 card->fe = dvb_attach(nxt6000_attach, &vp3021_alps_tded4_config, card->i2c_adapter); in frontend_init()
626 if (card->fe != NULL) { in frontend_init()
627 card->fe->ops.tuner_ops.set_params = vp3021_alps_tded4_tuner_set_params; in frontend_init()
634 card->fe = dvb_attach(mt352_attach, &digitv_alps_tded4_config, card->i2c_adapter); in frontend_init()
636 if (card->fe != NULL) { in frontend_init()
637 card->fe->ops.tuner_ops.calc_regs = digitv_alps_tded4_tuner_calc_regs; in frontend_init()
643 card->fe = dvb_attach(sp887x_attach, &microtune_mt7202dtf_config, card->i2c_adapter); in frontend_init()
644 if (card->fe) { in frontend_init()
645 card->fe->ops.tuner_ops.set_params = microtune_mt7202dtf_tuner_set_params; in frontend_init()
650 card->fe = dvb_attach(mt352_attach, &advbt771_samsung_tdtc9251dh0_config, card->i2c_adapter); in frontend_init()
651 if (card->fe != NULL) { in frontend_init()
652 card->fe->ops.tuner_ops.calc_regs = advbt771_samsung_tdtc9251dh0_tuner_calc_regs; in frontend_init()
653 card->fe->ops.info.frequency_min_hz = 174 * MHz; in frontend_init()
654 card->fe->ops.info.frequency_max_hz = 862 * MHz; in frontend_init()
666 state->config = &dst_config; in frontend_init()
667 state->i2c = card->i2c_adapter; in frontend_init()
668 state->bt = card->bt; in frontend_init()
669 state->dst_ca = NULL; in frontend_init()
671 if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) { in frontend_init()
678 card->fe = &state->frontend; in frontend_init()
679 if (state->dst_hw_cap & DST_TYPE_HAS_CA) in frontend_init()
680 dvb_attach(dst_ca_attach, state, &card->dvb_adapter); in frontend_init()
684 card->fe = dvb_attach(cx24110_attach, &pctvsat_config, card->i2c_adapter); in frontend_init()
685 if (card->fe) { in frontend_init()
686 card->fe->ops.tuner_ops.init = pinnsat_tuner_init; in frontend_init()
687 card->fe->ops.tuner_ops.sleep = pinnsat_tuner_sleep; in frontend_init()
688 card->fe->ops.tuner_ops.set_params = cx24108_tuner_set_params; in frontend_init()
693 card->fe = dvb_attach(or51211_attach, &or51211_config, card->i2c_adapter); in frontend_init()
694 if (card->fe != NULL) in frontend_init()
695 dvb_attach(simple_tuner_attach, card->fe, in frontend_init()
696 card->i2c_adapter, 0x61, in frontend_init()
701 if (card->fe == NULL) in frontend_init()
703 card->bt->dev->vendor, in frontend_init()
704 card->bt->dev->device, in frontend_init()
705 card->bt->dev->subsystem_vendor, in frontend_init()
706 card->bt->dev->subsystem_device); in frontend_init()
708 if (dvb_register_frontend(&card->dvb_adapter, card->fe)) { in frontend_init()
710 dvb_frontend_detach(card->fe); in frontend_init()
711 card->fe = NULL; in frontend_init()
719 result = dvb_register_adapter(&card->dvb_adapter, card->card_name, in dvb_bt8xx_load_card()
720 THIS_MODULE, &card->bt->dev->dev, in dvb_bt8xx_load_card()
726 card->dvb_adapter.priv = card; in dvb_bt8xx_load_card()
728 card->bt->adapter = card->i2c_adapter; in dvb_bt8xx_load_card()
730 memset(&card->demux, 0, sizeof(struct dvb_demux)); in dvb_bt8xx_load_card()
732 …card->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERI… in dvb_bt8xx_load_card()
734 card->demux.priv = card; in dvb_bt8xx_load_card()
735 card->demux.filternum = 256; in dvb_bt8xx_load_card()
736 card->demux.feednum = 256; in dvb_bt8xx_load_card()
737 card->demux.start_feed = dvb_bt8xx_start_feed; in dvb_bt8xx_load_card()
738 card->demux.stop_feed = dvb_bt8xx_stop_feed; in dvb_bt8xx_load_card()
739 card->demux.write_to_decoder = NULL; in dvb_bt8xx_load_card()
741 result = dvb_dmx_init(&card->demux); in dvb_bt8xx_load_card()
747 card->dmxdev.filternum = 256; in dvb_bt8xx_load_card()
748 card->dmxdev.demux = &card->demux.dmx; in dvb_bt8xx_load_card()
749 card->dmxdev.capabilities = 0; in dvb_bt8xx_load_card()
751 result = dvb_dmxdev_init(&card->dmxdev, &card->dvb_adapter); in dvb_bt8xx_load_card()
757 card->fe_hw.source = DMX_FRONTEND_0; in dvb_bt8xx_load_card()
759 result = card->demux.dmx.add_frontend(&card->demux.dmx, &card->fe_hw); in dvb_bt8xx_load_card()
765 card->fe_mem.source = DMX_MEMORY_FE; in dvb_bt8xx_load_card()
767 result = card->demux.dmx.add_frontend(&card->demux.dmx, &card->fe_mem); in dvb_bt8xx_load_card()
773 result = card->demux.dmx.connect_frontend(&card->demux.dmx, &card->fe_hw); in dvb_bt8xx_load_card()
779 result = dvb_net_init(&card->dvb_adapter, &card->dvbnet, &card->demux.dmx); in dvb_bt8xx_load_card()
785 INIT_WORK(&card->bt->bh_work, dvb_bt8xx_work); in dvb_bt8xx_load_card()
792 card->demux.dmx.disconnect_frontend(&card->demux.dmx); in dvb_bt8xx_load_card()
794 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_mem); in dvb_bt8xx_load_card()
796 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw); in dvb_bt8xx_load_card()
798 dvb_dmxdev_release(&card->dmxdev); in dvb_bt8xx_load_card()
800 dvb_dmx_release(&card->demux); in dvb_bt8xx_load_card()
802 dvb_unregister_adapter(&card->dvb_adapter); in dvb_bt8xx_load_card()
813 return -ENOMEM; in dvb_bt8xx_probe()
815 mutex_init(&card->lock); in dvb_bt8xx_probe()
816 card->bttv_nr = sub->core->nr; in dvb_bt8xx_probe()
817 strscpy(card->card_name, sub->core->v4l2_dev.name, in dvb_bt8xx_probe()
818 sizeof(card->card_name)); in dvb_bt8xx_probe()
819 card->i2c_adapter = &sub->core->i2c_adap; in dvb_bt8xx_probe()
821 switch(sub->core->type) { in dvb_bt8xx_probe()
823 card->gpio_mode = 0x0400c060; in dvb_bt8xx_probe()
826 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
827 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
831 card->gpio_mode = 0x0400C060; in dvb_bt8xx_probe()
832 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
833 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
840 card->gpio_mode = 0x0400c060; in dvb_bt8xx_probe()
841 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
842 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
847 card->gpio_mode = (1 << 26) | (1 << 14) | (1 << 5); in dvb_bt8xx_probe()
848 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
849 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
854 card->gpio_mode = 0x0400402B; in dvb_bt8xx_probe()
855 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
856 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
861 card->gpio_mode = 0x2204f2c; in dvb_bt8xx_probe()
862 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
863 card->irq_err_ignore = BT878_APABORT | BT878_ARIPERR | in dvb_bt8xx_probe()
879 card->gpio_mode = 0x0100EC7B; in dvb_bt8xx_probe()
880 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
881 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
885 pr_err("Unknown bttv card type: %d\n", sub->core->type); in dvb_bt8xx_probe()
887 return -ENODEV; in dvb_bt8xx_probe()
890 dprintk("dvb_bt8xx: identified card%d as %s\n", card->bttv_nr, card->card_name); in dvb_bt8xx_probe()
892 if (!(bttv_pci_dev = bttv_get_pcidev(card->bttv_nr))) { in dvb_bt8xx_probe()
893 pr_err("no pci device for card %d\n", card->bttv_nr); in dvb_bt8xx_probe()
895 return -ENODEV; in dvb_bt8xx_probe()
898 if (!(card->bt = dvb_bt8xx_878_match(card->bttv_nr, bttv_pci_dev))) { in dvb_bt8xx_probe()
899 pr_err("unable to determine DMA core of card %d,\n", card->bttv_nr); in dvb_bt8xx_probe()
903 return -ENODEV; in dvb_bt8xx_probe()
906 mutex_init(&card->bt->gpio_lock); in dvb_bt8xx_probe()
907 card->bt->bttv_nr = sub->core->nr; in dvb_bt8xx_probe()
909 if ( (ret = dvb_bt8xx_load_card(card, sub->core->type)) ) { in dvb_bt8xx_probe()
914 dev_set_drvdata(&sub->dev, card); in dvb_bt8xx_probe()
920 struct dvb_bt8xx_card *card = dev_get_drvdata(&sub->dev); in dvb_bt8xx_remove()
922 dprintk("dvb_bt8xx: unloading card%d\n", card->bttv_nr); in dvb_bt8xx_remove()
924 bt878_stop(card->bt); in dvb_bt8xx_remove()
925 cancel_work_sync(&card->bt->bh_work); in dvb_bt8xx_remove()
926 dvb_net_release(&card->dvbnet); in dvb_bt8xx_remove()
927 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_mem); in dvb_bt8xx_remove()
928 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw); in dvb_bt8xx_remove()
929 dvb_dmxdev_release(&card->dmxdev); in dvb_bt8xx_remove()
930 dvb_dmx_release(&card->demux); in dvb_bt8xx_remove()
931 if (card->fe) { in dvb_bt8xx_remove()
932 dvb_unregister_frontend(card->fe); in dvb_bt8xx_remove()
933 dvb_frontend_detach(card->fe); in dvb_bt8xx_remove()
935 dvb_unregister_adapter(&card->dvb_adapter); in dvb_bt8xx_remove()
942 .name = "dvb-bt8xx",