Lines Matching refs:ttusb

90 struct ttusb {  struct
141 static int ttusb_cmd(struct ttusb *ttusb, u8 *data, int len, int len_result) in ttusb_cmd() argument
146 if (mutex_lock_interruptible(&ttusb->semusb) < 0) in ttusb_cmd()
152 memcpy(data, ttusb->send_buf, len); in ttusb_cmd()
154 err = usb_bulk_msg(ttusb->dev, ttusb->bulk_out_pipe, in ttusb_cmd()
155 ttusb->send_buf, len, &actual_len, 1000); in ttusb_cmd()
167 err = usb_bulk_msg(ttusb->dev, ttusb->bulk_in_pipe, in ttusb_cmd()
168 ttusb->last_result, MAX_RCV, &actual_len, 1000); in ttusb_cmd()
176 actual_len = ttusb->last_result[3] + 4; in ttusb_cmd()
177 dprintk("< %*ph\n", actual_len, ttusb->last_result); in ttusb_cmd()
181 memcpy(ttusb->send_buf, ttusb->last_result, len_result); in ttusb_cmd()
184 mutex_unlock(&ttusb->semusb); in ttusb_cmd()
188 static int ttusb_i2c_msg(struct ttusb *ttusb, in ttusb_i2c_msg() argument
193 u8 id = ++ttusb->c; in ttusb_i2c_msg()
210 err = ttusb_cmd(ttusb, b, snd_len + 7, MAX_RCV); in ttusb_i2c_msg()
235 struct ttusb *ttusb = i2c_get_adapdata(adapter); in master_xfer() local
239 if (mutex_lock_interruptible(&ttusb->semi2c) < 0) in master_xfer()
262 err = ttusb_i2c_msg(ttusb, addr, in master_xfer()
273 mutex_unlock(&ttusb->semi2c); in master_xfer()
277 static int ttusb_boot_dsp(struct ttusb *ttusb) in ttusb_boot_dsp() argument
284 &ttusb->dev->dev); in ttusb_boot_dsp()
300 b[1] = ++ttusb->c; in ttusb_boot_dsp()
302 err = ttusb_cmd(ttusb, b, 32, 0); in ttusb_boot_dsp()
308 b[1] = ++ttusb->c; in ttusb_boot_dsp()
312 err = ttusb_cmd(ttusb, b, 4, 0); in ttusb_boot_dsp()
317 b[1] = ++ttusb->c; in ttusb_boot_dsp()
321 err = ttusb_cmd(ttusb, b, 4, 0); in ttusb_boot_dsp()
332 static int ttusb_set_channel(struct ttusb *ttusb, int chan_id, int filter_type, in ttusb_set_channel() argument
337 u8 b[] = { 0xaa, ++ttusb->c, 0x22, 4, chan_id, filter_type, in ttusb_set_channel()
341 err = ttusb_cmd(ttusb, b, sizeof(b), 0); in ttusb_set_channel()
345 static int ttusb_del_channel(struct ttusb *ttusb, int channel_id) in ttusb_del_channel() argument
349 u8 b[] = { 0xaa, ++ttusb->c, 0x23, 1, channel_id }; in ttusb_del_channel()
351 err = ttusb_cmd(ttusb, b, sizeof(b), 0); in ttusb_del_channel()
356 static int ttusb_set_filter(struct ttusb *ttusb, int filter_id, in ttusb_set_filter() argument
370 err = ttusb_cmd(ttusb, b, sizeof(b), 0); in ttusb_set_filter()
374 static int ttusb_del_filter(struct ttusb *ttusb, int filter_id) in ttusb_del_filter() argument
378 u8 b[] = { 0xaa, ++ttusb->c, 0x25, 1, filter_id }; in ttusb_del_filter()
380 err = ttusb_cmd(ttusb, b, sizeof(b), 0); in ttusb_del_filter()
385 static int ttusb_init_controller(struct ttusb *ttusb) in ttusb_init_controller() argument
387 u8 b0[] = { 0xaa, ++ttusb->c, 0x15, 1, 0 }; in ttusb_init_controller()
388 u8 b1[] = { 0xaa, ++ttusb->c, 0x15, 1, 1 }; in ttusb_init_controller()
389 u8 b2[] = { 0xaa, ++ttusb->c, 0x32, 1, 0 }; in ttusb_init_controller()
392 { 0xaa, ++ttusb->c, 0x31, 5, 0x10, 0x02, 0x01, 0x00, 0x1e }; in ttusb_init_controller()
394 u8 get_version[] = { 0xaa, ++ttusb->c, 0x17, 5, 0, 0, 0, 0, 0 }; in ttusb_init_controller()
396 { 0xaa, ++ttusb->c, 0x26, 28, 0, 0, 0, 0, 0 }; in ttusb_init_controller()
400 if ((err = ttusb_cmd(ttusb, b0, sizeof(b0), 0))) in ttusb_init_controller()
404 if ((err = ttusb_cmd(ttusb, b1, sizeof(b1), 0))) in ttusb_init_controller()
407 ttusb_boot_dsp(ttusb); in ttusb_init_controller()
410 if ((err = ttusb_cmd(ttusb, b2, sizeof(b2), 0))) in ttusb_init_controller()
413 if ((err = ttusb_cmd(ttusb, b3, sizeof(b3), 0))) in ttusb_init_controller()
416 if ((err = ttusb_cmd(ttusb, get_version, in ttusb_init_controller()
432 ttusb->revision = ((get_version[6] - '0') << 4) | in ttusb_init_controller()
436 ttusb_cmd(ttusb, get_dsp_version, in ttusb_init_controller()
450 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in ttusb_send_diseqc() local
451 u8 b[12] = { 0xaa, ++ttusb->c, 0x18 }; in ttusb_send_diseqc()
462 if ((err = ttusb_cmd(ttusb, b, 4 + b[3], 0))) { in ttusb_send_diseqc()
470 static int ttusb_update_lnb(struct ttusb *ttusb) in ttusb_update_lnb() argument
472 u8 b[] = { 0xaa, ++ttusb->c, 0x16, 5, /*power: */ 1, in ttusb_update_lnb()
473 ttusb->voltage == SEC_VOLTAGE_18 ? 0 : 1, in ttusb_update_lnb()
474 ttusb->tone == SEC_TONE_ON ? 1 : 0, 1, 1 in ttusb_update_lnb()
479 if ((err = ttusb_cmd(ttusb, b, sizeof(b), 0))) { in ttusb_update_lnb()
489 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in ttusb_set_voltage() local
491 ttusb->voltage = voltage; in ttusb_set_voltage()
492 return ttusb_update_lnb(ttusb); in ttusb_set_voltage()
498 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in ttusb_set_tone() local
500 ttusb->tone = tone; in ttusb_set_tone()
501 return ttusb_update_lnb(ttusb); in ttusb_set_tone()
507 static void ttusb_set_led_freq(struct ttusb *ttusb, u8 freq)
509 u8 b[] = { 0xaa, ++ttusb->c, 0x19, 1, freq };
512 err = ttusb_cmd(ttusb, b, sizeof(b), 0);
531 static void ttusb_process_muxpack(struct ttusb *ttusb, const u8 * muxpack, in ttusb_process_muxpack() argument
553 if ((cc != ttusb->cc) && (ttusb->cc != -1)) in ttusb_process_muxpack()
555 (cc - ttusb->cc) & 0x7FFF); in ttusb_process_muxpack()
556 ttusb->cc = (cc + 1) & 0x7FFF; in ttusb_process_muxpack()
568 ttusb_handle_sec_data(ttusb->channel + channel, data, in ttusb_process_muxpack()
572 if ((!!(ttusb->muxpack[0] & 0x20)) ^ in ttusb_process_muxpack()
573 !!(ttusb->muxpack[1] & 1)) in ttusb_process_muxpack()
585 if (ttusb->channel[channel].active in ttusb_process_muxpack()
586 && (pid == ttusb->channel[channel].pid)) in ttusb_process_muxpack()
587 ttusb_handle_ts_data(ttusb->channel + in ttusb_process_muxpack()
592 dvb_dmx_swfilter_packets(&ttusb->dvb_demux, muxpack, 1); in ttusb_process_muxpack()
600 static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len) in ttusb_process_frame() argument
609 switch (ttusb->mux_state) { in ttusb_process_frame()
615 ++ttusb->mux_state; in ttusb_process_frame()
617 ttusb->mux_state = 0; in ttusb_process_frame()
618 if (ttusb->insync) { in ttusb_process_frame()
620 ttusb->insync = 0; in ttusb_process_frame()
625 ttusb->insync = 1; in ttusb_process_frame()
627 ttusb->mux_npacks = *data++; in ttusb_process_frame()
628 ++ttusb->mux_state; in ttusb_process_frame()
629 ttusb->muxpack_ptr = 0; in ttusb_process_frame()
631 ttusb->muxpack_len = 2; in ttusb_process_frame()
638 (ttusb->muxpack_len - in ttusb_process_frame()
639 ttusb->muxpack_ptr)) in ttusb_process_frame()
641 ttusb->muxpack_len - in ttusb_process_frame()
642 ttusb->muxpack_ptr; in ttusb_process_frame()
643 memcpy(ttusb->muxpack + ttusb->muxpack_ptr, in ttusb_process_frame()
645 ttusb->muxpack_ptr += avail; in ttusb_process_frame()
646 BUG_ON(ttusb->muxpack_ptr > 264); in ttusb_process_frame()
650 if (ttusb->muxpack_ptr == 2) { in ttusb_process_frame()
651 if (ttusb->muxpack[0] & 0x80) { in ttusb_process_frame()
652 ttusb->muxpack_len = in ttusb_process_frame()
653 ttusb->muxpack[1] + 2; in ttusb_process_frame()
654 if (ttusb-> in ttusb_process_frame()
656 ttusb-> in ttusb_process_frame()
659 (ttusb-> in ttusb_process_frame()
661 !!(ttusb-> in ttusb_process_frame()
663 ttusb-> in ttusb_process_frame()
665 ttusb->muxpack_len += 4; in ttusb_process_frame()
666 } else if (ttusb->muxpack[0] == in ttusb_process_frame()
668 ttusb->muxpack_len = in ttusb_process_frame()
670 else if (ttusb->muxpack[0] == 0x00) in ttusb_process_frame()
671 ttusb->muxpack_len = in ttusb_process_frame()
672 ttusb->muxpack[1] + 2 + in ttusb_process_frame()
676 ttusb->muxpack[0]); in ttusb_process_frame()
677 ttusb->mux_state = 0; in ttusb_process_frame()
685 if ((ttusb->muxpack_ptr >= 2) && in ttusb_process_frame()
686 (ttusb->muxpack_ptr == in ttusb_process_frame()
687 ttusb->muxpack_len)) { in ttusb_process_frame()
688 ttusb_process_muxpack(ttusb, in ttusb_process_frame()
689 ttusb-> in ttusb_process_frame()
691 ttusb-> in ttusb_process_frame()
693 ttusb->muxpack_ptr = 0; in ttusb_process_frame()
695 ttusb->muxpack_len = 2; in ttusb_process_frame()
701 if (!ttusb->mux_npacks--) { in ttusb_process_frame()
702 ttusb->mux_state = 0; in ttusb_process_frame()
717 struct ttusb *ttusb = urb->context; in ttusb_iso_irq() local
722 if (!ttusb->iso_streaming) in ttusb_iso_irq()
742 ttusb_process_frame(ttusb, data, len); in ttusb_iso_irq()
748 static void ttusb_free_iso_urbs(struct ttusb *ttusb) in ttusb_free_iso_urbs() argument
753 usb_free_urb(ttusb->iso_urb[i]); in ttusb_free_iso_urbs()
754 kfree(ttusb->iso_buffer); in ttusb_free_iso_urbs()
757 static int ttusb_alloc_iso_urbs(struct ttusb *ttusb) in ttusb_alloc_iso_urbs() argument
761 ttusb->iso_buffer = kcalloc(FRAMES_PER_ISO_BUF * ISO_BUF_COUNT, in ttusb_alloc_iso_urbs()
763 if (!ttusb->iso_buffer) in ttusb_alloc_iso_urbs()
772 ttusb_free_iso_urbs(ttusb); in ttusb_alloc_iso_urbs()
776 ttusb->iso_urb[i] = urb; in ttusb_alloc_iso_urbs()
782 static void ttusb_stop_iso_xfer(struct ttusb *ttusb) in ttusb_stop_iso_xfer() argument
787 usb_kill_urb(ttusb->iso_urb[i]); in ttusb_stop_iso_xfer()
789 ttusb->iso_streaming = 0; in ttusb_stop_iso_xfer()
792 static int ttusb_start_iso_xfer(struct ttusb *ttusb) in ttusb_start_iso_xfer() argument
796 if (ttusb->iso_streaming) { in ttusb_start_iso_xfer()
801 ttusb->cc = -1; in ttusb_start_iso_xfer()
802 ttusb->insync = 0; in ttusb_start_iso_xfer()
803 ttusb->mux_state = 0; in ttusb_start_iso_xfer()
807 struct urb *urb = ttusb->iso_urb[i]; in ttusb_start_iso_xfer()
809 urb->dev = ttusb->dev; in ttusb_start_iso_xfer()
810 urb->context = ttusb; in ttusb_start_iso_xfer()
812 urb->pipe = ttusb->isoc_in_pipe; in ttusb_start_iso_xfer()
818 urb->transfer_buffer = ttusb->iso_buffer + buffer_offset; in ttusb_start_iso_xfer()
829 if ((err = usb_submit_urb(ttusb->iso_urb[i], GFP_ATOMIC))) { in ttusb_start_iso_xfer()
830 ttusb_stop_iso_xfer(ttusb); in ttusb_start_iso_xfer()
837 ttusb->iso_streaming = 1; in ttusb_start_iso_xfer()
860 struct ttusb *ttusb = (struct ttusb *) dvbdmxfeed->demux; in ttusb_start_feed() local
896 ttusb_set_channel(ttusb, dvbdmxfeed->index, feed_type, dvbdmxfeed->pid); in ttusb_start_feed()
898 if (0 == ttusb->running_feed_count++) in ttusb_start_feed()
899 ttusb_start_iso_xfer(ttusb); in ttusb_start_feed()
906 struct ttusb *ttusb = (struct ttusb *) dvbdmxfeed->demux; in ttusb_stop_feed() local
908 ttusb_del_channel(ttusb, dvbdmxfeed->index); in ttusb_stop_feed()
910 if (--ttusb->running_feed_count == 0) in ttusb_stop_feed()
911 ttusb_stop_iso_xfer(ttusb); in ttusb_stop_feed()
916 static int ttusb_setup_interfaces(struct ttusb *ttusb) in ttusb_setup_interfaces() argument
918 usb_set_interface(ttusb->dev, 1, 1); in ttusb_setup_interfaces()
920 ttusb->bulk_out_pipe = usb_sndbulkpipe(ttusb->dev, 1); in ttusb_setup_interfaces()
921 ttusb->bulk_in_pipe = usb_rcvbulkpipe(ttusb->dev, 1); in ttusb_setup_interfaces()
922 ttusb->isoc_in_pipe = usb_rcvisocpipe(ttusb->dev, 2); in ttusb_setup_interfaces()
932 struct ttusb *ttusb = file->private_data;
937 ttusb_i2c_msg(ttusb, 0x50, snd_buf, 2, stc_firmware + addr,
973 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in alps_tdmb7_tuner_set_params() local
987 if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) return -EIO; in alps_tdmb7_tuner_set_params()
1001 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tdm1316l_tuner_init() local
1009 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) return -EIO; in philips_tdm1316l_tuner_init()
1018 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) { in philips_tdm1316l_tuner_init()
1019 i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1); in philips_tdm1316l_tuner_init()
1028 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tdm1316l_tuner_set_params() local
1092 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) in philips_tdm1316l_tuner_set_params()
1101 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tdm1316l_request_firmware() local
1103 return request_firmware(fw, name, &ttusb->dev->dev); in philips_tdm1316l_request_firmware()
1235 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tsa5059_tuner_set_params() local
1253 if (ttusb->revision == TTUSB_REV_2_2) in philips_tsa5059_tuner_set_params()
1258 if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) in philips_tsa5059_tuner_set_params()
1279 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in ttusb_novas_grundig_29504_491_tuner_set_params() local
1293 if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) in ttusb_novas_grundig_29504_491_tuner_set_params()
1307 struct ttusb* ttusb = fe->dvb->priv; in alps_tdbe2_tuner_set_params() local
1321 if (i2c_transfer (&ttusb->i2c_adap, &msg, 1) != 1) in alps_tdbe2_tuner_set_params()
1335 static u8 read_pwm(struct ttusb* ttusb) in read_pwm() argument
1342 if ((i2c_transfer(&ttusb->i2c_adap, msg, 2) != 2) || (pwm == 0xff)) in read_pwm()
1352 struct ttusb *ttusb = (struct ttusb *) fe->dvb->priv; in dvbc_philips_tdm1316l_tuner_set_params() local
1391 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) { in dvbc_philips_tdm1316l_tuner_set_params()
1400 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) { in dvbc_philips_tdm1316l_tuner_set_params()
1518 static void frontend_init(struct ttusb* ttusb) in frontend_init() argument
1520 switch(le16_to_cpu(ttusb->dev->descriptor.idProduct)) { in frontend_init()
1523 ttusb->fe = dvb_attach(stv0299_attach, &alps_stv0299_config, &ttusb->i2c_adap); in frontend_init()
1524 if (ttusb->fe != NULL) { in frontend_init()
1525 ttusb->fe->ops.tuner_ops.set_params = philips_tsa5059_tuner_set_params; in frontend_init()
1527 if(ttusb->revision == TTUSB_REV_2_2) { // ALPS BSBE1 in frontend_init()
1529 dvb_attach(lnbp21_attach, ttusb->fe, &ttusb->i2c_adap, 0, 0); in frontend_init()
1531 ttusb->fe->ops.set_voltage = ttusb_set_voltage; in frontend_init()
1537 ttusb->fe = dvb_attach(tda8083_attach, &ttusb_novas_grundig_29504_491_config, &ttusb->i2c_adap); in frontend_init()
1538 if (ttusb->fe != NULL) { in frontend_init()
1539 ttusb->fe->ops.tuner_ops.set_params = ttusb_novas_grundig_29504_491_tuner_set_params; in frontend_init()
1540 ttusb->fe->ops.set_voltage = ttusb_set_voltage; in frontend_init()
1546 ttusb->fe = dvb_attach(ves1820_attach, &alps_tdbe2_config, &ttusb->i2c_adap, read_pwm(ttusb)); in frontend_init()
1547 if (ttusb->fe != NULL) { in frontend_init()
1548 ttusb->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; in frontend_init()
1552 ttusb->fe = dvb_attach(stv0297_attach, &dvbc_philips_tdm1316l_config, &ttusb->i2c_adap); in frontend_init()
1553 if (ttusb->fe != NULL) { in frontend_init()
1554 ttusb->fe->ops.tuner_ops.set_params = dvbc_philips_tdm1316l_tuner_set_params; in frontend_init()
1561 ttusb->fe = dvb_attach(cx22700_attach, &alps_tdmb7_config, &ttusb->i2c_adap); in frontend_init()
1562 if (ttusb->fe != NULL) { in frontend_init()
1563 ttusb->fe->ops.tuner_ops.set_params = alps_tdmb7_tuner_set_params; in frontend_init()
1568 ttusb->fe = dvb_attach(tda10046_attach, &philips_tdm1316l_config, &ttusb->i2c_adap); in frontend_init()
1569 if (ttusb->fe != NULL) { in frontend_init()
1570 ttusb->fe->ops.tuner_ops.init = philips_tdm1316l_tuner_init; in frontend_init()
1571 ttusb->fe->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params; in frontend_init()
1577 if (ttusb->fe == NULL) { in frontend_init()
1579 le16_to_cpu(ttusb->dev->descriptor.idVendor), in frontend_init()
1580 le16_to_cpu(ttusb->dev->descriptor.idProduct)); in frontend_init()
1582 if (dvb_register_frontend(&ttusb->adapter, ttusb->fe)) { in frontend_init()
1584 dvb_frontend_detach(ttusb->fe); in frontend_init()
1585 ttusb->fe = NULL; in frontend_init()
1600 struct ttusb *ttusb; in ttusb_probe() local
1609 if (!(ttusb = kzalloc(sizeof(struct ttusb), GFP_KERNEL))) in ttusb_probe()
1612 ttusb->dev = udev; in ttusb_probe()
1613 ttusb->c = 0; in ttusb_probe()
1614 ttusb->mux_state = 0; in ttusb_probe()
1615 mutex_init(&ttusb->semi2c); in ttusb_probe()
1617 mutex_lock(&ttusb->semi2c); in ttusb_probe()
1619 mutex_init(&ttusb->semusb); in ttusb_probe()
1621 ttusb_setup_interfaces(ttusb); in ttusb_probe()
1623 result = ttusb_alloc_iso_urbs(ttusb); in ttusb_probe()
1626 mutex_unlock(&ttusb->semi2c); in ttusb_probe()
1627 kfree(ttusb); in ttusb_probe()
1631 if (ttusb_init_controller(ttusb)) in ttusb_probe()
1634 mutex_unlock(&ttusb->semi2c); in ttusb_probe()
1636 result = dvb_register_adapter(&ttusb->adapter, in ttusb_probe()
1640 ttusb_free_iso_urbs(ttusb); in ttusb_probe()
1641 kfree(ttusb); in ttusb_probe()
1644 ttusb->adapter.priv = ttusb; in ttusb_probe()
1647 memset(&ttusb->i2c_adap, 0, sizeof(struct i2c_adapter)); in ttusb_probe()
1648 strscpy(ttusb->i2c_adap.name, "TTUSB DEC", sizeof(ttusb->i2c_adap.name)); in ttusb_probe()
1650 i2c_set_adapdata(&ttusb->i2c_adap, ttusb); in ttusb_probe()
1652 ttusb->i2c_adap.algo = &ttusb_dec_algo; in ttusb_probe()
1653 ttusb->i2c_adap.algo_data = NULL; in ttusb_probe()
1654 ttusb->i2c_adap.dev.parent = &udev->dev; in ttusb_probe()
1656 result = i2c_add_adapter(&ttusb->i2c_adap); in ttusb_probe()
1660 memset(&ttusb->dvb_demux, 0, sizeof(ttusb->dvb_demux)); in ttusb_probe()
1662 ttusb->dvb_demux.dmx.capabilities = in ttusb_probe()
1664 ttusb->dvb_demux.priv = NULL; in ttusb_probe()
1666 ttusb->dvb_demux.filternum = TTUSB_MAXFILTER; in ttusb_probe()
1668 ttusb->dvb_demux.filternum = 32; in ttusb_probe()
1670 ttusb->dvb_demux.feednum = TTUSB_MAXCHANNEL; in ttusb_probe()
1671 ttusb->dvb_demux.start_feed = ttusb_start_feed; in ttusb_probe()
1672 ttusb->dvb_demux.stop_feed = ttusb_stop_feed; in ttusb_probe()
1673 ttusb->dvb_demux.write_to_decoder = NULL; in ttusb_probe()
1675 result = dvb_dmx_init(&ttusb->dvb_demux); in ttusb_probe()
1682 ttusb->dmxdev.filternum = ttusb->dvb_demux.filternum; in ttusb_probe()
1683 ttusb->dmxdev.demux = &ttusb->dvb_demux.dmx; in ttusb_probe()
1684 ttusb->dmxdev.capabilities = 0; in ttusb_probe()
1686 result = dvb_dmxdev_init(&ttusb->dmxdev, &ttusb->adapter); in ttusb_probe()
1694 if (dvb_net_init(&ttusb->adapter, &ttusb->dvbnet, &ttusb->dvb_demux.dmx)) { in ttusb_probe()
1700 usb_set_intfdata(intf, (void *) ttusb); in ttusb_probe()
1702 frontend_init(ttusb); in ttusb_probe()
1707 dvb_dmxdev_release(&ttusb->dmxdev); in ttusb_probe()
1709 dvb_dmx_release(&ttusb->dvb_demux); in ttusb_probe()
1711 i2c_del_adapter(&ttusb->i2c_adap); in ttusb_probe()
1713 dvb_unregister_adapter (&ttusb->adapter); in ttusb_probe()
1714 ttusb_free_iso_urbs(ttusb); in ttusb_probe()
1715 kfree(ttusb); in ttusb_probe()
1721 struct ttusb *ttusb = usb_get_intfdata(intf); in ttusb_disconnect() local
1725 ttusb->disconnecting = 1; in ttusb_disconnect()
1727 ttusb_stop_iso_xfer(ttusb); in ttusb_disconnect()
1729 ttusb->dvb_demux.dmx.close(&ttusb->dvb_demux.dmx); in ttusb_disconnect()
1730 dvb_net_release(&ttusb->dvbnet); in ttusb_disconnect()
1731 dvb_dmxdev_release(&ttusb->dmxdev); in ttusb_disconnect()
1732 dvb_dmx_release(&ttusb->dvb_demux); in ttusb_disconnect()
1733 if (ttusb->fe != NULL) { in ttusb_disconnect()
1734 dvb_unregister_frontend(ttusb->fe); in ttusb_disconnect()
1735 dvb_frontend_detach(ttusb->fe); in ttusb_disconnect()
1737 i2c_del_adapter(&ttusb->i2c_adap); in ttusb_disconnect()
1738 dvb_unregister_adapter(&ttusb->adapter); in ttusb_disconnect()
1740 ttusb_free_iso_urbs(ttusb); in ttusb_disconnect()
1742 kfree(ttusb); in ttusb_disconnect()