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()
516 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in ttusb_set_voltage() local
518 ttusb->voltage = voltage; in ttusb_set_voltage()
519 return ttusb_update_lnb(ttusb); in ttusb_set_voltage()
525 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in ttusb_set_tone() local
527 ttusb->tone = tone; in ttusb_set_tone()
528 return ttusb_update_lnb(ttusb); in ttusb_set_tone()
534 static void ttusb_set_led_freq(struct ttusb *ttusb, u8 freq)
536 u8 b[] = { 0xaa, ++ttusb->c, 0x19, 1, freq };
539 err = ttusb_cmd(ttusb, b, sizeof(b), 0);
559 static void ttusb_process_muxpack(struct ttusb *ttusb, const u8 * muxpack, in ttusb_process_muxpack() argument
582 if ((cc != ttusb->cc) && (ttusb->cc != -1)) in ttusb_process_muxpack()
584 __func__, (cc - ttusb->cc) & 0x7FFF); in ttusb_process_muxpack()
585 ttusb->cc = (cc + 1) & 0x7FFF; in ttusb_process_muxpack()
597 ttusb_handle_sec_data(ttusb->channel + channel, data, in ttusb_process_muxpack()
601 if ((!!(ttusb->muxpack[0] & 0x20)) ^ in ttusb_process_muxpack()
602 !!(ttusb->muxpack[1] & 1)) in ttusb_process_muxpack()
614 if (ttusb->channel[channel].active in ttusb_process_muxpack()
615 && (pid == ttusb->channel[channel].pid)) in ttusb_process_muxpack()
616 ttusb_handle_ts_data(ttusb->channel + in ttusb_process_muxpack()
621 dvb_dmx_swfilter_packets(&ttusb->dvb_demux, muxpack, 1); in ttusb_process_muxpack()
629 static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len) in ttusb_process_frame() argument
638 switch (ttusb->mux_state) { in ttusb_process_frame()
644 ++ttusb->mux_state; in ttusb_process_frame()
646 ttusb->mux_state = 0; in ttusb_process_frame()
647 if (ttusb->insync) { in ttusb_process_frame()
652 ttusb->insync = 0; in ttusb_process_frame()
657 ttusb->insync = 1; in ttusb_process_frame()
659 ttusb->mux_npacks = *data++; in ttusb_process_frame()
660 ++ttusb->mux_state; in ttusb_process_frame()
661 ttusb->muxpack_ptr = 0; in ttusb_process_frame()
663 ttusb->muxpack_len = 2; in ttusb_process_frame()
670 (ttusb->muxpack_len - in ttusb_process_frame()
671 ttusb->muxpack_ptr)) in ttusb_process_frame()
673 ttusb->muxpack_len - in ttusb_process_frame()
674 ttusb->muxpack_ptr; in ttusb_process_frame()
675 memcpy(ttusb->muxpack + ttusb->muxpack_ptr, in ttusb_process_frame()
677 ttusb->muxpack_ptr += avail; in ttusb_process_frame()
678 BUG_ON(ttusb->muxpack_ptr > 264); in ttusb_process_frame()
682 if (ttusb->muxpack_ptr == 2) { in ttusb_process_frame()
683 if (ttusb->muxpack[0] & 0x80) { in ttusb_process_frame()
684 ttusb->muxpack_len = in ttusb_process_frame()
685 ttusb->muxpack[1] + 2; in ttusb_process_frame()
686 if (ttusb-> in ttusb_process_frame()
688 ttusb-> in ttusb_process_frame()
691 (ttusb-> in ttusb_process_frame()
693 !!(ttusb-> in ttusb_process_frame()
695 ttusb-> in ttusb_process_frame()
697 ttusb->muxpack_len += 4; in ttusb_process_frame()
698 } else if (ttusb->muxpack[0] == in ttusb_process_frame()
700 ttusb->muxpack_len = in ttusb_process_frame()
702 else if (ttusb->muxpack[0] == 0x00) in ttusb_process_frame()
703 ttusb->muxpack_len = in ttusb_process_frame()
704 ttusb->muxpack[1] + 2 + in ttusb_process_frame()
710 ttusb->muxpack[0]); in ttusb_process_frame()
711 ttusb->mux_state = 0; in ttusb_process_frame()
719 if ((ttusb->muxpack_ptr >= 2) && in ttusb_process_frame()
720 (ttusb->muxpack_ptr == in ttusb_process_frame()
721 ttusb->muxpack_len)) { in ttusb_process_frame()
722 ttusb_process_muxpack(ttusb, in ttusb_process_frame()
723 ttusb-> in ttusb_process_frame()
725 ttusb-> in ttusb_process_frame()
727 ttusb->muxpack_ptr = 0; in ttusb_process_frame()
729 ttusb->muxpack_len = 2; in ttusb_process_frame()
735 if (!ttusb->mux_npacks--) { in ttusb_process_frame()
736 ttusb->mux_state = 0; in ttusb_process_frame()
751 struct ttusb *ttusb = urb->context; in ttusb_iso_irq() local
756 if (!ttusb->iso_streaming) in ttusb_iso_irq()
783 ttusb_process_frame(ttusb, data, len); in ttusb_iso_irq()
789 static void ttusb_free_iso_urbs(struct ttusb *ttusb) in ttusb_free_iso_urbs() argument
794 usb_free_urb(ttusb->iso_urb[i]); in ttusb_free_iso_urbs()
798 ISO_BUF_COUNT, ttusb->iso_buffer, in ttusb_free_iso_urbs()
799 ttusb->iso_dma_handle); in ttusb_free_iso_urbs()
802 static int ttusb_alloc_iso_urbs(struct ttusb *ttusb) in ttusb_alloc_iso_urbs() argument
806 ttusb->iso_buffer = pci_zalloc_consistent(NULL, in ttusb_alloc_iso_urbs()
808 &ttusb->iso_dma_handle); in ttusb_alloc_iso_urbs()
810 if (!ttusb->iso_buffer) { in ttusb_alloc_iso_urbs()
822 ttusb_free_iso_urbs(ttusb); in ttusb_alloc_iso_urbs()
826 ttusb->iso_urb[i] = urb; in ttusb_alloc_iso_urbs()
832 static void ttusb_stop_iso_xfer(struct ttusb *ttusb) in ttusb_stop_iso_xfer() argument
837 usb_kill_urb(ttusb->iso_urb[i]); in ttusb_stop_iso_xfer()
839 ttusb->iso_streaming = 0; in ttusb_stop_iso_xfer()
842 static int ttusb_start_iso_xfer(struct ttusb *ttusb) in ttusb_start_iso_xfer() argument
846 if (ttusb->iso_streaming) { in ttusb_start_iso_xfer()
851 ttusb->cc = -1; in ttusb_start_iso_xfer()
852 ttusb->insync = 0; in ttusb_start_iso_xfer()
853 ttusb->mux_state = 0; in ttusb_start_iso_xfer()
857 struct urb *urb = ttusb->iso_urb[i]; in ttusb_start_iso_xfer()
859 urb->dev = ttusb->dev; in ttusb_start_iso_xfer()
860 urb->context = ttusb; in ttusb_start_iso_xfer()
862 urb->pipe = ttusb->isoc_in_pipe; in ttusb_start_iso_xfer()
868 urb->transfer_buffer = ttusb->iso_buffer + buffer_offset; in ttusb_start_iso_xfer()
879 if ((err = usb_submit_urb(ttusb->iso_urb[i], GFP_ATOMIC))) { in ttusb_start_iso_xfer()
880 ttusb_stop_iso_xfer(ttusb); in ttusb_start_iso_xfer()
888 ttusb->iso_streaming = 1; in ttusb_start_iso_xfer()
911 struct ttusb *ttusb = (struct ttusb *) dvbdmxfeed->demux; in ttusb_start_feed() local
947 ttusb_set_channel(ttusb, dvbdmxfeed->index, feed_type, dvbdmxfeed->pid); in ttusb_start_feed()
949 if (0 == ttusb->running_feed_count++) in ttusb_start_feed()
950 ttusb_start_iso_xfer(ttusb); in ttusb_start_feed()
957 struct ttusb *ttusb = (struct ttusb *) dvbdmxfeed->demux; in ttusb_stop_feed() local
959 ttusb_del_channel(ttusb, dvbdmxfeed->index); in ttusb_stop_feed()
961 if (--ttusb->running_feed_count == 0) in ttusb_stop_feed()
962 ttusb_stop_iso_xfer(ttusb); in ttusb_stop_feed()
967 static int ttusb_setup_interfaces(struct ttusb *ttusb) in ttusb_setup_interfaces() argument
969 usb_set_interface(ttusb->dev, 1, 1); in ttusb_setup_interfaces()
971 ttusb->bulk_out_pipe = usb_sndbulkpipe(ttusb->dev, 1); in ttusb_setup_interfaces()
972 ttusb->bulk_in_pipe = usb_rcvbulkpipe(ttusb->dev, 1); in ttusb_setup_interfaces()
973 ttusb->isoc_in_pipe = usb_rcvisocpipe(ttusb->dev, 2); in ttusb_setup_interfaces()
983 struct ttusb *ttusb = file->private_data;
988 ttusb_i2c_msg(ttusb, 0x50, snd_buf, 2, stc_firmware + addr,
1024 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in alps_tdmb7_tuner_set_params() local
1038 if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) return -EIO; in alps_tdmb7_tuner_set_params()
1052 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tdm1316l_tuner_init() local
1060 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) return -EIO; in philips_tdm1316l_tuner_init()
1069 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) { in philips_tdm1316l_tuner_init()
1070 i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1); in philips_tdm1316l_tuner_init()
1079 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tdm1316l_tuner_set_params() local
1143 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) in philips_tdm1316l_tuner_set_params()
1152 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tdm1316l_request_firmware() local
1154 return request_firmware(fw, name, &ttusb->dev->dev); in philips_tdm1316l_request_firmware()
1286 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in philips_tsa5059_tuner_set_params() local
1304 if (ttusb->revision == TTUSB_REV_2_2) in philips_tsa5059_tuner_set_params()
1309 if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) in philips_tsa5059_tuner_set_params()
1330 struct ttusb* ttusb = (struct ttusb*) fe->dvb->priv; in ttusb_novas_grundig_29504_491_tuner_set_params() local
1344 if (i2c_transfer(&ttusb->i2c_adap, &msg, 1) != 1) in ttusb_novas_grundig_29504_491_tuner_set_params()
1358 struct ttusb* ttusb = fe->dvb->priv; in alps_tdbe2_tuner_set_params() local
1372 if (i2c_transfer (&ttusb->i2c_adap, &msg, 1) != 1) in alps_tdbe2_tuner_set_params()
1386 static u8 read_pwm(struct ttusb* ttusb) in read_pwm() argument
1393 if ((i2c_transfer(&ttusb->i2c_adap, msg, 2) != 2) || (pwm == 0xff)) in read_pwm()
1403 struct ttusb *ttusb = (struct ttusb *) fe->dvb->priv; in dvbc_philips_tdm1316l_tuner_set_params() local
1442 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) { in dvbc_philips_tdm1316l_tuner_set_params()
1451 if (i2c_transfer(&ttusb->i2c_adap, &tuner_msg, 1) != 1) { in dvbc_philips_tdm1316l_tuner_set_params()
1569 static void frontend_init(struct ttusb* ttusb) in frontend_init() argument
1571 switch(le16_to_cpu(ttusb->dev->descriptor.idProduct)) { in frontend_init()
1574 ttusb->fe = dvb_attach(stv0299_attach, &alps_stv0299_config, &ttusb->i2c_adap); in frontend_init()
1575 if (ttusb->fe != NULL) { in frontend_init()
1576 ttusb->fe->ops.tuner_ops.set_params = philips_tsa5059_tuner_set_params; in frontend_init()
1578 if(ttusb->revision == TTUSB_REV_2_2) { // ALPS BSBE1 in frontend_init()
1580 dvb_attach(lnbp21_attach, ttusb->fe, &ttusb->i2c_adap, 0, 0); in frontend_init()
1582 ttusb->fe->ops.set_voltage = ttusb_set_voltage; in frontend_init()
1588 ttusb->fe = dvb_attach(tda8083_attach, &ttusb_novas_grundig_29504_491_config, &ttusb->i2c_adap); in frontend_init()
1589 if (ttusb->fe != NULL) { in frontend_init()
1590 ttusb->fe->ops.tuner_ops.set_params = ttusb_novas_grundig_29504_491_tuner_set_params; in frontend_init()
1591 ttusb->fe->ops.set_voltage = ttusb_set_voltage; in frontend_init()
1597 ttusb->fe = dvb_attach(ves1820_attach, &alps_tdbe2_config, &ttusb->i2c_adap, read_pwm(ttusb)); in frontend_init()
1598 if (ttusb->fe != NULL) { in frontend_init()
1599 ttusb->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; in frontend_init()
1603 ttusb->fe = dvb_attach(stv0297_attach, &dvbc_philips_tdm1316l_config, &ttusb->i2c_adap); in frontend_init()
1604 if (ttusb->fe != NULL) { in frontend_init()
1605 ttusb->fe->ops.tuner_ops.set_params = dvbc_philips_tdm1316l_tuner_set_params; in frontend_init()
1612 ttusb->fe = dvb_attach(cx22700_attach, &alps_tdmb7_config, &ttusb->i2c_adap); in frontend_init()
1613 if (ttusb->fe != NULL) { in frontend_init()
1614 ttusb->fe->ops.tuner_ops.set_params = alps_tdmb7_tuner_set_params; in frontend_init()
1619 ttusb->fe = dvb_attach(tda10046_attach, &philips_tdm1316l_config, &ttusb->i2c_adap); in frontend_init()
1620 if (ttusb->fe != NULL) { in frontend_init()
1621 ttusb->fe->ops.tuner_ops.init = philips_tdm1316l_tuner_init; in frontend_init()
1622 ttusb->fe->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params; in frontend_init()
1628 if (ttusb->fe == NULL) { in frontend_init()
1630 le16_to_cpu(ttusb->dev->descriptor.idVendor), in frontend_init()
1631 le16_to_cpu(ttusb->dev->descriptor.idProduct)); in frontend_init()
1633 if (dvb_register_frontend(&ttusb->adapter, ttusb->fe)) { in frontend_init()
1635 dvb_frontend_detach(ttusb->fe); in frontend_init()
1636 ttusb->fe = NULL; in frontend_init()
1651 struct ttusb *ttusb; in ttusb_probe() local
1660 if (!(ttusb = kzalloc(sizeof(struct ttusb), GFP_KERNEL))) in ttusb_probe()
1663 ttusb->dev = udev; in ttusb_probe()
1664 ttusb->c = 0; in ttusb_probe()
1665 ttusb->mux_state = 0; in ttusb_probe()
1666 mutex_init(&ttusb->semi2c); in ttusb_probe()
1668 mutex_lock(&ttusb->semi2c); in ttusb_probe()
1670 mutex_init(&ttusb->semusb); in ttusb_probe()
1672 ttusb_setup_interfaces(ttusb); in ttusb_probe()
1674 result = ttusb_alloc_iso_urbs(ttusb); in ttusb_probe()
1677 mutex_unlock(&ttusb->semi2c); in ttusb_probe()
1678 kfree(ttusb); in ttusb_probe()
1682 if (ttusb_init_controller(ttusb)) in ttusb_probe()
1685 mutex_unlock(&ttusb->semi2c); in ttusb_probe()
1687 result = dvb_register_adapter(&ttusb->adapter, in ttusb_probe()
1691 ttusb_free_iso_urbs(ttusb); in ttusb_probe()
1692 kfree(ttusb); in ttusb_probe()
1695 ttusb->adapter.priv = ttusb; in ttusb_probe()
1698 memset(&ttusb->i2c_adap, 0, sizeof(struct i2c_adapter)); in ttusb_probe()
1699 strcpy(ttusb->i2c_adap.name, "TTUSB DEC"); in ttusb_probe()
1701 i2c_set_adapdata(&ttusb->i2c_adap, ttusb); in ttusb_probe()
1703 ttusb->i2c_adap.algo = &ttusb_dec_algo; in ttusb_probe()
1704 ttusb->i2c_adap.algo_data = NULL; in ttusb_probe()
1705 ttusb->i2c_adap.dev.parent = &udev->dev; in ttusb_probe()
1707 result = i2c_add_adapter(&ttusb->i2c_adap); in ttusb_probe()
1711 memset(&ttusb->dvb_demux, 0, sizeof(ttusb->dvb_demux)); in ttusb_probe()
1713 ttusb->dvb_demux.dmx.capabilities = in ttusb_probe()
1715 ttusb->dvb_demux.priv = NULL; in ttusb_probe()
1717 ttusb->dvb_demux.filternum = TTUSB_MAXFILTER; in ttusb_probe()
1719 ttusb->dvb_demux.filternum = 32; in ttusb_probe()
1721 ttusb->dvb_demux.feednum = TTUSB_MAXCHANNEL; in ttusb_probe()
1722 ttusb->dvb_demux.start_feed = ttusb_start_feed; in ttusb_probe()
1723 ttusb->dvb_demux.stop_feed = ttusb_stop_feed; in ttusb_probe()
1724 ttusb->dvb_demux.write_to_decoder = NULL; in ttusb_probe()
1726 result = dvb_dmx_init(&ttusb->dvb_demux); in ttusb_probe()
1733 ttusb->dmxdev.filternum = ttusb->dvb_demux.filternum; in ttusb_probe()
1734 ttusb->dmxdev.demux = &ttusb->dvb_demux.dmx; in ttusb_probe()
1735 ttusb->dmxdev.capabilities = 0; in ttusb_probe()
1737 result = dvb_dmxdev_init(&ttusb->dmxdev, &ttusb->adapter); in ttusb_probe()
1745 if (dvb_net_init(&ttusb->adapter, &ttusb->dvbnet, &ttusb->dvb_demux.dmx)) { in ttusb_probe()
1751 usb_set_intfdata(intf, (void *) ttusb); in ttusb_probe()
1753 frontend_init(ttusb); in ttusb_probe()
1758 dvb_dmxdev_release(&ttusb->dmxdev); in ttusb_probe()
1760 dvb_dmx_release(&ttusb->dvb_demux); in ttusb_probe()
1762 i2c_del_adapter(&ttusb->i2c_adap); in ttusb_probe()
1764 dvb_unregister_adapter (&ttusb->adapter); in ttusb_probe()
1765 ttusb_free_iso_urbs(ttusb); in ttusb_probe()
1766 kfree(ttusb); in ttusb_probe()
1772 struct ttusb *ttusb = usb_get_intfdata(intf); in ttusb_disconnect() local
1776 ttusb->disconnecting = 1; in ttusb_disconnect()
1778 ttusb_stop_iso_xfer(ttusb); in ttusb_disconnect()
1780 ttusb->dvb_demux.dmx.close(&ttusb->dvb_demux.dmx); in ttusb_disconnect()
1781 dvb_net_release(&ttusb->dvbnet); in ttusb_disconnect()
1782 dvb_dmxdev_release(&ttusb->dmxdev); in ttusb_disconnect()
1783 dvb_dmx_release(&ttusb->dvb_demux); in ttusb_disconnect()
1784 if (ttusb->fe != NULL) { in ttusb_disconnect()
1785 dvb_unregister_frontend(ttusb->fe); in ttusb_disconnect()
1786 dvb_frontend_detach(ttusb->fe); in ttusb_disconnect()
1788 i2c_del_adapter(&ttusb->i2c_adap); in ttusb_disconnect()
1789 dvb_unregister_adapter(&ttusb->adapter); in ttusb_disconnect()
1791 ttusb_free_iso_urbs(ttusb); in ttusb_disconnect()
1793 kfree(ttusb); in ttusb_disconnect()