Lines Matching full:card

45 	struct dvb_bt8xx_card *card = dev_get_drvdata(&bt->adapter->dev);  in dvb_bt8xx_work()  local
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()
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()
245 struct dvb_bt8xx_card *card = fe->dvb->priv; in pinnsat_tuner_init() local
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() local
257 bttv_write_gpio(card->bttv_nr, 1, 0); /* relay off */ in pinnsat_tuner_sleep()
269 struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv; in microtune_mt7202dtf_tuner_set_params() local
303 i2c_transfer(card->i2c_adapter, &msg, 1); in microtune_mt7202dtf_tuner_set_params()
461 struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv; in vp3021_alps_tded4_tuner_set_params() local
484 i2c_transfer(card->i2c_adapter, &msg, 1); in vp3021_alps_tded4_tuner_set_params()
586 static void frontend_init(struct dvb_bt8xx_card *card, u32 type) in frontend_init() argument
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()
606 lgdt330x_reset(card); 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()
623 /* Old Nebula (marked (c)2003 on high profile pci card) has nxt6000 demod */ in frontend_init()
624 digitv_alps_tded4_reset(card); 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()
628 dprintk("dvb_bt8xx: an nxt6000 was detected on your digitv card\n"); in frontend_init()
632 /* New Nebula (marked (c)2005 on low profile pci card) has mt352 demod */ in frontend_init()
633 digitv_alps_tded4_reset(card); 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()
638 dprintk("dvb_bt8xx: an mt352 was detected on your digitv card\n"); 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()
665 /* Setup the Card */ in frontend_init()
667 state->i2c = card->i2c_adapter; in frontend_init()
668 state->bt = card->bt; 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()
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()
715 static int dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) in dvb_bt8xx_load_card() argument
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()
732card->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()
787 frontend_init(card, type); 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()
808 struct dvb_bt8xx_card *card; in dvb_bt8xx_probe() local
812 if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL))) 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()
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()
886 kfree(card); 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()
894 kfree(card); 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()
902 kfree(card); 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()
910 kfree(card); 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() local
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()
937 kfree(card); in dvb_bt8xx_remove()