Lines Matching +full:usb +full:- +full:attach

1 // SPDX-License-Identifier: GPL-2.0-or-later
45 mutex_lock(&d->usb_mutex); in dvbsky_usb_generic_rw()
47 memcpy(state->obuf, wbuf, wlen); in dvbsky_usb_generic_rw()
49 ret = dvb_usbv2_generic_rw_locked(d, state->obuf, wlen, in dvbsky_usb_generic_rw()
50 state->ibuf, rlen); in dvbsky_usb_generic_rw()
53 memcpy(rbuf, state->ibuf, rlen); in dvbsky_usb_generic_rw()
55 mutex_unlock(&d->usb_mutex); in dvbsky_usb_generic_rw()
66 mutex_lock(&d->usb_mutex); in dvbsky_stream_ctrl()
67 memcpy(state->obuf, obuf_pre, 3); in dvbsky_stream_ctrl()
68 ret = dvb_usbv2_generic_write_locked(d, state->obuf, 3); in dvbsky_stream_ctrl()
71 memcpy(state->obuf, obuf_post, 3); in dvbsky_stream_ctrl()
72 ret = dvb_usbv2_generic_write_locked(d, state->obuf, 3); in dvbsky_stream_ctrl()
74 mutex_unlock(&d->usb_mutex); in dvbsky_stream_ctrl()
106 if (mutex_lock_interruptible(&d->i2c_mutex) < 0) in dvbsky_i2c_xfer()
107 return -EAGAIN; in dvbsky_i2c_xfer()
110 dev_err(&d->udev->dev, in dvbsky_i2c_xfer()
112 ret = -EOPNOTSUPP; in dvbsky_i2c_xfer()
118 dev_err(&d->udev->dev, in dvbsky_i2c_xfer()
121 ret = -EOPNOTSUPP; in dvbsky_i2c_xfer()
145 dev_err(&d->udev->dev, in dvbsky_i2c_xfer()
146 "too many i2c bytes[w-%d][r-%d], max 60.", in dvbsky_i2c_xfer()
148 ret = -EOPNOTSUPP; in dvbsky_i2c_xfer()
163 mutex_unlock(&d->i2c_mutex); in dvbsky_i2c_xfer()
190 dev_dbg(&d->udev->dev, "rc code: %x\n", code); in dvbsky_rc_query()
195 rc_keydown(d->rc_dev, RC_PROTO_RC5, scancode, toggle); in dvbsky_rc_query()
203 rc->map_name = NULL; in dvbsky_get_rc_config()
207 rc->allowed_protos = RC_PROTO_BIT_RC5; in dvbsky_get_rc_config()
208 rc->query = dvbsky_rc_query; in dvbsky_get_rc_config()
209 rc->interval = 300; in dvbsky_get_rc_config()
229 return state->fe_set_voltage(fe, voltage); in dvbsky_usb_set_voltage()
251 if (i2c_transfer(&d->i2c_adap, msg, 2) == 2) in dvbsky_read_mac_addr()
264 ret = state->fe_read_status(fe, status); in dvbsky_usb_read_status()
267 if ((*status & FE_HAS_LOCK) && (!state->last_lock)) in dvbsky_usb_read_status()
270 state->last_lock = (*status & FE_HAS_LOCK) ? 1 : 0; in dvbsky_usb_read_status()
282 /* attach demod */ in dvbsky_s960_attach()
293 state->i2c_client_demod = dvb_module_probe("m88ds3103", NULL, in dvbsky_s960_attach()
294 &d->i2c_adap, in dvbsky_s960_attach()
296 if (!state->i2c_client_demod) in dvbsky_s960_attach()
297 return -ENODEV; in dvbsky_s960_attach()
299 adap->fe[0] = m88ds3103_pdata.get_dvb_frontend(state->i2c_client_demod); in dvbsky_s960_attach()
300 i2c_adapter = m88ds3103_pdata.get_i2c_adapter(state->i2c_client_demod); in dvbsky_s960_attach()
302 /* attach tuner */ in dvbsky_s960_attach()
303 ts2020_config.fe = adap->fe[0]; in dvbsky_s960_attach()
306 state->i2c_client_tuner = dvb_module_probe("ts2020", NULL, in dvbsky_s960_attach()
309 if (!state->i2c_client_tuner) { in dvbsky_s960_attach()
310 dvb_module_release(state->i2c_client_demod); in dvbsky_s960_attach()
311 return -ENODEV; in dvbsky_s960_attach()
315 adap->fe[0]->ops.read_signal_strength = in dvbsky_s960_attach()
316 adap->fe[0]->ops.tuner_ops.get_rf_strength; in dvbsky_s960_attach()
319 state->fe_read_status = adap->fe[0]->ops.read_status; in dvbsky_s960_attach()
320 adap->fe[0]->ops.read_status = dvbsky_usb_read_status; in dvbsky_s960_attach()
322 /* hook fe: LNB off/on is control by Cypress usb chip. */ in dvbsky_s960_attach()
323 state->fe_set_voltage = adap->fe[0]->ops.set_voltage; in dvbsky_s960_attach()
324 adap->fe[0]->ops.set_voltage = dvbsky_usb_set_voltage; in dvbsky_s960_attach()
342 return state->fe_set_voltage(fe, voltage); in dvbsky_usb_ci_set_voltage()
372 dev_err(&d->udev->dev, "ci control failed=%d\n", ret); in dvbsky_ci_ctrl()
385 /* attach demod */ in dvbsky_s960c_attach()
396 state->i2c_client_demod = dvb_module_probe("m88ds3103", NULL, in dvbsky_s960c_attach()
397 &d->i2c_adap, in dvbsky_s960c_attach()
399 if (!state->i2c_client_demod) in dvbsky_s960c_attach()
400 return -ENODEV; in dvbsky_s960c_attach()
402 adap->fe[0] = m88ds3103_pdata.get_dvb_frontend(state->i2c_client_demod); in dvbsky_s960c_attach()
403 i2c_adapter = m88ds3103_pdata.get_i2c_adapter(state->i2c_client_demod); in dvbsky_s960c_attach()
405 /* attach tuner */ in dvbsky_s960c_attach()
406 ts2020_config.fe = adap->fe[0]; in dvbsky_s960c_attach()
409 state->i2c_client_tuner = dvb_module_probe("ts2020", NULL, in dvbsky_s960c_attach()
412 if (!state->i2c_client_tuner) { in dvbsky_s960c_attach()
413 dvb_module_release(state->i2c_client_demod); in dvbsky_s960c_attach()
414 return -ENODEV; in dvbsky_s960c_attach()
417 /* attach ci controller */ in dvbsky_s960c_attach()
418 sp2_config.dvb_adap = &adap->dvb_adap; in dvbsky_s960c_attach()
422 state->i2c_client_ci = dvb_module_probe("sp2", NULL, in dvbsky_s960c_attach()
423 &d->i2c_adap, in dvbsky_s960c_attach()
426 if (!state->i2c_client_ci) { in dvbsky_s960c_attach()
427 dvb_module_release(state->i2c_client_tuner); in dvbsky_s960c_attach()
428 dvb_module_release(state->i2c_client_demod); in dvbsky_s960c_attach()
429 return -ENODEV; in dvbsky_s960c_attach()
433 adap->fe[0]->ops.read_signal_strength = in dvbsky_s960c_attach()
434 adap->fe[0]->ops.tuner_ops.get_rf_strength; in dvbsky_s960c_attach()
437 state->fe_read_status = adap->fe[0]->ops.read_status; in dvbsky_s960c_attach()
438 adap->fe[0]->ops.read_status = dvbsky_usb_read_status; in dvbsky_s960c_attach()
440 /* hook fe: LNB off/on is control by Cypress usb chip. */ in dvbsky_s960c_attach()
441 state->fe_set_voltage = adap->fe[0]->ops.set_voltage; in dvbsky_s960c_attach()
442 adap->fe[0]->ops.set_voltage = dvbsky_usb_ci_set_voltage; in dvbsky_s960c_attach()
456 /* attach demod */ in dvbsky_t680c_attach()
458 si2168_config.fe = &adap->fe[0]; in dvbsky_t680c_attach()
461 state->i2c_client_demod = dvb_module_probe("si2168", NULL, in dvbsky_t680c_attach()
462 &d->i2c_adap, in dvbsky_t680c_attach()
464 if (!state->i2c_client_demod) in dvbsky_t680c_attach()
465 return -ENODEV; in dvbsky_t680c_attach()
467 /* attach tuner */ in dvbsky_t680c_attach()
468 si2157_config.fe = adap->fe[0]; in dvbsky_t680c_attach()
471 state->i2c_client_tuner = dvb_module_probe("si2157", NULL, in dvbsky_t680c_attach()
474 if (!state->i2c_client_tuner) { in dvbsky_t680c_attach()
475 dvb_module_release(state->i2c_client_demod); in dvbsky_t680c_attach()
476 return -ENODEV; in dvbsky_t680c_attach()
479 /* attach ci controller */ in dvbsky_t680c_attach()
480 sp2_config.dvb_adap = &adap->dvb_adap; in dvbsky_t680c_attach()
484 state->i2c_client_ci = dvb_module_probe("sp2", NULL, in dvbsky_t680c_attach()
485 &d->i2c_adap, in dvbsky_t680c_attach()
488 if (!state->i2c_client_ci) { in dvbsky_t680c_attach()
489 dvb_module_release(state->i2c_client_tuner); in dvbsky_t680c_attach()
490 dvb_module_release(state->i2c_client_demod); in dvbsky_t680c_attach()
491 return -ENODEV; in dvbsky_t680c_attach()
505 /* attach demod */ in dvbsky_t330_attach()
507 si2168_config.fe = &adap->fe[0]; in dvbsky_t330_attach()
511 state->i2c_client_demod = dvb_module_probe("si2168", NULL, in dvbsky_t330_attach()
512 &d->i2c_adap, in dvbsky_t330_attach()
514 if (!state->i2c_client_demod) in dvbsky_t330_attach()
515 return -ENODEV; in dvbsky_t330_attach()
517 /* attach tuner */ in dvbsky_t330_attach()
518 si2157_config.fe = adap->fe[0]; in dvbsky_t330_attach()
521 state->i2c_client_tuner = dvb_module_probe("si2157", NULL, in dvbsky_t330_attach()
524 if (!state->i2c_client_tuner) { in dvbsky_t330_attach()
525 dvb_module_release(state->i2c_client_demod); in dvbsky_t330_attach()
526 return -ENODEV; in dvbsky_t330_attach()
540 /* attach demod */ in dvbsky_mygica_t230c_attach()
542 si2168_config.fe = &adap->fe[0]; in dvbsky_mygica_t230c_attach()
544 if (le16_to_cpu(d->udev->descriptor.idProduct) == USB_PID_MYGICA_T230C2 || in dvbsky_mygica_t230c_attach()
545 le16_to_cpu(d->udev->descriptor.idProduct) == USB_PID_MYGICA_T230C2_LITE || in dvbsky_mygica_t230c_attach()
546 le16_to_cpu(d->udev->descriptor.idProduct) == USB_PID_MYGICA_T230A) in dvbsky_mygica_t230c_attach()
550 state->i2c_client_demod = dvb_module_probe("si2168", NULL, in dvbsky_mygica_t230c_attach()
551 &d->i2c_adap, in dvbsky_mygica_t230c_attach()
553 if (!state->i2c_client_demod) in dvbsky_mygica_t230c_attach()
554 return -ENODEV; in dvbsky_mygica_t230c_attach()
556 /* attach tuner */ in dvbsky_mygica_t230c_attach()
557 si2157_config.fe = adap->fe[0]; in dvbsky_mygica_t230c_attach()
558 if (le16_to_cpu(d->udev->descriptor.idProduct) == USB_PID_MYGICA_T230) { in dvbsky_mygica_t230c_attach()
560 state->i2c_client_tuner = dvb_module_probe("si2157", NULL, in dvbsky_mygica_t230c_attach()
566 state->i2c_client_tuner = dvb_module_probe("si2157", "si2141", in dvbsky_mygica_t230c_attach()
571 if (!state->i2c_client_tuner) { in dvbsky_mygica_t230c_attach()
572 dvb_module_release(state->i2c_client_demod); in dvbsky_mygica_t230c_attach()
573 return -ENODEV; in dvbsky_mygica_t230c_attach()
582 if (le16_to_cpu(d->udev->descriptor.idProduct) == USB_PID_MYGICA_T230A) { in dvbsky_identify_state()
606 state->last_lock = 0; in dvbsky_init()
615 dev_dbg(&d->udev->dev, "%s: adap=%d\n", __func__, adap->id); in dvbsky_frontend_detach()
617 dvb_module_release(state->i2c_client_tuner); in dvbsky_frontend_detach()
618 dvb_module_release(state->i2c_client_demod); in dvbsky_frontend_detach()
619 dvb_module_release(state->i2c_client_ci); in dvbsky_frontend_detach()
624 /* DVB USB Driver stuff */
770 &dvbsky_t330_props, "TechnoTrend TVStick CT2-4400",
774 &dvbsky_t680c_props, "TechnoTrend TT-connect CT2-4650 CI",
778 &dvbsky_t680c_props, "TechnoTrend TT-connect CT2-4650 CI v1.1",
782 &dvbsky_s960c_props, "TechnoTrend TT-connect S2-4650 CI",
792 &mygica_t230c_props, "MyGica Mini DVB-(T/T2/C) USB Stick T230",
795 &mygica_t230c_props, "MyGica Mini DVB-(T/T2/C) USB Stick T230C",
798 &mygica_t230c_props, "MyGica Mini DVB-(T/T2/C) USB Stick T230C Lite",
801 &mygica_t230c_props, "MyGica Mini DVB-(T/T2/C) USB Stick T230C v2",
804 &mygica_t230c_props, "MyGica Mini DVB-(T/T2/C) USB Stick T230C v2 Lite",
807 &mygica_t230c_props, "MyGica Mini DVB-(T/T2/C) USB Stick T230A",
811 MODULE_DEVICE_TABLE(usb, dvbsky_id_table);
828 MODULE_DESCRIPTION("Driver for DVBSky USB");