Lines Matching refs:ttusb
83 struct ttusb { struct
137 static int ttusb_cmd(struct ttusb *ttusb, in ttusb_cmd() argument
151 if (mutex_lock_interruptible(&ttusb->semusb) < 0) in ttusb_cmd()
154 err = usb_bulk_msg(ttusb->dev, ttusb->bulk_out_pipe, in ttusb_cmd()
159 mutex_unlock(&ttusb->semusb); in ttusb_cmd()
165 mutex_unlock(&ttusb->semusb); in ttusb_cmd()
169 err = usb_bulk_msg(ttusb->dev, ttusb->bulk_in_pipe, in ttusb_cmd()
170 ttusb->last_result, 32, &actual_len, 1000); in ttusb_cmd()
175 mutex_unlock(&ttusb->semusb); in ttusb_cmd()
180 actual_len = ttusb->last_result[3] + 4; in ttusb_cmd()
183 printk(KERN_CONT " %02x", ttusb->last_result[i]); in ttusb_cmd()
188 mutex_unlock(&ttusb->semusb); in ttusb_cmd()
192 static int ttusb_result(struct ttusb *ttusb, u8 * data, int len) in ttusb_result() argument
194 memcpy(data, ttusb->last_result, len); in ttusb_result()
195 mutex_unlock(&ttusb->semusb); in ttusb_result()
199 static int ttusb_i2c_msg(struct ttusb *ttusb, in ttusb_i2c_msg() argument
204 u8 id = ++ttusb->c; in ttusb_i2c_msg()
221 err = ttusb_cmd(ttusb, b, snd_len + 7, 1); in ttusb_i2c_msg()
226 err = ttusb_result(ttusb, b, 0x20); in ttusb_i2c_msg()
249 struct ttusb *ttusb = i2c_get_adapdata(adapter); in master_xfer() local
253 if (mutex_lock_interruptible(&ttusb->semi2c) < 0) in master_xfer()
276 err = ttusb_i2c_msg(ttusb, addr, in master_xfer()
287 mutex_unlock(&ttusb->semi2c); in master_xfer()
291 static int ttusb_boot_dsp(struct ttusb *ttusb) in ttusb_boot_dsp() argument
298 &ttusb->dev->dev); in ttusb_boot_dsp()
314 b[1] = ++ttusb->c; in ttusb_boot_dsp()
316 err = ttusb_cmd(ttusb, b, 32, 0); in ttusb_boot_dsp()
322 b[1] = ++ttusb->c; in ttusb_boot_dsp()
326 err = ttusb_cmd(ttusb, b, 4, 0); in ttusb_boot_dsp()
331 b[1] = ++ttusb->c; in ttusb_boot_dsp()
335 err = ttusb_cmd(ttusb, b, 4, 0); in ttusb_boot_dsp()
347 static int ttusb_set_channel(struct ttusb *ttusb, int chan_id, int filter_type, in ttusb_set_channel() argument
352 u8 b[] = { 0xaa, ++ttusb->c, 0x22, 4, chan_id, filter_type, in ttusb_set_channel()
356 err = ttusb_cmd(ttusb, b, sizeof(b), 0); in ttusb_set_channel()
360 static int ttusb_del_channel(struct ttusb *ttusb, int channel_id) in ttusb_del_channel() argument
364 u8 b[] = { 0xaa, ++ttusb->c, 0x23, 1, channel_id }; in ttusb_del_channel()
366 err = ttusb_cmd(ttusb, b, sizeof(b), 0); in ttusb_del_channel()
371 static int ttusb_set_filter(struct ttusb *ttusb, int filter_id, in ttusb_set_filter() argument
385 err = ttusb_cmd(ttusb, b, sizeof(b), 0); in ttusb_set_filter()
389 static int ttusb_del_filter(struct ttusb *ttusb, int filter_id) in ttusb_del_filter() argument
393 u8 b[] = { 0xaa, ++ttusb->c, 0x25, 1, filter_id }; in ttusb_del_filter()
395 err = ttusb_cmd(ttusb, b, sizeof(b), 0); in ttusb_del_filter()
400 static int ttusb_init_controller(struct ttusb *ttusb) in ttusb_init_controller() argument
402 u8 b0[] = { 0xaa, ++ttusb->c, 0x15, 1, 0 }; in ttusb_init_controller()
403 u8 b1[] = { 0xaa, ++ttusb->c, 0x15, 1, 1 }; in ttusb_init_controller()
404 u8 b2[] = { 0xaa, ++ttusb->c, 0x32, 1, 0 }; in ttusb_init_controller()
407 { 0xaa, ++ttusb->c, 0x31, 5, 0x10, 0x02, 0x01, 0x00, 0x1e }; in ttusb_init_controller()
409 { 0x55, ttusb->c, 0x31, 4, 0x10, 0x02, 0x01, 0x00, 0x1e }; in ttusb_init_controller()
411 u8 get_version[] = { 0xaa, ++ttusb->c, 0x17, 5, 0, 0, 0, 0, 0 }; in ttusb_init_controller()
413 { 0xaa, ++ttusb->c, 0x26, 28, 0, 0, 0, 0, 0 }; in ttusb_init_controller()
417 if ((err = ttusb_cmd(ttusb, b0, sizeof(b0), 0))) in ttusb_init_controller()
421 if ((err = ttusb_cmd(ttusb, b1, sizeof(b1), 0))) in ttusb_init_controller()
424 ttusb_boot_dsp(ttusb); in ttusb_init_controller()
427 if ((err = ttusb_cmd(ttusb, b2, sizeof(b2), 0))) in ttusb_init_controller()
430 if ((err = ttusb_cmd(ttusb, b3, sizeof(b3), 1))) in ttusb_init_controller()
433 err = ttusb_result(ttusb, b4, sizeof(b4)); in ttusb_init_controller()
435 if ((err = ttusb_cmd(ttusb, get_version, sizeof(get_version), 1))) in ttusb_init_controller()
438 if ((err = ttusb_result(ttusb, get_version, sizeof(get_version)))) in ttusb_init_controller()
455 ttusb->revision = ((get_version[6] - '0') << 4) | in ttusb_init_controller()
459 ttusb_cmd(ttusb, get_dsp_version, sizeof(get_dsp_version), 1); in ttusb_init_controller()
464 ttusb_result(ttusb, get_dsp_version, sizeof(get_dsp_version)); in ttusb_init_controller()
476 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in ttusb_send_diseqc() local
477 u8 b[12] = { 0xaa, ++ttusb->c, 0x18 }; in ttusb_send_diseqc()
488 if ((err = ttusb_cmd(ttusb, b, 4 + b[3], 0))) { in ttusb_send_diseqc()
497 static int ttusb_update_lnb(struct ttusb *ttusb) in ttusb_update_lnb() argument
499 u8 b[] = { 0xaa, ++ttusb->c, 0x16, 5, /*power: */ 1, in ttusb_update_lnb()
500 ttusb->voltage == SEC_VOLTAGE_18 ? 0 : 1, in ttusb_update_lnb()
501 ttusb->tone == SEC_TONE_ON ? 1 : 0, 1, 1 in ttusb_update_lnb()
506 if ((err = ttusb_cmd(ttusb, b, sizeof(b), 0))) { in ttusb_update_lnb()
517 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in ttusb_set_voltage() local
519 ttusb->voltage = voltage; in ttusb_set_voltage()
520 return ttusb_update_lnb(ttusb); in ttusb_set_voltage()
526 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in ttusb_set_tone() local
528 ttusb->tone = tone; in ttusb_set_tone()
529 return ttusb_update_lnb(ttusb); in ttusb_set_tone()
535 static void ttusb_set_led_freq(struct ttusb *ttusb, u8 freq)
537 u8 b[] = { 0xaa, ++ttusb->c, 0x19, 1, freq };
540 err = ttusb_cmd(ttusb, b, sizeof(b), 0);
560 static void ttusb_process_muxpack(struct ttusb *ttusb, const u8 * muxpack, in ttusb_process_muxpack() argument
583 if ((cc != ttusb->cc) && (ttusb->cc != -1)) in ttusb_process_muxpack()
585 __func__, (cc - ttusb->cc) & 0x7FFF); in ttusb_process_muxpack()
586 ttusb->cc = (cc + 1) & 0x7FFF; in ttusb_process_muxpack()
598 ttusb_handle_sec_data(ttusb->channel + channel, data, in ttusb_process_muxpack()
602 if ((!!(ttusb->muxpack[0] & 0x20)) ^ in ttusb_process_muxpack()
603 !!(ttusb->muxpack[1] & 1)) in ttusb_process_muxpack()
615 if (ttusb->channel[channel].active in ttusb_process_muxpack()
616 && (pid == ttusb->channel[channel].pid)) in ttusb_process_muxpack()
617 ttusb_handle_ts_data(ttusb->channel + in ttusb_process_muxpack()
622 dvb_dmx_swfilter_packets(&ttusb->dvb_demux, muxpack, 1); in ttusb_process_muxpack()
630 static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len) in ttusb_process_frame() argument
639 switch (ttusb->mux_state) { in ttusb_process_frame()
645 ++ttusb->mux_state; in ttusb_process_frame()
647 ttusb->mux_state = 0; in ttusb_process_frame()
648 if (ttusb->insync) { in ttusb_process_frame()
653 ttusb->insync = 0; in ttusb_process_frame()
658 ttusb->insync = 1; in ttusb_process_frame()
660 ttusb->mux_npacks = *data++; in ttusb_process_frame()
661 ++ttusb->mux_state; in ttusb_process_frame()
662 ttusb->muxpack_ptr = 0; in ttusb_process_frame()
664 ttusb->muxpack_len = 2; in ttusb_process_frame()
671 (ttusb->muxpack_len - in ttusb_process_frame()
672 ttusb->muxpack_ptr)) in ttusb_process_frame()
674 ttusb->muxpack_len - in ttusb_process_frame()
675 ttusb->muxpack_ptr; in ttusb_process_frame()
676 memcpy(ttusb->muxpack + ttusb->muxpack_ptr, in ttusb_process_frame()
678 ttusb->muxpack_ptr += avail; in ttusb_process_frame()
679 BUG_ON(ttusb->muxpack_ptr > 264); in ttusb_process_frame()
683 if (ttusb->muxpack_ptr == 2) { in ttusb_process_frame()
684 if (ttusb->muxpack[0] & 0x80) { in ttusb_process_frame()
685 ttusb->muxpack_len = in ttusb_process_frame()
686 ttusb->muxpack[1] + 2; in ttusb_process_frame()
687 if (ttusb-> in ttusb_process_frame()
689 ttusb-> in ttusb_process_frame()
692 (ttusb-> in ttusb_process_frame()
694 !!(ttusb-> in ttusb_process_frame()
696 ttusb-> in ttusb_process_frame()
698 ttusb->muxpack_len += 4; in ttusb_process_frame()
699 } else if (ttusb->muxpack[0] == in ttusb_process_frame()
701 ttusb->muxpack_len = in ttusb_process_frame()
703 else if (ttusb->muxpack[0] == 0x00) in ttusb_process_frame()
704 ttusb->muxpack_len = in ttusb_process_frame()
705 ttusb->muxpack[1] + 2 + in ttusb_process_frame()
711 ttusb->muxpack[0]); in ttusb_process_frame()
712 ttusb->mux_state = 0; in ttusb_process_frame()
720 if ((ttusb->muxpack_ptr >= 2) && in ttusb_process_frame()
721 (ttusb->muxpack_ptr == in ttusb_process_frame()
722 ttusb->muxpack_len)) { in ttusb_process_frame()
723 ttusb_process_muxpack(ttusb, in ttusb_process_frame()
724 ttusb-> in ttusb_process_frame()
726 ttusb-> in ttusb_process_frame()
728 ttusb->muxpack_ptr = 0; in ttusb_process_frame()
730 ttusb->muxpack_len = 2; in ttusb_process_frame()
736 if (!ttusb->mux_npacks--) { in ttusb_process_frame()
737 ttusb->mux_state = 0; in ttusb_process_frame()
752 struct ttusb *ttusb = urb->context; in ttusb_iso_irq() local
757 if (!ttusb->iso_streaming) in ttusb_iso_irq()
784 ttusb_process_frame(ttusb, data, len); in ttusb_iso_irq()
790 static void ttusb_free_iso_urbs(struct ttusb *ttusb) in ttusb_free_iso_urbs() argument
795 usb_free_urb(ttusb->iso_urb[i]); in ttusb_free_iso_urbs()
799 ISO_BUF_COUNT, ttusb->iso_buffer, in ttusb_free_iso_urbs()
800 ttusb->iso_dma_handle); in ttusb_free_iso_urbs()
803 static int ttusb_alloc_iso_urbs(struct ttusb *ttusb) in ttusb_alloc_iso_urbs() argument
807 ttusb->iso_buffer = pci_zalloc_consistent(NULL, in ttusb_alloc_iso_urbs()
809 &ttusb->iso_dma_handle); in ttusb_alloc_iso_urbs()
811 if (!ttusb->iso_buffer) { in ttusb_alloc_iso_urbs()
823 ttusb_free_iso_urbs(ttusb); in ttusb_alloc_iso_urbs()
827 ttusb->iso_urb[i] = urb; in ttusb_alloc_iso_urbs()
833 static void ttusb_stop_iso_xfer(struct ttusb *ttusb) in ttusb_stop_iso_xfer() argument
838 usb_kill_urb(ttusb->iso_urb[i]); in ttusb_stop_iso_xfer()
840 ttusb->iso_streaming = 0; in ttusb_stop_iso_xfer()
843 static int ttusb_start_iso_xfer(struct ttusb *ttusb) in ttusb_start_iso_xfer() argument
847 if (ttusb->iso_streaming) { in ttusb_start_iso_xfer()
852 ttusb->cc = -1; in ttusb_start_iso_xfer()
853 ttusb->insync = 0; in ttusb_start_iso_xfer()
854 ttusb->mux_state = 0; in ttusb_start_iso_xfer()
858 struct urb *urb = ttusb->iso_urb[i]; in ttusb_start_iso_xfer()
860 urb->dev = ttusb->dev; in ttusb_start_iso_xfer()
861 urb->context = ttusb; in ttusb_start_iso_xfer()
863 urb->pipe = ttusb->isoc_in_pipe; in ttusb_start_iso_xfer()
869 urb->transfer_buffer = ttusb->iso_buffer + buffer_offset; in ttusb_start_iso_xfer()
880 if ((err = usb_submit_urb(ttusb->iso_urb[i], GFP_ATOMIC))) { in ttusb_start_iso_xfer()
881 ttusb_stop_iso_xfer(ttusb); in ttusb_start_iso_xfer()
889 ttusb->iso_streaming = 1; in ttusb_start_iso_xfer()
912 struct ttusb *ttusb = (struct ttusb *) dvbdmxfeed->demux; in ttusb_start_feed() local
948 ttusb_set_channel(ttusb, dvbdmxfeed->index, feed_type, dvbdmxfeed->pid); in ttusb_start_feed()
950 if (0 == ttusb->running_feed_count++) in ttusb_start_feed()
951 ttusb_start_iso_xfer(ttusb); in ttusb_start_feed()
958 struct ttusb *ttusb = (struct ttusb *) dvbdmxfeed->demux; in ttusb_stop_feed() local
960 ttusb_del_channel(ttusb, dvbdmxfeed->index); in ttusb_stop_feed()
962 if (--ttusb->running_feed_count == 0) in ttusb_stop_feed()
963 ttusb_stop_iso_xfer(ttusb); in ttusb_stop_feed()
968 static int ttusb_setup_interfaces(struct ttusb *ttusb) in ttusb_setup_interfaces() argument
970 usb_set_interface(ttusb->dev, 1, 1); in ttusb_setup_interfaces()
972 ttusb->bulk_out_pipe = usb_sndbulkpipe(ttusb->dev, 1); in ttusb_setup_interfaces()
973 ttusb->bulk_in_pipe = usb_rcvbulkpipe(ttusb->dev, 1); in ttusb_setup_interfaces()
974 ttusb->isoc_in_pipe = usb_rcvisocpipe(ttusb->dev, 2); in ttusb_setup_interfaces()
984 struct ttusb *ttusb = file->private_data;
989 ttusb_i2c_msg(ttusb, 0x50, snd_buf, 2, stc_firmware + addr,
1025 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in alps_tdmb7_tuner_set_params() local
1039 if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) return -EIO; in alps_tdmb7_tuner_set_params()
1053 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tdm1316l_tuner_init() local
1061 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) return -EIO; in philips_tdm1316l_tuner_init()
1070 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) { in philips_tdm1316l_tuner_init()
1071 i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1); in philips_tdm1316l_tuner_init()
1080 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tdm1316l_tuner_set_params() local
1144 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) in philips_tdm1316l_tuner_set_params()
1153 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tdm1316l_request_firmware() local
1155 return request_firmware(fw, name, &ttusb->dev->dev); in philips_tdm1316l_request_firmware()
1287 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tsa5059_tuner_set_params() local
1305 if (ttusb->revision == TTUSB_REV_2_2) in philips_tsa5059_tuner_set_params()
1310 if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) in philips_tsa5059_tuner_set_params()
1331 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in ttusb_novas_grundig_29504_491_tuner_set_params() local
1345 if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) in ttusb_novas_grundig_29504_491_tuner_set_params()
1359 struct ttusb* ttusb = fe->dvb->priv; in alps_tdbe2_tuner_set_params() local
1373 if (i2c_transfer (&ttusb->i2c_adap, &msg, 1) != 1) in alps_tdbe2_tuner_set_params()
1387 static u8 read_pwm(struct ttusb* ttusb) in read_pwm() argument
1394 if ((i2c_transfer(&ttusb->i2c_adap, msg, 2) != 2) || (pwm == 0xff)) in read_pwm()
1404 struct ttusb *ttusb = (struct ttusb *) fe->dvb->priv; in dvbc_philips_tdm1316l_tuner_set_params() local
1443 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) { in dvbc_philips_tdm1316l_tuner_set_params()
1452 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) { in dvbc_philips_tdm1316l_tuner_set_params()
1570 static void frontend_init(struct ttusb* ttusb) in frontend_init() argument
1572 switch(le16_to_cpu(ttusb->dev->descriptor.idProduct)) { in frontend_init()
1575 ttusb->fe = dvb_attach(stv0299_attach, &alps_stv0299_config, &ttusb->i2c_adap); in frontend_init()
1576 if (ttusb->fe != NULL) { in frontend_init()
1577 ttusb->fe->ops.tuner_ops.set_params = philips_tsa5059_tuner_set_params; in frontend_init()
1579 if(ttusb->revision == TTUSB_REV_2_2) { // ALPS BSBE1 in frontend_init()
1581 dvb_attach(lnbp21_attach, ttusb->fe, &ttusb->i2c_adap, 0, 0); in frontend_init()
1583 ttusb->fe->ops.set_voltage = ttusb_set_voltage; in frontend_init()
1589 ttusb->fe = dvb_attach(tda8083_attach, &ttusb_novas_grundig_29504_491_config, &ttusb->i2c_adap); in frontend_init()
1590 if (ttusb->fe != NULL) { in frontend_init()
1591 ttusb->fe->ops.tuner_ops.set_params = ttusb_novas_grundig_29504_491_tuner_set_params; in frontend_init()
1592 ttusb->fe->ops.set_voltage = ttusb_set_voltage; in frontend_init()
1598 ttusb->fe = dvb_attach(ves1820_attach, &alps_tdbe2_config, &ttusb->i2c_adap, read_pwm(ttusb)); in frontend_init()
1599 if (ttusb->fe != NULL) { in frontend_init()
1600 ttusb->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; in frontend_init()
1604 ttusb->fe = dvb_attach(stv0297_attach, &dvbc_philips_tdm1316l_config, &ttusb->i2c_adap); in frontend_init()
1605 if (ttusb->fe != NULL) { in frontend_init()
1606 ttusb->fe->ops.tuner_ops.set_params = dvbc_philips_tdm1316l_tuner_set_params; in frontend_init()
1613 ttusb->fe = dvb_attach(cx22700_attach, &alps_tdmb7_config, &ttusb->i2c_adap); in frontend_init()
1614 if (ttusb->fe != NULL) { in frontend_init()
1615 ttusb->fe->ops.tuner_ops.set_params = alps_tdmb7_tuner_set_params; in frontend_init()
1620 ttusb->fe = dvb_attach(tda10046_attach, &philips_tdm1316l_config, &ttusb->i2c_adap); in frontend_init()
1621 if (ttusb->fe != NULL) { in frontend_init()
1622 ttusb->fe->ops.tuner_ops.init = philips_tdm1316l_tuner_init; in frontend_init()
1623 ttusb->fe->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params; in frontend_init()
1629 if (ttusb->fe == NULL) { in frontend_init()
1631 le16_to_cpu(ttusb->dev->descriptor.idVendor), in frontend_init()
1632 le16_to_cpu(ttusb->dev->descriptor.idProduct)); in frontend_init()
1634 if (dvb_register_frontend(&ttusb->adapter, ttusb->fe)) { in frontend_init()
1636 dvb_frontend_detach(ttusb->fe); in frontend_init()
1637 ttusb->fe = NULL; in frontend_init()
1652 struct ttusb *ttusb; in ttusb_probe() local
1661 if (!(ttusb = kzalloc(sizeof(struct ttusb), GFP_KERNEL))) in ttusb_probe()
1664 ttusb->dev = udev; in ttusb_probe()
1665 ttusb->c = 0; in ttusb_probe()
1666 ttusb->mux_state = 0; in ttusb_probe()
1667 mutex_init(&ttusb->semi2c); in ttusb_probe()
1669 mutex_lock(&ttusb->semi2c); in ttusb_probe()
1671 mutex_init(&ttusb->semusb); in ttusb_probe()
1673 ttusb_setup_interfaces(ttusb); in ttusb_probe()
1675 result = ttusb_alloc_iso_urbs(ttusb); in ttusb_probe()
1678 mutex_unlock(&ttusb->semi2c); in ttusb_probe()
1679 kfree(ttusb); in ttusb_probe()
1683 if (ttusb_init_controller(ttusb)) in ttusb_probe()
1686 mutex_unlock(&ttusb->semi2c); in ttusb_probe()
1688 result = dvb_register_adapter(&ttusb->adapter, in ttusb_probe()
1692 ttusb_free_iso_urbs(ttusb); in ttusb_probe()
1693 kfree(ttusb); in ttusb_probe()
1696 ttusb->adapter.priv = ttusb; in ttusb_probe()
1699 memset(&ttusb->i2c_adap, 0, sizeof(struct i2c_adapter)); in ttusb_probe()
1700 strcpy(ttusb->i2c_adap.name, "TTUSB DEC"); in ttusb_probe()
1702 i2c_set_adapdata(&ttusb->i2c_adap, ttusb); in ttusb_probe()
1704 ttusb->i2c_adap.algo = &ttusb_dec_algo; in ttusb_probe()
1705 ttusb->i2c_adap.algo_data = NULL; in ttusb_probe()
1706 ttusb->i2c_adap.dev.parent = &udev->dev; in ttusb_probe()
1708 result = i2c_add_adapter(&ttusb->i2c_adap); in ttusb_probe()
1712 memset(&ttusb->dvb_demux, 0, sizeof(ttusb->dvb_demux)); in ttusb_probe()
1714 ttusb->dvb_demux.dmx.capabilities = in ttusb_probe()
1716 ttusb->dvb_demux.priv = NULL; in ttusb_probe()
1718 ttusb->dvb_demux.filternum = TTUSB_MAXFILTER; in ttusb_probe()
1720 ttusb->dvb_demux.filternum = 32; in ttusb_probe()
1722 ttusb->dvb_demux.feednum = TTUSB_MAXCHANNEL; in ttusb_probe()
1723 ttusb->dvb_demux.start_feed = ttusb_start_feed; in ttusb_probe()
1724 ttusb->dvb_demux.stop_feed = ttusb_stop_feed; in ttusb_probe()
1725 ttusb->dvb_demux.write_to_decoder = NULL; in ttusb_probe()
1727 result = dvb_dmx_init(&ttusb->dvb_demux); in ttusb_probe()
1734 ttusb->dmxdev.filternum = ttusb->dvb_demux.filternum; in ttusb_probe()
1735 ttusb->dmxdev.demux = &ttusb->dvb_demux.dmx; in ttusb_probe()
1736 ttusb->dmxdev.capabilities = 0; in ttusb_probe()
1738 result = dvb_dmxdev_init(&ttusb->dmxdev, &ttusb->adapter); in ttusb_probe()
1746 if (dvb_net_init(&ttusb->adapter, &ttusb->dvbnet, &ttusb->dvb_demux.dmx)) { in ttusb_probe()
1752 usb_set_intfdata(intf, (void *) ttusb); in ttusb_probe()
1754 frontend_init(ttusb); in ttusb_probe()
1759 dvb_dmxdev_release(&ttusb->dmxdev); in ttusb_probe()
1761 dvb_dmx_release(&ttusb->dvb_demux); in ttusb_probe()
1763 i2c_del_adapter(&ttusb->i2c_adap); in ttusb_probe()
1765 dvb_unregister_adapter (&ttusb->adapter); in ttusb_probe()
1766 ttusb_free_iso_urbs(ttusb); in ttusb_probe()
1767 kfree(ttusb); in ttusb_probe()
1773 struct ttusb *ttusb = usb_get_intfdata(intf); in ttusb_disconnect() local
1777 ttusb->disconnecting = 1; in ttusb_disconnect()
1779 ttusb_stop_iso_xfer(ttusb); in ttusb_disconnect()
1781 ttusb->dvb_demux.dmx.close(&ttusb->dvb_demux.dmx); in ttusb_disconnect()
1782 dvb_net_release(&ttusb->dvbnet); in ttusb_disconnect()
1783 dvb_dmxdev_release(&ttusb->dmxdev); in ttusb_disconnect()
1784 dvb_dmx_release(&ttusb->dvb_demux); in ttusb_disconnect()
1785 if (ttusb->fe != NULL) { in ttusb_disconnect()
1786 dvb_unregister_frontend(ttusb->fe); in ttusb_disconnect()
1787 dvb_frontend_detach(ttusb->fe); in ttusb_disconnect()
1789 i2c_del_adapter(&ttusb->i2c_adap); in ttusb_disconnect()
1790 dvb_unregister_adapter(&ttusb->adapter); in ttusb_disconnect()
1792 ttusb_free_iso_urbs(ttusb); in ttusb_disconnect()
1794 kfree(ttusb); in ttusb_disconnect()