Lines Matching +full:usb +full:- +full:attach
1 // SPDX-License-Identifier: GPL-2.0-only
2 /* DVB USB compliant linux driver for Technotrend DVB USB boxes and clones
3 * (e.g. Pinnacle 400e DVB-S USB2.0).
10 * 0x08 - LNBP21PD - LNB power supply
11 * 0x0e - TDA10086 - Demodulator
12 * 0x50 - FX2 eeprom
13 * 0x60 - TDA8263 - Tuner
18 * Copyright (C) 2005-6 Patrick Boettcher <pb@linuxtv.org>
20 * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information
23 #include "dvb-usb.h"
40 MODULE_PARM_DESC(debug, "set debugging level (1=info (or-able))." DVB_USB_DEBUG_STATUS);
74 struct ttusb2_state *st = d->priv; in ttusb2_msg()
79 return -EIO; in ttusb2_msg()
83 return -ENOMEM; in ttusb2_msg()
88 return -ENOMEM; in ttusb2_msg()
92 s[1] = ++st->id; in ttusb2_msg()
107 return -EIO; in ttusb2_msg()
123 u8 rx[60];/* (64 -4) */ in tt3650_ci_msg()
132 struct dvb_usb_device *d = ca->data; in tt3650_ci_msg_locked()
133 struct ttusb2_state *state = d->priv; in tt3650_ci_msg_locked()
136 mutex_lock(&state->ca_mutex); in tt3650_ci_msg_locked()
138 mutex_unlock(&state->ca_mutex); in tt3650_ci_msg_locked()
149 return -EINVAL; in tt3650_ci_read_attribute_mem()
157 ci_dbg("%04x -> %d 0x%02x", address, ret, buf[2]); in tt3650_ci_read_attribute_mem()
172 return -EINVAL; in tt3650_ci_write_attribute_mem()
187 return -EINVAL; in tt3650_ci_read_cam_control()
193 ci_dbg("0x%02x -> %d 0x%02x", address, ret, buf[1]); in tt3650_ci_read_cam_control()
208 return -EINVAL; in tt3650_ci_write_cam_control()
224 return -EINVAL; in tt3650_ci_set_video_port()
234 return -EIO; in tt3650_ci_set_video_port()
252 struct dvb_usb_device *d = ca->data; in tt3650_ci_slot_reset()
253 struct ttusb2_state *state = d->priv; in tt3650_ci_slot_reset()
260 return -EINVAL; in tt3650_ci_slot_reset()
264 mutex_lock(&state->ca_mutex); in tt3650_ci_slot_reset()
287 mutex_unlock(&state->ca_mutex); in tt3650_ci_slot_reset()
298 return -EINVAL; in tt3650_ci_poll_slot_status()
320 state = d->priv; in tt3650_ci_uninit()
324 if (NULL == state->ca.data) in tt3650_ci_uninit()
327 dvb_ca_en50221_release(&state->ca); in tt3650_ci_uninit()
329 memset(&state->ca, 0, sizeof(state->ca)); in tt3650_ci_uninit()
334 struct dvb_usb_device *d = a->dev; in tt3650_ci_init()
335 struct ttusb2_state *state = d->priv; in tt3650_ci_init()
340 mutex_init(&state->ca_mutex); in tt3650_ci_init()
342 state->ca.owner = THIS_MODULE; in tt3650_ci_init()
343 state->ca.read_attribute_mem = tt3650_ci_read_attribute_mem; in tt3650_ci_init()
344 state->ca.write_attribute_mem = tt3650_ci_write_attribute_mem; in tt3650_ci_init()
345 state->ca.read_cam_control = tt3650_ci_read_cam_control; in tt3650_ci_init()
346 state->ca.write_cam_control = tt3650_ci_write_cam_control; in tt3650_ci_init()
347 state->ca.slot_reset = tt3650_ci_slot_reset; in tt3650_ci_init()
348 state->ca.slot_shutdown = tt3650_ci_slot_shutdown; in tt3650_ci_init()
349 state->ca.slot_ts_enable = tt3650_ci_slot_ts_enable; in tt3650_ci_init()
350 state->ca.poll_slot_status = tt3650_ci_poll_slot_status; in tt3650_ci_init()
351 state->ca.data = d; in tt3650_ci_init()
353 ret = dvb_ca_en50221_init(&a->dvb_adap, in tt3650_ci_init()
354 &state->ca, in tt3650_ci_init()
359 memset(&state->ca, 0, sizeof(state->ca)); in tt3650_ci_init()
374 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) in ttusb2_i2c_xfer()
375 return -EAGAIN; in ttusb2_i2c_xfer()
428 mutex_unlock(&d->i2c_mutex); in ttusb2_i2c_xfer()
450 struct ttusb2_state *st = d->priv; in tt3650_rc_query()
457 st->last_rc_key = RC_SCANCODE_RC5(rx[3], rx[2]); in tt3650_rc_query()
459 rc_keydown(d->rc_dev, RC_PROTO_RC5, st->last_rc_key, rx[1]); in tt3650_rc_query()
460 } else if (st->last_rc_key) { in tt3650_rc_query()
461 rc_keyup(d->rc_dev); in tt3650_rc_query()
462 st->last_rc_key = 0; in tt3650_rc_query()
469 /* Callbacks for DVB USB */
475 *cold = udev->descriptor.iManufacturer == 0 && udev->descriptor.iProduct == 0; in ttusb2_identify_state()
525 if (usb_set_interface(adap->dev->udev,0,3) < 0) in ttusb2_frontend_tda10086_attach()
528 …if ((adap->fe_adap[0].fe = dvb_attach(tda10086_attach, &tda10086_config, &adap->dev->i2c_adap)) ==… in ttusb2_frontend_tda10086_attach()
529 deb_info("TDA10086 attach failed\n"); in ttusb2_frontend_tda10086_attach()
530 return -ENODEV; in ttusb2_frontend_tda10086_attach()
538 struct dvb_usb_adapter *adap = fe->dvb->priv; in ttusb2_ct3650_i2c_gate_ctrl()
540 return adap->fe_adap[0].fe->ops.i2c_gate_ctrl(adap->fe_adap[0].fe, enable); in ttusb2_ct3650_i2c_gate_ctrl()
545 if (usb_set_interface(adap->dev->udev, 0, 3) < 0) in ttusb2_frontend_tda10023_attach()
548 if (adap->fe_adap[0].fe == NULL) { in ttusb2_frontend_tda10023_attach()
549 /* FE 0 DVB-C */ in ttusb2_frontend_tda10023_attach()
550 adap->fe_adap[0].fe = dvb_attach(tda10023_attach, in ttusb2_frontend_tda10023_attach()
551 &tda10023_config, &adap->dev->i2c_adap, 0x48); in ttusb2_frontend_tda10023_attach()
553 if (adap->fe_adap[0].fe == NULL) { in ttusb2_frontend_tda10023_attach()
554 deb_info("TDA10023 attach failed\n"); in ttusb2_frontend_tda10023_attach()
555 return -ENODEV; in ttusb2_frontend_tda10023_attach()
559 adap->fe_adap[1].fe = dvb_attach(tda10048_attach, in ttusb2_frontend_tda10023_attach()
560 &tda10048_config, &adap->dev->i2c_adap); in ttusb2_frontend_tda10023_attach()
562 if (adap->fe_adap[1].fe == NULL) { in ttusb2_frontend_tda10023_attach()
563 deb_info("TDA10048 attach failed\n"); in ttusb2_frontend_tda10023_attach()
564 return -ENODEV; in ttusb2_frontend_tda10023_attach()
567 /* tuner is behind TDA10023 I2C-gate */ in ttusb2_frontend_tda10023_attach()
568 adap->fe_adap[1].fe->ops.i2c_gate_ctrl = ttusb2_ct3650_i2c_gate_ctrl; in ttusb2_frontend_tda10023_attach()
579 /* MFE: select correct FE to attach tuner since that's called twice */ in ttusb2_tuner_tda827x_attach()
580 if (adap->fe_adap[1].fe == NULL) in ttusb2_tuner_tda827x_attach()
581 fe = adap->fe_adap[0].fe; in ttusb2_tuner_tda827x_attach()
583 fe = adap->fe_adap[1].fe; in ttusb2_tuner_tda827x_attach()
585 /* attach tuner */ in ttusb2_tuner_tda827x_attach()
586 if (dvb_attach(tda827x_attach, fe, 0x61, &adap->dev->i2c_adap, &tda827x_config) == NULL) { in ttusb2_tuner_tda827x_attach()
588 return -ENODEV; in ttusb2_tuner_tda827x_attach()
595 if (dvb_attach(tda826x_attach, adap->fe_adap[0].fe, 0x60, &adap->dev->i2c_adap, 0) == NULL) { in ttusb2_tuner_tda826x_attach()
596 deb_info("TDA8263 attach failed\n"); in ttusb2_tuner_tda826x_attach()
597 return -ENODEV; in ttusb2_tuner_tda826x_attach()
600 if (dvb_attach(lnbp21_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, 0, 0) == NULL) { in ttusb2_tuner_tda826x_attach()
601 deb_info("LNBP21 attach failed\n"); in ttusb2_tuner_tda826x_attach()
602 return -ENODEV; in ttusb2_tuner_tda826x_attach()
607 /* DVB USB Driver stuff */
630 return -ENODEV; in ttusb2_probe()
650 MODULE_DEVICE_TABLE (usb, ttusb2_table);
656 .firmware = "dvb-usb-pctv-400e-01.fw",
670 /* parameter for the MPEG2-data transfer */
696 { "Pinnacle 400e DVB-S USB2.0",
700 { "Pinnacle 450e DVB-S USB2.0",
711 .firmware = "dvb-usb-tt-s2400-01.fw",
725 /* parameter for the MPEG2-data transfer */
751 { "Technotrend TT-connect S-2400",
755 { "Technotrend TT-connect S-2400 (8kB EEPROM)",
786 /* parameter for the MPEG2-data transfer */
805 /* parameter for the MPEG2-data transfer */
831 { "Technotrend TT-connect CT-3650",
847 MODULE_DESCRIPTION("Driver for Pinnacle PCTV 400e DVB-S USB2.0");