Lines Matching refs:card
45 struct dvb_bt8xx_card *card = dev_get_drvdata(&bt->adapter->dev); in dvb_bt8xx_task() local
47 dprintk("%d\n", card->bt->finished_block); in dvb_bt8xx_task()
49 while (card->bt->last_block != card->bt->finished_block) { in dvb_bt8xx_task()
50 (card->bt->TS_Size ? dvb_dmx_swfilter_204 : dvb_dmx_swfilter) in dvb_bt8xx_task()
51 (&card->demux, in dvb_bt8xx_task()
52 &card->bt->buf_cpu[card->bt->last_block * in dvb_bt8xx_task()
53 card->bt->block_bytes], in dvb_bt8xx_task()
54 card->bt->block_bytes); in dvb_bt8xx_task()
55 card->bt->last_block = (card->bt->last_block + 1) % in dvb_bt8xx_task()
56 card->bt->block_count; in dvb_bt8xx_task()
63 struct dvb_bt8xx_card *card = dvbdmx->priv; in dvb_bt8xx_start_feed() local
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()
84 struct dvb_bt8xx_card *card = dvbdmx->priv; in dvb_bt8xx_stop_feed() local
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()
241 struct dvb_bt8xx_card *card = fe->dvb->priv; in pinnsat_tuner_init() local
243 bttv_gpio_enable(card->bttv_nr, 1, 1); /* output */ in pinnsat_tuner_init()
244 bttv_write_gpio(card->bttv_nr, 1, 1); /* relay on */ in pinnsat_tuner_init()
251 struct dvb_bt8xx_card *card = fe->dvb->priv; in pinnsat_tuner_sleep() local
253 bttv_write_gpio(card->bttv_nr, 1, 0); /* relay off */ in pinnsat_tuner_sleep()
265 struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv; in microtune_mt7202dtf_tuner_set_params() local
299 i2c_transfer(card->i2c_adapter, &msg, 1); in microtune_mt7202dtf_tuner_set_params()
457 struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv; in vp3021_alps_tded4_tuner_set_params() local
480 i2c_transfer(card->i2c_adapter, &msg, 1); in vp3021_alps_tded4_tuner_set_params()
582 static void frontend_init(struct dvb_bt8xx_card *card, u32 type) in frontend_init() argument
588 card->fe = dvb_attach(mt352_attach, &thomson_dtt7579_config, card->i2c_adapter); in frontend_init()
590 if (card->fe == NULL) in frontend_init()
591 card->fe = dvb_attach(zl10353_attach, &thomson_dtt7579_zl10353_config, in frontend_init()
592 card->i2c_adapter); in frontend_init()
594 if (card->fe != NULL) { in frontend_init()
595 card->fe->ops.tuner_ops.calc_regs = thomson_dtt7579_tuner_calc_regs; in frontend_init()
596 card->fe->ops.info.frequency_min_hz = 174 * MHz; in frontend_init()
597 card->fe->ops.info.frequency_max_hz = 862 * MHz; in frontend_init()
602 lgdt330x_reset(card); in frontend_init()
603 card->fe = dvb_attach(lgdt330x_attach, &tdvs_tua6034_config, in frontend_init()
604 0x0e, card->i2c_adapter); in frontend_init()
605 if (card->fe != NULL) { in frontend_init()
606 dvb_attach(simple_tuner_attach, card->fe, in frontend_init()
607 card->i2c_adapter, 0x61, in frontend_init()
620 digitv_alps_tded4_reset(card); in frontend_init()
621 card->fe = dvb_attach(nxt6000_attach, &vp3021_alps_tded4_config, card->i2c_adapter); in frontend_init()
622 if (card->fe != NULL) { in frontend_init()
623 card->fe->ops.tuner_ops.set_params = vp3021_alps_tded4_tuner_set_params; in frontend_init()
629 digitv_alps_tded4_reset(card); in frontend_init()
630 card->fe = dvb_attach(mt352_attach, &digitv_alps_tded4_config, card->i2c_adapter); in frontend_init()
632 if (card->fe != NULL) { in frontend_init()
633 card->fe->ops.tuner_ops.calc_regs = digitv_alps_tded4_tuner_calc_regs; in frontend_init()
639 card->fe = dvb_attach(sp887x_attach, µtune_mt7202dtf_config, card->i2c_adapter); in frontend_init()
640 if (card->fe) { in frontend_init()
641 card->fe->ops.tuner_ops.set_params = microtune_mt7202dtf_tuner_set_params; in frontend_init()
646 card->fe = dvb_attach(mt352_attach, &advbt771_samsung_tdtc9251dh0_config, card->i2c_adapter); in frontend_init()
647 if (card->fe != NULL) { in frontend_init()
648 card->fe->ops.tuner_ops.calc_regs = advbt771_samsung_tdtc9251dh0_tuner_calc_regs; in frontend_init()
649 card->fe->ops.info.frequency_min_hz = 174 * MHz; in frontend_init()
650 card->fe->ops.info.frequency_max_hz = 862 * MHz; in frontend_init()
663 state->i2c = card->i2c_adapter; in frontend_init()
664 state->bt = card->bt; in frontend_init()
667 if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) { in frontend_init()
674 card->fe = &state->frontend; in frontend_init()
676 dvb_attach(dst_ca_attach, state, &card->dvb_adapter); in frontend_init()
680 card->fe = dvb_attach(cx24110_attach, &pctvsat_config, card->i2c_adapter); in frontend_init()
681 if (card->fe) { in frontend_init()
682 card->fe->ops.tuner_ops.init = pinnsat_tuner_init; in frontend_init()
683 card->fe->ops.tuner_ops.sleep = pinnsat_tuner_sleep; in frontend_init()
684 card->fe->ops.tuner_ops.set_params = cx24108_tuner_set_params; in frontend_init()
689 card->fe = dvb_attach(or51211_attach, &or51211_config, card->i2c_adapter); in frontend_init()
690 if (card->fe != NULL) in frontend_init()
691 dvb_attach(simple_tuner_attach, card->fe, in frontend_init()
692 card->i2c_adapter, 0x61, in frontend_init()
697 if (card->fe == NULL) in frontend_init()
699 card->bt->dev->vendor, in frontend_init()
700 card->bt->dev->device, in frontend_init()
701 card->bt->dev->subsystem_vendor, in frontend_init()
702 card->bt->dev->subsystem_device); in frontend_init()
704 if (dvb_register_frontend(&card->dvb_adapter, card->fe)) { in frontend_init()
706 dvb_frontend_detach(card->fe); in frontend_init()
707 card->fe = NULL; in frontend_init()
711 static int dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) in dvb_bt8xx_load_card() argument
715 result = dvb_register_adapter(&card->dvb_adapter, card->card_name, in dvb_bt8xx_load_card()
716 THIS_MODULE, &card->bt->dev->dev, in dvb_bt8xx_load_card()
722 card->dvb_adapter.priv = card; in dvb_bt8xx_load_card()
724 card->bt->adapter = card->i2c_adapter; in dvb_bt8xx_load_card()
726 memset(&card->demux, 0, sizeof(struct dvb_demux)); in dvb_bt8xx_load_card()
728 …card->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERI… in dvb_bt8xx_load_card()
730 card->demux.priv = card; in dvb_bt8xx_load_card()
731 card->demux.filternum = 256; in dvb_bt8xx_load_card()
732 card->demux.feednum = 256; in dvb_bt8xx_load_card()
733 card->demux.start_feed = dvb_bt8xx_start_feed; in dvb_bt8xx_load_card()
734 card->demux.stop_feed = dvb_bt8xx_stop_feed; in dvb_bt8xx_load_card()
735 card->demux.write_to_decoder = NULL; in dvb_bt8xx_load_card()
737 result = dvb_dmx_init(&card->demux); in dvb_bt8xx_load_card()
743 card->dmxdev.filternum = 256; in dvb_bt8xx_load_card()
744 card->dmxdev.demux = &card->demux.dmx; in dvb_bt8xx_load_card()
745 card->dmxdev.capabilities = 0; in dvb_bt8xx_load_card()
747 result = dvb_dmxdev_init(&card->dmxdev, &card->dvb_adapter); in dvb_bt8xx_load_card()
753 card->fe_hw.source = DMX_FRONTEND_0; in dvb_bt8xx_load_card()
755 result = card->demux.dmx.add_frontend(&card->demux.dmx, &card->fe_hw); in dvb_bt8xx_load_card()
761 card->fe_mem.source = DMX_MEMORY_FE; in dvb_bt8xx_load_card()
763 result = card->demux.dmx.add_frontend(&card->demux.dmx, &card->fe_mem); in dvb_bt8xx_load_card()
769 result = card->demux.dmx.connect_frontend(&card->demux.dmx, &card->fe_hw); in dvb_bt8xx_load_card()
775 result = dvb_net_init(&card->dvb_adapter, &card->dvbnet, &card->demux.dmx); in dvb_bt8xx_load_card()
781 tasklet_setup(&card->bt->tasklet, dvb_bt8xx_task); in dvb_bt8xx_load_card()
783 frontend_init(card, type); in dvb_bt8xx_load_card()
788 card->demux.dmx.disconnect_frontend(&card->demux.dmx); in dvb_bt8xx_load_card()
790 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_mem); in dvb_bt8xx_load_card()
792 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw); in dvb_bt8xx_load_card()
794 dvb_dmxdev_release(&card->dmxdev); in dvb_bt8xx_load_card()
796 dvb_dmx_release(&card->demux); in dvb_bt8xx_load_card()
798 dvb_unregister_adapter(&card->dvb_adapter); in dvb_bt8xx_load_card()
804 struct dvb_bt8xx_card *card; in dvb_bt8xx_probe() local
808 if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL))) in dvb_bt8xx_probe()
811 mutex_init(&card->lock); in dvb_bt8xx_probe()
812 card->bttv_nr = sub->core->nr; in dvb_bt8xx_probe()
813 strscpy(card->card_name, sub->core->v4l2_dev.name, in dvb_bt8xx_probe()
814 sizeof(card->card_name)); in dvb_bt8xx_probe()
815 card->i2c_adapter = &sub->core->i2c_adap; in dvb_bt8xx_probe()
819 card->gpio_mode = 0x0400c060; in dvb_bt8xx_probe()
822 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
823 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
827 card->gpio_mode = 0x0400C060; in dvb_bt8xx_probe()
828 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
829 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
836 card->gpio_mode = 0x0400c060; in dvb_bt8xx_probe()
837 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
838 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
843 card->gpio_mode = (1 << 26) | (1 << 14) | (1 << 5); in dvb_bt8xx_probe()
844 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
845 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
850 card->gpio_mode = 0x0400402B; in dvb_bt8xx_probe()
851 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
852 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
857 card->gpio_mode = 0x2204f2c; in dvb_bt8xx_probe()
858 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
859 card->irq_err_ignore = BT878_APABORT | BT878_ARIPERR | in dvb_bt8xx_probe()
875 card->gpio_mode = 0x0100EC7B; in dvb_bt8xx_probe()
876 card->op_sync_orin = BT878_RISC_SYNC_MASK; in dvb_bt8xx_probe()
877 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR; in dvb_bt8xx_probe()
882 kfree(card); in dvb_bt8xx_probe()
886 dprintk("dvb_bt8xx: identified card%d as %s\n", card->bttv_nr, card->card_name); in dvb_bt8xx_probe()
888 if (!(bttv_pci_dev = bttv_get_pcidev(card->bttv_nr))) { in dvb_bt8xx_probe()
889 pr_err("no pci device for card %d\n", card->bttv_nr); in dvb_bt8xx_probe()
890 kfree(card); in dvb_bt8xx_probe()
894 if (!(card->bt = dvb_bt8xx_878_match(card->bttv_nr, bttv_pci_dev))) { in dvb_bt8xx_probe()
895 pr_err("unable to determine DMA core of card %d,\n", card->bttv_nr); in dvb_bt8xx_probe()
898 kfree(card); in dvb_bt8xx_probe()
902 mutex_init(&card->bt->gpio_lock); in dvb_bt8xx_probe()
903 card->bt->bttv_nr = sub->core->nr; in dvb_bt8xx_probe()
905 if ( (ret = dvb_bt8xx_load_card(card, sub->core->type)) ) { in dvb_bt8xx_probe()
906 kfree(card); in dvb_bt8xx_probe()
910 dev_set_drvdata(&sub->dev, card); in dvb_bt8xx_probe()
916 struct dvb_bt8xx_card *card = dev_get_drvdata(&sub->dev); in dvb_bt8xx_remove() local
918 dprintk("dvb_bt8xx: unloading card%d\n", card->bttv_nr); in dvb_bt8xx_remove()
920 bt878_stop(card->bt); in dvb_bt8xx_remove()
921 tasklet_kill(&card->bt->tasklet); in dvb_bt8xx_remove()
922 dvb_net_release(&card->dvbnet); in dvb_bt8xx_remove()
923 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_mem); in dvb_bt8xx_remove()
924 card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw); in dvb_bt8xx_remove()
925 dvb_dmxdev_release(&card->dmxdev); in dvb_bt8xx_remove()
926 dvb_dmx_release(&card->demux); in dvb_bt8xx_remove()
927 if (card->fe) { in dvb_bt8xx_remove()
928 dvb_unregister_frontend(card->fe); in dvb_bt8xx_remove()
929 dvb_frontend_detach(card->fe); in dvb_bt8xx_remove()
931 dvb_unregister_adapter(&card->dvb_adapter); in dvb_bt8xx_remove()
933 kfree(card); in dvb_bt8xx_remove()