Lines Matching +full:lna +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (C) 2005-9 DiBcom, SA et al
29 MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifier(s) (LNA), if ap…
38 /* Hauppauge Nova-T 500 (aka Bristol)
39 * has a LNA on GPIO0 which is enabled by setting 1 */
87 struct dib0700_state *st = adap->dev->priv; in bristol_frontend_attach()
88 if (adap->id == 0) { in bristol_frontend_attach()
89 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); in bristol_frontend_attach()
90 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); in bristol_frontend_attach()
91 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); in bristol_frontend_attach()
92 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(10); in bristol_frontend_attach()
95 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in bristol_frontend_attach()
97 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0); in bristol_frontend_attach()
99 …if (dib3000mc_i2c_enumeration(&adap->dev->i2c_adap, 2, DEFAULT_DIB3000P_I2C_ADDRESS, bristol_dib30… in bristol_frontend_attach()
100 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(10); in bristol_frontend_attach()
101 return -ENODEV; in bristol_frontend_attach()
104 st->mt2060_if1[adap->id] = 1220; in bristol_frontend_attach()
105 return (adap->fe_adap[0].fe = dvb_attach(dib3000mc_attach, &adap->dev->i2c_adap, in bristol_frontend_attach()
106 (10 + adap->id) << 1, &bristol_dib3000mc_config[adap->id])) == NULL ? -ENODEV : 0; in bristol_frontend_attach()
115 if (i2c_transfer(adap, msg, 2) != 2) return -EREMOTEIO; in eeprom_read()
121 struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap; in bristol_tuner_attach()
122 struct i2c_adapter *tun_i2c = dib3000mc_get_tuner_i2c_master(adap->fe_adap[0].fe, 1); in bristol_tuner_attach()
125 if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) && in bristol_tuner_attach()
126 adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_500_2)) { in bristol_tuner_attach()
127 if (!eeprom_read(prim_i2c,0x59 + adap->id,&a)) if1=1220+a; in bristol_tuner_attach()
129 return dvb_attach(mt2060_attach, adap->fe_adap[0].fe, tun_i2c, in bristol_tuner_attach()
130 &bristol_mt2060_config[adap->id], if1) == NULL ? in bristol_tuner_attach()
131 -ENODEV : 0; in bristol_tuner_attach()
134 /* STK7700D: Pinnacle/Terratec/Hauppauge Dual DVB-T Diversity */
275 struct dib0700_adapter_state *state = adap->priv; in stk7700P2_frontend_attach()
277 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in stk7700P2_frontend_attach()
278 return -ENODEV; in stk7700P2_frontend_attach()
280 if (adap->id == 0) { in stk7700P2_frontend_attach()
281 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in stk7700P2_frontend_attach()
283 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in stk7700P2_frontend_attach()
284 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in stk7700P2_frontend_attach()
285 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in stk7700P2_frontend_attach()
286 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in stk7700P2_frontend_attach()
288 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in stk7700P2_frontend_attach()
290 if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 18, in stk7700P2_frontend_attach()
293 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); in stk7700P2_frontend_attach()
294 dvb_detach(state->dib7000p_ops.set_wbd_ref); in stk7700P2_frontend_attach()
295 return -ENODEV; in stk7700P2_frontend_attach()
299 adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, in stk7700P2_frontend_attach()
300 0x80 + (adap->id << 1), in stk7700P2_frontend_attach()
301 &stk7700d_dib7000p_mt2266_config[adap->id]); in stk7700P2_frontend_attach()
303 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk7700P2_frontend_attach()
308 struct dib0700_adapter_state *state = adap->priv; in stk7700d_frontend_attach()
310 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in stk7700d_frontend_attach()
311 return -ENODEV; in stk7700d_frontend_attach()
313 if (adap->id == 0) { in stk7700d_frontend_attach()
314 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in stk7700d_frontend_attach()
316 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in stk7700d_frontend_attach()
317 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in stk7700d_frontend_attach()
318 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in stk7700d_frontend_attach()
319 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in stk7700d_frontend_attach()
321 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in stk7700d_frontend_attach()
323 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in stk7700d_frontend_attach()
324 if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 2, 18, in stk7700d_frontend_attach()
327 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); in stk7700d_frontend_attach()
328 dvb_detach(state->dib7000p_ops.set_wbd_ref); in stk7700d_frontend_attach()
329 return -ENODEV; in stk7700d_frontend_attach()
333 adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, in stk7700d_frontend_attach()
334 0x80 + (adap->id << 1), in stk7700d_frontend_attach()
335 &stk7700d_dib7000p_mt2266_config[adap->id]); in stk7700d_frontend_attach()
337 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk7700d_frontend_attach()
343 struct dib0700_adapter_state *state = adap->priv; in stk7700d_tuner_attach()
345 tun_i2c = state->dib7000p_ops.get_i2c_master(adap->fe_adap[0].fe, in stk7700d_tuner_attach()
347 return dvb_attach(mt2266_attach, adap->fe_adap[0].fe, tun_i2c, in stk7700d_tuner_attach()
348 &stk7700d_mt2266_config[adap->id]) == NULL ? -ENODEV : 0; in stk7700d_tuner_attach()
351 /* STK7700-PH: Digital/Analog Hybrid Tuner, e.h. Cinergy HT USB HE */
423 struct dib0700_adapter_state *state = adap->priv; in stk7700ph_xc3028_callback()
428 state->dib7000p_ops.set_gpio(adap->fe_adap[0].fe, 8, 0, 0); in stk7700ph_xc3028_callback()
430 state->dib7000p_ops.set_gpio(adap->fe_adap[0].fe, 8, 0, 1); in stk7700ph_xc3028_callback()
438 return -EINVAL; in stk7700ph_xc3028_callback()
456 struct usb_device_descriptor *desc = &adap->dev->udev->descriptor; in stk7700ph_frontend_attach()
457 struct dib0700_adapter_state *state = adap->priv; in stk7700ph_frontend_attach()
459 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in stk7700ph_frontend_attach()
460 return -ENODEV; in stk7700ph_frontend_attach()
462 if (desc->idVendor == cpu_to_le16(USB_VID_PINNACLE) && in stk7700ph_frontend_attach()
463 desc->idProduct == cpu_to_le16(USB_PID_PINNACLE_EXPRESSCARD_320CX)) in stk7700ph_frontend_attach()
464 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); in stk7700ph_frontend_attach()
466 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in stk7700ph_frontend_attach()
468 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in stk7700ph_frontend_attach()
469 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in stk7700ph_frontend_attach()
470 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in stk7700ph_frontend_attach()
471 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in stk7700ph_frontend_attach()
473 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in stk7700ph_frontend_attach()
475 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in stk7700ph_frontend_attach()
478 if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 18, in stk7700ph_frontend_attach()
480 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", in stk7700ph_frontend_attach()
482 dvb_detach(state->dib7000p_ops.set_wbd_ref); in stk7700ph_frontend_attach()
483 return -ENODEV; in stk7700ph_frontend_attach()
486 adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x80, in stk7700ph_frontend_attach()
489 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk7700ph_frontend_attach()
495 struct dib0700_adapter_state *state = adap->priv; in stk7700ph_tuner_attach()
497 tun_i2c = state->dib7000p_ops.get_i2c_master(adap->fe_adap[0].fe, in stk7700ph_tuner_attach()
503 adap->fe_adap[0].fe->callback = stk7700ph_xc3028_callback; in stk7700ph_tuner_attach()
505 return dvb_attach(xc2028_attach, adap->fe_adap[0].fe, &stk7700ph_xc3028_config) in stk7700ph_tuner_attach()
506 == NULL ? -ENODEV : 0; in stk7700ph_tuner_attach()
522 struct dib0700_state *st = d->priv; in dib0700_rc_query_old_firmware()
524 if (st->fw_version >= 0x10200) { in dib0700_rc_query_old_firmware()
527 dvb-usb-remote.c. However, the actual work is being done in dib0700_rc_query_old_firmware()
532 st->buf[0] = REQUEST_POLL_RC; in dib0700_rc_query_old_firmware()
533 st->buf[1] = 0; in dib0700_rc_query_old_firmware()
535 i = dib0700_ctrl_rd(d, st->buf, 2, st->buf, 4); in dib0700_rc_query_old_firmware()
538 return -EIO; in dib0700_rc_query_old_firmware()
542 if (st->buf[0] == 0 && st->buf[1] == 0 in dib0700_rc_query_old_firmware()
543 && st->buf[2] == 0 && st->buf[3] == 0) in dib0700_rc_query_old_firmware()
546 … %2X %2X %2X",dvb_usb_dib0700_ir_proto,(int)st->buf[3 - 2],(int)st->buf[3 - 3],(int)st->buf[3 - 1]… in dib0700_rc_query_old_firmware()
550 switch (d->props.rc.core.protocol) { in dib0700_rc_query_old_firmware()
553 if ((st->buf[3 - 2] == 0x00) && (st->buf[3 - 3] == 0x00) && in dib0700_rc_query_old_firmware()
554 (st->buf[3] == 0xff)) { in dib0700_rc_query_old_firmware()
555 rc_repeat(d->rc_dev); in dib0700_rc_query_old_firmware()
560 scancode = RC_SCANCODE_NEC(st->buf[3 - 2], st->buf[3 - 3]); in dib0700_rc_query_old_firmware()
565 /* RC-5 protocol changes toggle bit on new keypress */ in dib0700_rc_query_old_firmware()
567 scancode = RC_SCANCODE_RC5(st->buf[3 - 2], st->buf[3 - 3]); in dib0700_rc_query_old_firmware()
568 toggle = st->buf[3 - 1]; in dib0700_rc_query_old_firmware()
572 rc_keydown(d->rc_dev, protocol, scancode, toggle); in dib0700_rc_query_old_firmware()
576 /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
703 struct dib0700_state *st = adap->dev->priv; in stk7700p_frontend_attach()
704 struct dib0700_adapter_state *state = adap->priv; in stk7700p_frontend_attach()
706 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in stk7700p_frontend_attach()
707 return -ENODEV; in stk7700p_frontend_attach()
709 /* unless there is no real power management in DVB - we leave the device on GPIO6 */ in stk7700p_frontend_attach()
711 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in stk7700p_frontend_attach()
712 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); msleep(50); in stk7700p_frontend_attach()
714 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); msleep(10); in stk7700p_frontend_attach()
715 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in stk7700p_frontend_attach()
717 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); msleep(10); in stk7700p_frontend_attach()
718 dib0700_ctrl_clock(adap->dev, 72, 1); in stk7700p_frontend_attach()
719 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); msleep(100); in stk7700p_frontend_attach()
721 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in stk7700p_frontend_attach()
723 st->mt2060_if1[0] = 1220; in stk7700p_frontend_attach()
725 if (state->dib7000p_ops.dib7000pc_detection(&adap->dev->i2c_adap)) { in stk7700p_frontend_attach()
726 …adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 18, &stk7700p_dib7000p_config… in stk7700p_frontend_attach()
727 st->is_dib7000pc = 1; in stk7700p_frontend_attach()
729 memset(&state->dib7000p_ops, 0, sizeof(state->dib7000p_ops)); in stk7700p_frontend_attach()
730 …adap->fe_adap[0].fe = dvb_attach(dib7000m_attach, &adap->dev->i2c_adap, 18, &stk7700p_dib7000m_con… in stk7700p_frontend_attach()
733 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk7700p_frontend_attach()
742 struct i2c_adapter *prim_i2c = &adap->dev->i2c_adap; in stk7700p_tuner_attach()
743 struct dib0700_state *st = adap->dev->priv; in stk7700p_tuner_attach()
745 struct dib0700_adapter_state *state = adap->priv; in stk7700p_tuner_attach()
749 if (adap->dev->udev->descriptor.idVendor == cpu_to_le16(USB_VID_HAUPPAUGE) && in stk7700p_tuner_attach()
750 adap->dev->udev->descriptor.idProduct == cpu_to_le16(USB_PID_HAUPPAUGE_NOVA_T_STICK)) { in stk7700p_tuner_attach()
753 if (st->is_dib7000pc) in stk7700p_tuner_attach()
754 tun_i2c = state->dib7000p_ops.get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_TUNER, 1); in stk7700p_tuner_attach()
756 tun_i2c = dib7000m_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_TUNER, 1); in stk7700p_tuner_attach()
758 return dvb_attach(mt2060_attach, adap->fe_adap[0].fe, tun_i2c, &stk7700p_mt2060_config, in stk7700p_tuner_attach()
759 if1) == NULL ? -ENODEV : 0; in stk7700p_tuner_attach()
798 struct dvb_usb_adapter *adap = fe->dvb->priv; in dib7070_tuner_reset()
799 struct dib0700_adapter_state *state = adap->priv; in dib7070_tuner_reset()
802 return state->dib7000p_ops.set_gpio(fe, 8, 0, !onoff); in dib7070_tuner_reset()
807 struct dvb_usb_adapter *adap = fe->dvb->priv; in dib7070_tuner_sleep()
808 struct dib0700_adapter_state *state = adap->priv; in dib7070_tuner_sleep()
811 return state->dib7000p_ops.set_gpio(fe, 9, 0, onoff); in dib7070_tuner_sleep()
843 struct dtv_frontend_properties *p = &fe->dtv_property_cache; in dib7070_set_param_override()
844 struct dvb_usb_adapter *adap = fe->dvb->priv; in dib7070_set_param_override()
845 struct dib0700_adapter_state *state = adap->priv; in dib7070_set_param_override()
848 u8 band = BAND_OF_FREQUENCY(p->frequency/1000); in dib7070_set_param_override()
855 state->dib7000p_ops.set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); in dib7070_set_param_override()
856 return state->set_param_save(fe); in dib7070_set_param_override()
861 struct dtv_frontend_properties *p = &fe->dtv_property_cache; in dib7770_set_param_override()
862 struct dvb_usb_adapter *adap = fe->dvb->priv; in dib7770_set_param_override()
863 struct dib0700_adapter_state *state = adap->priv; in dib7770_set_param_override()
866 u8 band = BAND_OF_FREQUENCY(p->frequency/1000); in dib7770_set_param_override()
869 state->dib7000p_ops.set_gpio(fe, 0, 0, 1); in dib7770_set_param_override()
874 state->dib7000p_ops.set_gpio(fe, 0, 0, 0); in dib7770_set_param_override()
879 state->dib7000p_ops.set_wbd_ref(fe, offset + dib0070_wbd_offset(fe)); in dib7770_set_param_override()
880 return state->set_param_save(fe); in dib7770_set_param_override()
885 struct dib0700_adapter_state *st = adap->priv; in dib7770p_tuner_attach()
886 struct i2c_adapter *tun_i2c = st->dib7000p_ops.get_i2c_master(adap->fe_adap[0].fe, in dib7770p_tuner_attach()
889 if (dvb_attach(dib0070_attach, adap->fe_adap[0].fe, tun_i2c, in dib7770p_tuner_attach()
891 return -ENODEV; in dib7770p_tuner_attach()
893 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; in dib7770p_tuner_attach()
894 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib7770_set_param_override; in dib7770p_tuner_attach()
900 struct dib0700_adapter_state *st = adap->priv; in dib7070p_tuner_attach()
901 …struct i2c_adapter *tun_i2c = st->dib7000p_ops.get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INT… in dib7070p_tuner_attach()
903 if (adap->id == 0) { in dib7070p_tuner_attach()
904 if (dvb_attach(dib0070_attach, adap->fe_adap[0].fe, tun_i2c, &dib7070p_dib0070_config[0]) == NULL) in dib7070p_tuner_attach()
905 return -ENODEV; in dib7070p_tuner_attach()
907 if (dvb_attach(dib0070_attach, adap->fe_adap[0].fe, tun_i2c, &dib7070p_dib0070_config[1]) == NULL) in dib7070p_tuner_attach()
908 return -ENODEV; in dib7070p_tuner_attach()
911 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; in dib7070p_tuner_attach()
912 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib7070_set_param_override; in dib7070p_tuner_attach()
919 struct dib0700_adapter_state *state = adapter->priv; in stk7700p_pid_filter()
920 struct dib0700_state *st = adapter->dev->priv; in stk7700p_pid_filter()
922 if (st->is_dib7000pc) in stk7700p_pid_filter()
923 return state->dib7000p_ops.pid_filter(adapter->fe_adap[0].fe, index, pid, onoff); in stk7700p_pid_filter()
924 return dib7000m_pid_filter(adapter->fe_adap[0].fe, index, pid, onoff); in stk7700p_pid_filter()
929 struct dib0700_state *st = adapter->dev->priv; in stk7700p_pid_filter_ctrl()
930 struct dib0700_adapter_state *state = adapter->priv; in stk7700p_pid_filter_ctrl()
931 if (st->is_dib7000pc) in stk7700p_pid_filter_ctrl()
932 return state->dib7000p_ops.pid_filter_ctrl(adapter->fe_adap[0].fe, onoff); in stk7700p_pid_filter_ctrl()
933 return dib7000m_pid_filter_ctrl(adapter->fe_adap[0].fe, onoff); in stk7700p_pid_filter_ctrl()
938 struct dib0700_adapter_state *state = adapter->priv; in stk70x0p_pid_filter()
939 return state->dib7000p_ops.pid_filter(adapter->fe_adap[0].fe, index, pid, onoff); in stk70x0p_pid_filter()
944 struct dib0700_adapter_state *state = adapter->priv; in stk70x0p_pid_filter_ctrl()
945 return state->dib7000p_ops.pid_filter_ctrl(adapter->fe_adap[0].fe, onoff); in stk70x0p_pid_filter_ctrl()
986 struct usb_device_descriptor *p = &adap->dev->udev->descriptor; in stk7070p_frontend_attach()
987 struct dib0700_adapter_state *state = adap->priv; in stk7070p_frontend_attach()
989 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in stk7070p_frontend_attach()
990 return -ENODEV; in stk7070p_frontend_attach()
992 if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) && in stk7070p_frontend_attach()
993 p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E)) in stk7070p_frontend_attach()
994 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); in stk7070p_frontend_attach()
996 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in stk7070p_frontend_attach()
998 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in stk7070p_frontend_attach()
999 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in stk7070p_frontend_attach()
1000 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in stk7070p_frontend_attach()
1001 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in stk7070p_frontend_attach()
1003 dib0700_ctrl_clock(adap->dev, 72, 1); in stk7070p_frontend_attach()
1006 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in stk7070p_frontend_attach()
1008 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in stk7070p_frontend_attach()
1010 if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 18, in stk7070p_frontend_attach()
1012 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", in stk7070p_frontend_attach()
1014 dvb_detach(state->dib7000p_ops.set_wbd_ref); in stk7070p_frontend_attach()
1015 return -ENODEV; in stk7070p_frontend_attach()
1018 adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x80, in stk7070p_frontend_attach()
1020 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk7070p_frontend_attach()
1044 struct usb_device_descriptor *p = &adap->dev->udev->descriptor; in stk7770p_frontend_attach()
1045 struct dib0700_adapter_state *state = adap->priv; in stk7770p_frontend_attach()
1047 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in stk7770p_frontend_attach()
1048 return -ENODEV; in stk7770p_frontend_attach()
1050 if (p->idVendor == cpu_to_le16(USB_VID_PINNACLE) && in stk7770p_frontend_attach()
1051 p->idProduct == cpu_to_le16(USB_PID_PINNACLE_PCTV72E)) in stk7770p_frontend_attach()
1052 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); in stk7770p_frontend_attach()
1054 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in stk7770p_frontend_attach()
1056 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in stk7770p_frontend_attach()
1057 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in stk7770p_frontend_attach()
1058 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in stk7770p_frontend_attach()
1059 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in stk7770p_frontend_attach()
1061 dib0700_ctrl_clock(adap->dev, 72, 1); in stk7770p_frontend_attach()
1064 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in stk7770p_frontend_attach()
1066 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in stk7770p_frontend_attach()
1068 if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 18, in stk7770p_frontend_attach()
1070 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", in stk7770p_frontend_attach()
1072 dvb_detach(state->dib7000p_ops.set_wbd_ref); in stk7770p_frontend_attach()
1073 return -ENODEV; in stk7770p_frontend_attach()
1076 adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x80, in stk7770p_frontend_attach()
1078 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk7770p_frontend_attach()
1232 struct dvb_usb_adapter *adap = fe->dvb->priv; in dib80xx_tuner_reset()
1233 struct dib0700_adapter_state *state = adap->priv; in dib80xx_tuner_reset()
1235 return state->dib8000_ops.set_gpio(fe, 5, 0, !onoff); in dib80xx_tuner_reset()
1240 struct dvb_usb_adapter *adap = fe->dvb->priv; in dib80xx_tuner_sleep()
1241 struct dib0700_adapter_state *state = adap->priv; in dib80xx_tuner_sleep()
1243 return state->dib8000_ops.set_gpio(fe, 0, 0, onoff); in dib80xx_tuner_sleep()
1264 .freq_offset_khz_uhf = -100,
1265 .freq_offset_khz_vhf = -100,
1278 .freq_offset_khz_uhf = -25,
1279 .freq_offset_khz_vhf = -25,
1285 struct dtv_frontend_properties *p = &fe->dtv_property_cache; in dib807x_set_param_override()
1286 struct dvb_usb_adapter *adap = fe->dvb->priv; in dib807x_set_param_override()
1287 struct dib0700_adapter_state *state = adap->priv; in dib807x_set_param_override()
1290 u8 band = BAND_OF_FREQUENCY(p->frequency/1000); in dib807x_set_param_override()
1295 case BAND_UHF: /* fall-thru wanted */ in dib807x_set_param_override()
1300 state->dib8000_ops.set_wbd_ref(fe, offset); in dib807x_set_param_override()
1302 return state->set_param_save(fe); in dib807x_set_param_override()
1307 struct dib0700_adapter_state *st = adap->priv; in dib807x_tuner_attach()
1308 struct i2c_adapter *tun_i2c = st->dib8000_ops.get_i2c_master(adap->fe_adap[0].fe, in dib807x_tuner_attach()
1311 if (adap->id == 0) { in dib807x_tuner_attach()
1312 if (dvb_attach(dib0070_attach, adap->fe_adap[0].fe, tun_i2c, in dib807x_tuner_attach()
1314 return -ENODEV; in dib807x_tuner_attach()
1316 if (dvb_attach(dib0070_attach, adap->fe_adap[0].fe, tun_i2c, in dib807x_tuner_attach()
1318 return -ENODEV; in dib807x_tuner_attach()
1321 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; in dib807x_tuner_attach()
1322 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib807x_set_param_override; in dib807x_tuner_attach()
1329 struct dib0700_adapter_state *state = adapter->priv; in stk80xx_pid_filter()
1331 return state->dib8000_ops.pid_filter(adapter->fe_adap[0].fe, index, pid, onoff); in stk80xx_pid_filter()
1337 struct dib0700_adapter_state *state = adapter->priv; in stk80xx_pid_filter_ctrl()
1339 return state->dib8000_ops.pid_filter_ctrl(adapter->fe_adap[0].fe, onoff); in stk80xx_pid_filter_ctrl()
1345 struct dib0700_adapter_state *state = adap->priv; in stk807x_frontend_attach()
1347 if (!dvb_attach(dib8000_attach, &state->dib8000_ops)) in stk807x_frontend_attach()
1348 return -ENODEV; in stk807x_frontend_attach()
1350 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in stk807x_frontend_attach()
1352 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in stk807x_frontend_attach()
1353 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in stk807x_frontend_attach()
1354 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in stk807x_frontend_attach()
1356 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in stk807x_frontend_attach()
1358 dib0700_ctrl_clock(adap->dev, 72, 1); in stk807x_frontend_attach()
1361 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in stk807x_frontend_attach()
1363 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in stk807x_frontend_attach()
1365 state->dib8000_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 18, in stk807x_frontend_attach()
1368 adap->fe_adap[0].fe = state->dib8000_ops.init(&adap->dev->i2c_adap, 0x80, in stk807x_frontend_attach()
1371 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk807x_frontend_attach()
1377 struct dib0700_adapter_state *state = adap->priv; in stk807xpvr_frontend_attach0()
1379 if (!dvb_attach(dib8000_attach, &state->dib8000_ops)) in stk807xpvr_frontend_attach0()
1380 return -ENODEV; in stk807xpvr_frontend_attach0()
1382 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); in stk807xpvr_frontend_attach0()
1384 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in stk807xpvr_frontend_attach0()
1386 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in stk807xpvr_frontend_attach0()
1387 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in stk807xpvr_frontend_attach0()
1388 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in stk807xpvr_frontend_attach0()
1390 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in stk807xpvr_frontend_attach0()
1392 dib0700_ctrl_clock(adap->dev, 72, 1); in stk807xpvr_frontend_attach0()
1395 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in stk807xpvr_frontend_attach0()
1397 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in stk807xpvr_frontend_attach0()
1400 state->dib8000_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x22, 0x80, 0); in stk807xpvr_frontend_attach0()
1402 adap->fe_adap[0].fe = state->dib8000_ops.init(&adap->dev->i2c_adap, 0x80, in stk807xpvr_frontend_attach0()
1405 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk807xpvr_frontend_attach0()
1410 struct dib0700_adapter_state *state = adap->priv; in stk807xpvr_frontend_attach1()
1412 if (!dvb_attach(dib8000_attach, &state->dib8000_ops)) in stk807xpvr_frontend_attach1()
1413 return -ENODEV; in stk807xpvr_frontend_attach1()
1416 state->dib8000_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x12, 0x82, 0); in stk807xpvr_frontend_attach1()
1418 adap->fe_adap[0].fe = state->dib8000_ops.init(&adap->dev->i2c_adap, 0x82, in stk807xpvr_frontend_attach1()
1421 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk807xpvr_frontend_attach1()
1538 struct dvb_usb_adapter *adap = fe->dvb->priv; in dib8090_get_adc_power()
1539 struct dib0700_adapter_state *state = adap->priv; in dib8090_get_adc_power()
1541 return state->dib8000_ops.get_adc_power(fe, 1); in dib8090_get_adc_power()
1620 .freq_offset_khz_uhf = -63,
1621 .freq_offset_khz_vhf = -143,
1634 ratio = ((fe->dtv_property_cache.frequency / 1000) * (1 << 8) / 1000) / freq_adc; in dib8090_compute_pll_parameters()
1635 rest = ((fe->dtv_property_cache.frequency / 1000) * (1 << 8) / 1000) - ratio * freq_adc; in dib8090_compute_pll_parameters()
1638 rest = freq_adc - rest; in dib8090_compute_pll_parameters()
1652 struct dvb_usb_adapter *adap = fe->dvb->priv; in dib8096_set_param_override()
1653 struct dib0700_adapter_state *state = adap->priv; in dib8096_set_param_override()
1654 u8 pll_ratio, band = BAND_OF_FREQUENCY(fe->dtv_property_cache.frequency / 1000); in dib8096_set_param_override()
1662 …deb_info("Warning : Rf frequency (%iHz) is not in the supported range, using VHF switch ", fe->dt… in dib8096_set_param_override()
1665 state->dib8000_ops.set_gpio(fe, 3, 0, 1); in dib8096_set_param_override()
1668 state->dib8000_ops.set_gpio(fe, 3, 0, 0); in dib8096_set_param_override()
1672 ret = state->set_param_save(fe); in dib8096_set_param_override()
1676 if (fe->dtv_property_cache.bandwidth_hz != 6000000) { in dib8096_set_param_override()
1678 return -EINVAL; in dib8096_set_param_override()
1682 …state->dib8000_ops.update_pll(fe, &dib8090_pll_config_12mhz, fe->dtv_property_cache.bandwidth_hz /… in dib8096_set_param_override()
1696 …state->dib8000_ops.update_pll(fe, &dib8090_pll_config_12mhz, fe->dtv_property_cache.bandwidth_hz /… in dib8096_set_param_override()
1698 state->dib8000_ops.ctrl_timf(fe, DEMOD_TIMF_SET, timf); in dib8096_set_param_override()
1701 /* dib0090_get_wbd_target is returning any possible temperature compensated wbd-target */ in dib8096_set_param_override()
1703 state->dib8000_ops.set_wbd_ref(fe, target); in dib8096_set_param_override()
1707 deb_info("tuning in CBAND - soft-AGC startup\n"); in dib8096_set_param_override()
1715 state->dib8000_ops.set_gpio(fe, 6, 0, 1); in dib8096_set_param_override()
1719 state->dib8000_ops.set_gpio(fe, 6, 0, 0); in dib8096_set_param_override()
1725 state->dib8000_ops.pwm_agc_reset(fe); in dib8096_set_param_override()
1726 state->dib8000_ops.set_tune_state(fe, CT_DEMOD_START); in dib8096_set_param_override()
1729 deb_info("not tuning in CBAND - standard AGC startup\n"); in dib8096_set_param_override()
1738 struct dib0700_adapter_state *st = adap->priv; in dib809x_tuner_attach()
1739 …struct i2c_adapter *tun_i2c = st->dib8000_ops.get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTE… in dib809x_tuner_attach()
1741 /* FIXME: if adap->id != 0, check if it is fe_adap[1] */ in dib809x_tuner_attach()
1742 if (!dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config)) in dib809x_tuner_attach()
1743 return -ENODEV; in dib809x_tuner_attach()
1745 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; in dib809x_tuner_attach()
1746 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib8096_set_param_override; in dib809x_tuner_attach()
1752 struct dib0700_adapter_state *state = adap->priv; in stk809x_frontend_attach()
1754 if (!dvb_attach(dib8000_attach, &state->dib8000_ops)) in stk809x_frontend_attach()
1755 return -ENODEV; in stk809x_frontend_attach()
1757 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in stk809x_frontend_attach()
1759 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in stk809x_frontend_attach()
1760 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in stk809x_frontend_attach()
1761 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in stk809x_frontend_attach()
1763 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in stk809x_frontend_attach()
1765 dib0700_ctrl_clock(adap->dev, 72, 1); in stk809x_frontend_attach()
1768 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in stk809x_frontend_attach()
1770 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in stk809x_frontend_attach()
1772 state->dib8000_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 18, 0x80, 0); in stk809x_frontend_attach()
1774 …adap->fe_adap[0].fe = state->dib8000_ops.init(&adap->dev->i2c_adap, 0x80, &dib809x_dib8000_config[… in stk809x_frontend_attach()
1776 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk809x_frontend_attach()
1781 struct dib0700_adapter_state *state = adap->priv; in stk809x_frontend1_attach()
1783 if (!dvb_attach(dib8000_attach, &state->dib8000_ops)) in stk809x_frontend1_attach()
1784 return -ENODEV; in stk809x_frontend1_attach()
1786 state->dib8000_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, 0x82, 0); in stk809x_frontend1_attach()
1788 …adap->fe_adap[0].fe = state->dib8000_ops.init(&adap->dev->i2c_adap, 0x82, &dib809x_dib8000_config[… in stk809x_frontend1_attach()
1790 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk809x_frontend1_attach()
1795 struct dib0700_adapter_state *st = adap->priv; in nim8096md_tuner_attach()
1797 struct dvb_frontend *fe_slave = st->dib8000_ops.get_slave_frontend(adap->fe_adap[0].fe, 1); in nim8096md_tuner_attach()
1800 tun_i2c = st->dib8000_ops.get_i2c_master(fe_slave, DIBX000_I2C_INTERFACE_TUNER, 1); in nim8096md_tuner_attach()
1802 return -ENODEV; in nim8096md_tuner_attach()
1803 fe_slave->dvb = adap->fe_adap[0].fe->dvb; in nim8096md_tuner_attach()
1804 fe_slave->ops.tuner_ops.set_params = dib8096_set_param_override; in nim8096md_tuner_attach()
1806 tun_i2c = st->dib8000_ops.get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_TUNER, 1); in nim8096md_tuner_attach()
1807 if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL) in nim8096md_tuner_attach()
1808 return -ENODEV; in nim8096md_tuner_attach()
1810 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; in nim8096md_tuner_attach()
1811 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib8096_set_param_override; in nim8096md_tuner_attach()
1819 struct dib0700_adapter_state *state = adap->priv; in nim8096md_frontend_attach()
1821 if (!dvb_attach(dib8000_attach, &state->dib8000_ops)) in nim8096md_frontend_attach()
1822 return -ENODEV; in nim8096md_frontend_attach()
1824 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); in nim8096md_frontend_attach()
1826 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in nim8096md_frontend_attach()
1828 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in nim8096md_frontend_attach()
1829 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in nim8096md_frontend_attach()
1830 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in nim8096md_frontend_attach()
1832 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in nim8096md_frontend_attach()
1834 dib0700_ctrl_clock(adap->dev, 72, 1); in nim8096md_frontend_attach()
1837 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in nim8096md_frontend_attach()
1839 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in nim8096md_frontend_attach()
1841 state->dib8000_ops.i2c_enumeration(&adap->dev->i2c_adap, 2, 18, 0x80, 0); in nim8096md_frontend_attach()
1843 …adap->fe_adap[0].fe = state->dib8000_ops.init(&adap->dev->i2c_adap, 0x80, &dib809x_dib8000_config[… in nim8096md_frontend_attach()
1844 if (adap->fe_adap[0].fe == NULL) in nim8096md_frontend_attach()
1845 return -ENODEV; in nim8096md_frontend_attach()
1848 if (!dvb_attach(dib8000_attach, &state->dib8000_ops)) in nim8096md_frontend_attach()
1849 return -ENODEV; in nim8096md_frontend_attach()
1851 fe_slave = state->dib8000_ops.init(&adap->dev->i2c_adap, 0x82, &dib809x_dib8000_config[1]); in nim8096md_frontend_attach()
1852 state->dib8000_ops.set_slave_frontend(adap->fe_adap[0].fe, fe_slave); in nim8096md_frontend_attach()
1854 return fe_slave == NULL ? -ENODEV : 0; in nim8096md_frontend_attach()
2005 .freq_offset_khz_uhf = -143,
2006 .freq_offset_khz_vhf = -143,
2044 adc->timf = 0; in dib8096p_get_best_sampling()
2045 adc->pll_loopdiv = loopdiv; in dib8096p_get_best_sampling()
2046 adc->pll_prediv = prediv; in dib8096p_get_best_sampling()
2048 deb_info("bandwidth = %d", fe->dtv_property_cache.bandwidth_hz); in dib8096p_get_best_sampling()
2054 max_prediv--; in dib8096p_get_best_sampling()
2057 min_prediv--; in dib8096p_get_best_sampling()
2074 …if ((fdem >= fdem_min) && (fmem <= fmem_max) && (fs >= fe->dtv_property_cache.bandwidth_hz / 1000)… in dib8096p_get_best_sampling()
2077 …for (harmonic_id = (fe->dtv_property_cache.frequency / (1000 * fs)); harmonic_id <= ((fe->dtv_pro… in dib8096p_get_best_sampling()
2078->dtv_property_cache.frequency / 1000 - (fe->dtv_property_cache.bandwidth_hz / 2000))) && ((fs * … in dib8096p_get_best_sampling()
2085 adc->pll_loopdiv = loopdiv; in dib8096p_get_best_sampling()
2086 adc->pll_prediv = prediv; in dib8096p_get_best_sampling()
2087 adc->timf = (4260880253U / fdem) * (1 << 8); in dib8096p_get_best_sampling()
2088 adc->timf += ((4260880253U % fdem) << 8) / fdem; in dib8096p_get_best_sampling()
2090 … %2d; Timf %8d;", fe->dtv_property_cache.frequency, fe->dtv_property_cache.bandwidth_hz, xtal, fme… in dib8096p_get_best_sampling()
2100 if (adc->pll_loopdiv == 0 && adc->pll_prediv == 0) in dib8096p_get_best_sampling()
2101 return -EINVAL; in dib8096p_get_best_sampling()
2107 struct dvb_usb_adapter *adap = fe->dvb->priv; in dib8096p_agc_startup()
2108 struct dib0700_adapter_state *state = adap->priv; in dib8096p_agc_startup()
2114 ret = state->set_param_save(fe); in dib8096p_agc_startup()
2121 temperature compensated wbd-target */ in dib8096p_agc_startup()
2123 state->dib8000_ops.set_wbd_ref(fe, target); in dib8096p_agc_startup()
2129 dib0700_set_i2c_speed(adap->dev, 200); in dib8096p_agc_startup()
2130 state->dib8000_ops.update_pll(fe, &pll, fe->dtv_property_cache.bandwidth_hz / 1000, 0); in dib8096p_agc_startup()
2131 state->dib8000_ops.ctrl_timf(fe, DEMOD_TIMF_SET, adc.timf); in dib8096p_agc_startup()
2132 dib0700_set_i2c_speed(adap->dev, 1000); in dib8096p_agc_startup()
2139 struct dib0700_state *st = adap->dev->priv; in tfe8096p_frontend_attach()
2141 struct dib0700_adapter_state *state = adap->priv; in tfe8096p_frontend_attach()
2143 if (!dvb_attach(dib8000_attach, &state->dib8000_ops)) in tfe8096p_frontend_attach()
2144 return -ENODEV; in tfe8096p_frontend_attach()
2146 dib0700_get_version(adap->dev, NULL, NULL, &fw_version, NULL); in tfe8096p_frontend_attach()
2148 st->fw_use_new_i2c_api = 1; in tfe8096p_frontend_attach()
2150 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in tfe8096p_frontend_attach()
2152 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in tfe8096p_frontend_attach()
2153 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in tfe8096p_frontend_attach()
2154 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in tfe8096p_frontend_attach()
2156 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in tfe8096p_frontend_attach()
2158 dib0700_ctrl_clock(adap->dev, 72, 1); in tfe8096p_frontend_attach()
2161 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in tfe8096p_frontend_attach()
2163 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in tfe8096p_frontend_attach()
2165 state->dib8000_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, 0x80, 1); in tfe8096p_frontend_attach()
2167 adap->fe_adap[0].fe = state->dib8000_ops.init(&adap->dev->i2c_adap, in tfe8096p_frontend_attach()
2170 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in tfe8096p_frontend_attach()
2175 struct dib0700_adapter_state *st = adap->priv; in tfe8096p_tuner_attach()
2176 struct i2c_adapter *tun_i2c = st->dib8000_ops.get_i2c_tuner(adap->fe_adap[0].fe); in tfe8096p_tuner_attach()
2178 tfe8096p_dib0090_config.reset = st->dib8000_ops.tuner_sleep; in tfe8096p_tuner_attach()
2179 tfe8096p_dib0090_config.sleep = st->dib8000_ops.tuner_sleep; in tfe8096p_tuner_attach()
2182 if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, in tfe8096p_tuner_attach()
2184 return -ENODEV; in tfe8096p_tuner_attach()
2186 st->dib8000_ops.set_gpio(adap->fe_adap[0].fe, 8, 0, 1); in tfe8096p_tuner_attach()
2188 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; in tfe8096p_tuner_attach()
2189 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib8096p_agc_startup; in tfe8096p_tuner_attach()
2196 return dib9000_fw_pid_filter(adapter->fe_adap[0].fe, index, pid, onoff); in dib90x0_pid_filter()
2201 return dib9000_fw_pid_filter_ctrl(adapter->fe_adap[0].fe, onoff); in dib90x0_pid_filter_ctrl()
2227 return -EIO; in dib01x0_pmu_update()
2232 return -EIO; in dib01x0_pmu_update()
2241 return -EIO; in dib01x0_pmu_update()
2253 return -EIO; in dib01x0_pmu_update()
2262 return -EIO; in dib01x0_pmu_update()
2378 struct dib0700_adapter_state *state = adap->priv; in stk9090m_frontend_attach()
2379 struct dib0700_state *st = adap->dev->priv; in stk9090m_frontend_attach()
2383 dib0700_get_version(adap->dev, NULL, NULL, &fw_version, NULL); in stk9090m_frontend_attach()
2385 st->fw_use_new_i2c_api = 1; in stk9090m_frontend_attach()
2386 dib0700_set_i2c_speed(adap->dev, 340); in stk9090m_frontend_attach()
2388 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in stk9090m_frontend_attach()
2390 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in stk9090m_frontend_attach()
2391 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in stk9090m_frontend_attach()
2392 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in stk9090m_frontend_attach()
2393 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in stk9090m_frontend_attach()
2395 dib0700_ctrl_clock(adap->dev, 72, 1); in stk9090m_frontend_attach()
2398 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in stk9090m_frontend_attach()
2400 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in stk9090m_frontend_attach()
2402 dib9000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, 0x80); in stk9090m_frontend_attach()
2404 if (request_firmware(&state->frontend_firmware, "dib9090.fw", &adap->dev->udev->dev)) { in stk9090m_frontend_attach()
2406 return -ENODEV; in stk9090m_frontend_attach()
2408 deb_info("%s: firmware read %zu bytes.\n", __func__, state->frontend_firmware->size); in stk9090m_frontend_attach()
2410 stk9090m_config.microcode_B_fe_size = state->frontend_firmware->size; in stk9090m_frontend_attach()
2411 stk9090m_config.microcode_B_fe_buffer = state->frontend_firmware->data; in stk9090m_frontend_attach()
2413 adap->fe_adap[0].fe = dvb_attach(dib9000_attach, &adap->dev->i2c_adap, 0x80, &stk9090m_config); in stk9090m_frontend_attach()
2415 if (!adap->fe_adap[0].fe) { in stk9090m_frontend_attach()
2416 release_firmware(state->frontend_firmware); in stk9090m_frontend_attach()
2417 return -ENODEV; in stk9090m_frontend_attach()
2425 struct dib0700_adapter_state *state = adap->priv; in dib9090_tuner_attach()
2426 struct i2c_adapter *i2c = dib9000_get_tuner_interface(adap->fe_adap[0].fe); in dib9090_tuner_attach()
2436 return -ENODEV; in dib9090_tuner_attach()
2437 if (dvb_attach(dib0090_fw_register, adap->fe_adap[0].fe, i2c, &dib9090_dib0090_config) == NULL) in dib9090_tuner_attach()
2438 return -ENODEV; in dib9090_tuner_attach()
2439 i2c = dib9000_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); in dib9090_tuner_attach()
2441 return -ENODEV; in dib9090_tuner_attach()
2443 return -ENODEV; in dib9090_tuner_attach()
2444 dib0700_set_i2c_speed(adap->dev, 1500); in dib9090_tuner_attach()
2445 if (dib9000_firmware_post_pll_init(adap->fe_adap[0].fe) < 0) in dib9090_tuner_attach()
2446 return -ENODEV; in dib9090_tuner_attach()
2447 release_firmware(state->frontend_firmware); in dib9090_tuner_attach()
2453 struct dib0700_adapter_state *state = adap->priv; in nim9090md_frontend_attach()
2454 struct dib0700_state *st = adap->dev->priv; in nim9090md_frontend_attach()
2460 dib0700_get_version(adap->dev, NULL, NULL, &fw_version, NULL); in nim9090md_frontend_attach()
2462 st->fw_use_new_i2c_api = 1; in nim9090md_frontend_attach()
2463 dib0700_set_i2c_speed(adap->dev, 340); in nim9090md_frontend_attach()
2465 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in nim9090md_frontend_attach()
2467 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in nim9090md_frontend_attach()
2468 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in nim9090md_frontend_attach()
2469 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in nim9090md_frontend_attach()
2470 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in nim9090md_frontend_attach()
2472 dib0700_ctrl_clock(adap->dev, 72, 1); in nim9090md_frontend_attach()
2475 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in nim9090md_frontend_attach()
2477 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in nim9090md_frontend_attach()
2479 if (request_firmware(&state->frontend_firmware, "dib9090.fw", &adap->dev->udev->dev)) { in nim9090md_frontend_attach()
2481 return -EIO; in nim9090md_frontend_attach()
2483 deb_info("%s: firmware read %zu bytes.\n", __func__, state->frontend_firmware->size); in nim9090md_frontend_attach()
2485 nim9090md_config[0].microcode_B_fe_size = state->frontend_firmware->size; in nim9090md_frontend_attach()
2486 nim9090md_config[0].microcode_B_fe_buffer = state->frontend_firmware->data; in nim9090md_frontend_attach()
2487 nim9090md_config[1].microcode_B_fe_size = state->frontend_firmware->size; in nim9090md_frontend_attach()
2488 nim9090md_config[1].microcode_B_fe_buffer = state->frontend_firmware->data; in nim9090md_frontend_attach()
2490 dib9000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x20, 0x80); in nim9090md_frontend_attach()
2491 adap->fe_adap[0].fe = dvb_attach(dib9000_attach, &adap->dev->i2c_adap, 0x80, &nim9090md_config[0]); in nim9090md_frontend_attach()
2493 if (!adap->fe_adap[0].fe) { in nim9090md_frontend_attach()
2494 release_firmware(state->frontend_firmware); in nim9090md_frontend_attach()
2495 return -ENODEV; in nim9090md_frontend_attach()
2498 i2c = dib9000_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_3_4, 0); in nim9090md_frontend_attach()
2502 dib9000_set_slave_frontend(adap->fe_adap[0].fe, fe_slave); in nim9090md_frontend_attach()
2505 release_firmware(state->frontend_firmware); in nim9090md_frontend_attach()
2506 return -ENODEV; in nim9090md_frontend_attach()
2514 struct dib0700_adapter_state *state = adap->priv; in nim9090md_tuner_attach()
2525 return -ENODEV; in nim9090md_tuner_attach()
2526 i2c = dib9000_get_tuner_interface(adap->fe_adap[0].fe); in nim9090md_tuner_attach()
2527 …if (dvb_attach(dib0090_fw_register, adap->fe_adap[0].fe, i2c, &nim9090md_dib0090_config[0]) == NUL… in nim9090md_tuner_attach()
2528 return -ENODEV; in nim9090md_tuner_attach()
2529 i2c = dib9000_get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_1_2, 0); in nim9090md_tuner_attach()
2531 return -ENODEV; in nim9090md_tuner_attach()
2533 return -ENODEV; in nim9090md_tuner_attach()
2535 dib0700_set_i2c_speed(adap->dev, 1500); in nim9090md_tuner_attach()
2536 if (dib9000_firmware_post_pll_init(adap->fe_adap[0].fe) < 0) in nim9090md_tuner_attach()
2537 return -ENODEV; in nim9090md_tuner_attach()
2539 fe_slave = dib9000_get_slave_frontend(adap->fe_adap[0].fe, 1); in nim9090md_tuner_attach()
2541 i2c = dib9000_get_component_bus_interface(adap->fe_adap[0].fe); in nim9090md_tuner_attach()
2546 return -ENODEV; in nim9090md_tuner_attach()
2547 fe_slave->dvb = adap->fe_adap[0].fe->dvb; in nim9090md_tuner_attach()
2548 dib9000_fw_set_component_bus_speed(adap->fe_adap[0].fe, 1500); in nim9090md_tuner_attach()
2550 return -ENODEV; in nim9090md_tuner_attach()
2552 release_firmware(state->frontend_firmware); in nim9090md_tuner_attach()
2570 adc->pll_loopdiv = loopdiv; in dib7090p_get_best_sampling()
2571 adc->pll_prediv = prediv; in dib7090p_get_best_sampling()
2572 adc->timf = 0; in dib7090p_get_best_sampling()
2574 deb_info("bandwidth = %d fdem_min =%d", fe->dtv_property_cache.bandwidth_hz, fdem_min); in dib7090p_get_best_sampling()
2580 max_prediv--; in dib7090p_get_best_sampling()
2583 min_prediv--; in dib7090p_get_best_sampling()
2599 …if ((fdem >= fdem_min) && (fdem <= fdem_max) && (fs >= fe->dtv_property_cache.bandwidth_hz/1000)) { in dib7090p_get_best_sampling()
2602 …for (harmonic_id = (fe->dtv_property_cache.frequency / (1000*fs)) ; harmonic_id <= ((fe->dtv_prop… in dib7090p_get_best_sampling()
2603->dtv_property_cache.frequency/1000) - (fe->dtv_property_cache.bandwidth_hz/2000))) && ((fs*harmo… in dib7090p_get_best_sampling()
2610 adc->pll_loopdiv = loopdiv; in dib7090p_get_best_sampling()
2611 adc->pll_prediv = prediv; in dib7090p_get_best_sampling()
2612 adc->timf = 2396745143UL/fdem*(1 << 9); in dib7090p_get_best_sampling()
2613 adc->timf += ((2396745143UL%fdem) << 9)/fdem; in dib7090p_get_best_sampling()
2614 deb_info("loopdiv=%i prediv=%i timf=%i", loopdiv, prediv, adc->timf); in dib7090p_get_best_sampling()
2625 if (adc->pll_loopdiv == 0 && adc->pll_prediv == 0) in dib7090p_get_best_sampling()
2626 return -EINVAL; in dib7090p_get_best_sampling()
2633 struct dvb_usb_adapter *adap = fe->dvb->priv; in dib7090_agc_startup()
2634 struct dib0700_adapter_state *state = adap->priv; in dib7090_agc_startup()
2640 ret = state->set_param_save(fe); in dib7090_agc_startup()
2647 state->dib7000p_ops.set_wbd_ref(fe, target); in dib7090_agc_startup()
2653 state->dib7000p_ops.update_pll(fe, &pll); in dib7090_agc_startup()
2654 state->dib7000p_ops.ctrl_timf(fe, DEMOD_TIMF_SET, adc.timf); in dib7090_agc_startup()
2669 struct dvb_usb_adapter *adap = fe->dvb->priv; in tfe7790p_update_lna()
2670 struct dib0700_adapter_state *state = adap->priv; in tfe7790p_update_lna()
2672 deb_info("update LNA: agc global=%i", agc_global); in tfe7790p_update_lna()
2675 state->dib7000p_ops.set_gpio(fe, 8, 0, 0); in tfe7790p_update_lna()
2676 state->dib7000p_ops.set_agc1_min(fe, 0); in tfe7790p_update_lna()
2678 state->dib7000p_ops.set_gpio(fe, 8, 0, 1); in tfe7790p_update_lna()
2679 state->dib7000p_ops.set_agc1_min(fe, 32768); in tfe7790p_update_lna()
2824 struct dvb_usb_adapter *adap = fe->dvb->priv; in tfe7090p_pvr_update_lna()
2825 struct dib0700_adapter_state *state = adap->priv; in tfe7090p_pvr_update_lna()
2827 deb_info("TFE7090P-PVR update LNA: agc global=%i", agc_global); in tfe7090p_pvr_update_lna()
2829 state->dib7000p_ops.set_gpio(fe, 5, 0, 0); in tfe7090p_pvr_update_lna()
2830 state->dib7000p_ops.set_agc1_min(fe, 0); in tfe7090p_pvr_update_lna()
2832 state->dib7000p_ops.set_gpio(fe, 5, 0, 1); in tfe7090p_pvr_update_lna()
2833 state->dib7000p_ops.set_agc1_min(fe, 32768); in tfe7090p_pvr_update_lna()
3026 .freq_offset_khz_uhf = -50,
3027 .freq_offset_khz_vhf = -70,
3050 struct dib0700_adapter_state *state = adap->priv; in nim7090_frontend_attach()
3052 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in nim7090_frontend_attach()
3053 return -ENODEV; in nim7090_frontend_attach()
3055 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in nim7090_frontend_attach()
3057 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in nim7090_frontend_attach()
3058 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in nim7090_frontend_attach()
3059 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in nim7090_frontend_attach()
3060 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in nim7090_frontend_attach()
3063 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in nim7090_frontend_attach()
3065 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in nim7090_frontend_attach()
3067 …if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, &nim7090_dib7000p_config) !… in nim7090_frontend_attach()
3068 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); in nim7090_frontend_attach()
3069 dvb_detach(state->dib7000p_ops.set_wbd_ref); in nim7090_frontend_attach()
3070 return -ENODEV; in nim7090_frontend_attach()
3072 …adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x80, &nim7090_dib7000p_confi… in nim7090_frontend_attach()
3074 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in nim7090_frontend_attach()
3079 struct dib0700_adapter_state *st = adap->priv; in nim7090_tuner_attach()
3080 struct i2c_adapter *tun_i2c = st->dib7000p_ops.get_i2c_tuner(adap->fe_adap[0].fe); in nim7090_tuner_attach()
3082 nim7090_dib0090_config.reset = st->dib7000p_ops.tuner_sleep; in nim7090_tuner_attach()
3083 nim7090_dib0090_config.sleep = st->dib7000p_ops.tuner_sleep; in nim7090_tuner_attach()
3084 nim7090_dib0090_config.get_adc_power = st->dib7000p_ops.get_adc_power; in nim7090_tuner_attach()
3086 if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &nim7090_dib0090_config) == NULL) in nim7090_tuner_attach()
3087 return -ENODEV; in nim7090_tuner_attach()
3089 st->dib7000p_ops.set_gpio(adap->fe_adap[0].fe, 8, 0, 1); in nim7090_tuner_attach()
3091 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; in nim7090_tuner_attach()
3092 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib7090_agc_startup; in nim7090_tuner_attach()
3098 struct dib0700_state *st = adap->dev->priv; in tfe7090pvr_frontend0_attach()
3099 struct dib0700_adapter_state *state = adap->priv; in tfe7090pvr_frontend0_attach()
3101 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in tfe7090pvr_frontend0_attach()
3102 return -ENODEV; in tfe7090pvr_frontend0_attach()
3105 st->disable_streaming_master_mode = 1; in tfe7090pvr_frontend0_attach()
3107 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in tfe7090pvr_frontend0_attach()
3109 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in tfe7090pvr_frontend0_attach()
3110 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in tfe7090pvr_frontend0_attach()
3111 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in tfe7090pvr_frontend0_attach()
3112 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in tfe7090pvr_frontend0_attach()
3115 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in tfe7090pvr_frontend0_attach()
3117 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in tfe7090pvr_frontend0_attach()
3120 …if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x20, &tfe7090pvr_dib7000p_config… in tfe7090pvr_frontend0_attach()
3121 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); in tfe7090pvr_frontend0_attach()
3122 dvb_detach(state->dib7000p_ops.set_wbd_ref); in tfe7090pvr_frontend0_attach()
3123 return -ENODEV; in tfe7090pvr_frontend0_attach()
3126 dib0700_set_i2c_speed(adap->dev, 340); in tfe7090pvr_frontend0_attach()
3127 …adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x90, &tfe7090pvr_dib7000p_co… in tfe7090pvr_frontend0_attach()
3128 if (adap->fe_adap[0].fe == NULL) in tfe7090pvr_frontend0_attach()
3129 return -ENODEV; in tfe7090pvr_frontend0_attach()
3131 state->dib7000p_ops.slave_reset(adap->fe_adap[0].fe); in tfe7090pvr_frontend0_attach()
3139 struct dib0700_adapter_state *state = adap->priv; in tfe7090pvr_frontend1_attach()
3141 if (adap->dev->adapter[0].fe_adap[0].fe == NULL) { in tfe7090pvr_frontend1_attach()
3143 return -ENODEV; /* the master device has not been initialized */ in tfe7090pvr_frontend1_attach()
3146 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in tfe7090pvr_frontend1_attach()
3147 return -ENODEV; in tfe7090pvr_frontend1_attach()
3149 …i2c = state->dib7000p_ops.get_i2c_master(adap->dev->adapter[0].fe_adap[0].fe, DIBX000_I2C_INTERFAC… in tfe7090pvr_frontend1_attach()
3150 if (state->dib7000p_ops.i2c_enumeration(i2c, 1, 0x10, &tfe7090pvr_dib7000p_config[1]) != 0) { in tfe7090pvr_frontend1_attach()
3151 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); in tfe7090pvr_frontend1_attach()
3152 dvb_detach(state->dib7000p_ops.set_wbd_ref); in tfe7090pvr_frontend1_attach()
3153 return -ENODEV; in tfe7090pvr_frontend1_attach()
3156 adap->fe_adap[0].fe = state->dib7000p_ops.init(i2c, 0x92, &tfe7090pvr_dib7000p_config[1]); in tfe7090pvr_frontend1_attach()
3157 dib0700_set_i2c_speed(adap->dev, 200); in tfe7090pvr_frontend1_attach()
3159 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in tfe7090pvr_frontend1_attach()
3164 struct dib0700_adapter_state *st = adap->priv; in tfe7090pvr_tuner0_attach()
3165 struct i2c_adapter *tun_i2c = st->dib7000p_ops.get_i2c_tuner(adap->fe_adap[0].fe); in tfe7090pvr_tuner0_attach()
3167 tfe7090pvr_dib0090_config[0].reset = st->dib7000p_ops.tuner_sleep; in tfe7090pvr_tuner0_attach()
3168 tfe7090pvr_dib0090_config[0].sleep = st->dib7000p_ops.tuner_sleep; in tfe7090pvr_tuner0_attach()
3169 tfe7090pvr_dib0090_config[0].get_adc_power = st->dib7000p_ops.get_adc_power; in tfe7090pvr_tuner0_attach()
3171 …if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &tfe7090pvr_dib0090_config[0]) == N… in tfe7090pvr_tuner0_attach()
3172 return -ENODEV; in tfe7090pvr_tuner0_attach()
3174 st->dib7000p_ops.set_gpio(adap->fe_adap[0].fe, 8, 0, 1); in tfe7090pvr_tuner0_attach()
3176 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; in tfe7090pvr_tuner0_attach()
3177 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib7090_agc_startup; in tfe7090pvr_tuner0_attach()
3183 struct dib0700_adapter_state *st = adap->priv; in tfe7090pvr_tuner1_attach()
3184 struct i2c_adapter *tun_i2c = st->dib7000p_ops.get_i2c_tuner(adap->fe_adap[0].fe); in tfe7090pvr_tuner1_attach()
3186 tfe7090pvr_dib0090_config[1].reset = st->dib7000p_ops.tuner_sleep; in tfe7090pvr_tuner1_attach()
3187 tfe7090pvr_dib0090_config[1].sleep = st->dib7000p_ops.tuner_sleep; in tfe7090pvr_tuner1_attach()
3188 tfe7090pvr_dib0090_config[1].get_adc_power = st->dib7000p_ops.get_adc_power; in tfe7090pvr_tuner1_attach()
3190 …if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &tfe7090pvr_dib0090_config[1]) == N… in tfe7090pvr_tuner1_attach()
3191 return -ENODEV; in tfe7090pvr_tuner1_attach()
3193 st->dib7000p_ops.set_gpio(adap->fe_adap[0].fe, 8, 0, 1); in tfe7090pvr_tuner1_attach()
3195 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; in tfe7090pvr_tuner1_attach()
3196 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib7090_agc_startup; in tfe7090pvr_tuner1_attach()
3202 struct dib0700_state *st = adap->dev->priv; in tfe7790p_frontend_attach()
3203 struct dib0700_adapter_state *state = adap->priv; in tfe7790p_frontend_attach()
3205 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in tfe7790p_frontend_attach()
3206 return -ENODEV; in tfe7790p_frontend_attach()
3209 st->disable_streaming_master_mode = 1; in tfe7790p_frontend_attach()
3211 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in tfe7790p_frontend_attach()
3213 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in tfe7790p_frontend_attach()
3214 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in tfe7790p_frontend_attach()
3215 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in tfe7790p_frontend_attach()
3216 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in tfe7790p_frontend_attach()
3218 dib0700_ctrl_clock(adap->dev, 72, 1); in tfe7790p_frontend_attach()
3219 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in tfe7790p_frontend_attach()
3221 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in tfe7790p_frontend_attach()
3223 if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, in tfe7790p_frontend_attach()
3225 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", in tfe7790p_frontend_attach()
3227 dvb_detach(state->dib7000p_ops.set_wbd_ref); in tfe7790p_frontend_attach()
3228 return -ENODEV; in tfe7790p_frontend_attach()
3230 adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, in tfe7790p_frontend_attach()
3233 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in tfe7790p_frontend_attach()
3238 struct dib0700_adapter_state *st = adap->priv; in tfe7790p_tuner_attach()
3240 st->dib7000p_ops.get_i2c_tuner(adap->fe_adap[0].fe); in tfe7790p_tuner_attach()
3243 tfe7790p_dib0090_config.reset = st->dib7000p_ops.tuner_sleep; in tfe7790p_tuner_attach()
3244 tfe7790p_dib0090_config.sleep = st->dib7000p_ops.tuner_sleep; in tfe7790p_tuner_attach()
3245 tfe7790p_dib0090_config.get_adc_power = st->dib7000p_ops.get_adc_power; in tfe7790p_tuner_attach()
3247 if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, in tfe7790p_tuner_attach()
3249 return -ENODEV; in tfe7790p_tuner_attach()
3251 st->dib7000p_ops.set_gpio(adap->fe_adap[0].fe, 8, 0, 1); in tfe7790p_tuner_attach()
3253 st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; in tfe7790p_tuner_attach()
3254 adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib7090_agc_startup; in tfe7790p_tuner_attach()
3308 struct dib0700_adapter_state *state = adap->priv; in stk7070pd_frontend_attach0()
3310 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in stk7070pd_frontend_attach0()
3311 return -ENODEV; in stk7070pd_frontend_attach0()
3313 stk7070pd_init(adap->dev); in stk7070pd_frontend_attach0()
3316 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in stk7070pd_frontend_attach0()
3318 if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 2, 18, in stk7070pd_frontend_attach0()
3320 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", in stk7070pd_frontend_attach0()
3322 dvb_detach(state->dib7000p_ops.set_wbd_ref); in stk7070pd_frontend_attach0()
3323 return -ENODEV; in stk7070pd_frontend_attach0()
3326 …adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x80, &stk7070pd_dib7000p_con… in stk7070pd_frontend_attach0()
3327 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk7070pd_frontend_attach0()
3332 struct dib0700_adapter_state *state = adap->priv; in stk7070pd_frontend_attach1()
3334 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in stk7070pd_frontend_attach1()
3335 return -ENODEV; in stk7070pd_frontend_attach1()
3337 …adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x82, &stk7070pd_dib7000p_con… in stk7070pd_frontend_attach1()
3338 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in stk7070pd_frontend_attach1()
3344 struct dvb_usb_adapter *adap = fe->dvb->priv; in novatd_read_status_override()
3345 struct dvb_usb_device *dev = adap->dev; in novatd_read_status_override()
3346 struct dib0700_state *state = dev->priv; in novatd_read_status_override()
3349 ret = state->read_status(fe, stat); in novatd_read_status_override()
3352 dib0700_set_gpio(dev, adap->id == 0 ? GPIO1 : GPIO0, GPIO_OUT, in novatd_read_status_override()
3360 struct dvb_usb_adapter *adap = fe->dvb->priv; in novatd_sleep_override()
3361 struct dvb_usb_device *dev = adap->dev; in novatd_sleep_override()
3362 struct dib0700_state *state = dev->priv; in novatd_sleep_override()
3365 dib0700_set_gpio(dev, adap->id == 0 ? GPIO1 : GPIO0, GPIO_OUT, 0); in novatd_sleep_override()
3367 return state->sleep(fe); in novatd_sleep_override()
3371 * novatd_frontend_attach - Nova-TD specific attach
3373 * Nova-TD has GPIO0, 1 and 2 for LEDs. So do not fiddle with them except for
3378 struct dvb_usb_device *dev = adap->dev; in novatd_frontend_attach()
3379 struct dib0700_state *st = dev->priv; in novatd_frontend_attach()
3380 struct dib0700_adapter_state *state = adap->priv; in novatd_frontend_attach()
3382 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in novatd_frontend_attach()
3383 return -ENODEV; in novatd_frontend_attach()
3385 if (adap->id == 0) { in novatd_frontend_attach()
3393 if (state->dib7000p_ops.i2c_enumeration(&dev->i2c_adap, 2, 18, in novatd_frontend_attach()
3395 err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", in novatd_frontend_attach()
3397 dvb_detach(state->dib7000p_ops.set_wbd_ref); in novatd_frontend_attach()
3398 return -ENODEV; in novatd_frontend_attach()
3402 adap->fe_adap[0].fe = state->dib7000p_ops.init(&dev->i2c_adap, in novatd_frontend_attach()
3403 adap->id == 0 ? 0x80 : 0x82, in novatd_frontend_attach()
3404 &stk7070pd_dib7000p_config[adap->id]); in novatd_frontend_attach()
3406 if (adap->fe_adap[0].fe == NULL) in novatd_frontend_attach()
3407 return -ENODEV; in novatd_frontend_attach()
3409 st->read_status = adap->fe_adap[0].fe->ops.read_status; in novatd_frontend_attach()
3410 adap->fe_adap[0].fe->ops.read_status = novatd_read_status_override; in novatd_frontend_attach()
3411 st->sleep = adap->fe_adap[0].fe->ops.sleep; in novatd_frontend_attach()
3412 adap->fe_adap[0].fe->ops.sleep = novatd_sleep_override; in novatd_frontend_attach()
3429 GPIO0 - currently unknown
3430 GPIO1 - xc5000 tuner reset
3431 GPIO2 - CX25843 sleep
3432 GPIO3 - currently unknown
3433 GPIO4 - currently unknown
3434 GPIO6 - currently unknown
3435 GPIO7 - currently unknown
3436 GPIO9 - currently unknown
3437 GPIO10 - CX25843 reset
3441 struct dib0700_state *st = adap->dev->priv; in s5h1411_frontend_attach()
3444 st->fw_use_new_i2c_api = 1; in s5h1411_frontend_attach()
3447 st->disable_streaming_master_mode = 1; in s5h1411_frontend_attach()
3450 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 0); in s5h1411_frontend_attach()
3451 dib0700_set_gpio(adap->dev, GPIO3, GPIO_OUT, 0); in s5h1411_frontend_attach()
3452 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in s5h1411_frontend_attach()
3454 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in s5h1411_frontend_attach()
3456 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in s5h1411_frontend_attach()
3458 dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); in s5h1411_frontend_attach()
3459 dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); in s5h1411_frontend_attach()
3460 dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); in s5h1411_frontend_attach()
3461 dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); in s5h1411_frontend_attach()
3462 dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 0); in s5h1411_frontend_attach()
3466 dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 1); in s5h1411_frontend_attach()
3469 adap->fe_adap[0].fe = dvb_attach(s5h1411_attach, &pinnacle_801e_config, in s5h1411_frontend_attach()
3470 &adap->dev->i2c_adap); in s5h1411_frontend_attach()
3471 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in s5h1411_frontend_attach()
3481 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 0); in dib0700_xc5000_tuner_callback()
3483 dib0700_set_gpio(adap->dev, GPIO1, GPIO_OUT, 1); in dib0700_xc5000_tuner_callback()
3487 return -EINVAL; in dib0700_xc5000_tuner_callback()
3501 adap->fe_adap[0].fe->callback = dib0700_xc5000_tuner_callback; in xc5000_tuner_attach()
3503 return dvb_attach(xc5000_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, in xc5000_tuner_attach()
3505 == NULL ? -ENODEV : 0; in xc5000_tuner_attach()
3512 struct dib0700_adapter_state *state = adap->priv; in dib0700_xc4000_tuner_callback()
3516 state->dib7000p_ops.set_gpio(adap->fe_adap[0].fe, 8, 0, 0); in dib0700_xc4000_tuner_callback()
3518 state->dib7000p_ops.set_gpio(adap->fe_adap[0].fe, 8, 0, 1); in dib0700_xc4000_tuner_callback()
3521 return -EINVAL; in dib0700_xc4000_tuner_callback()
3592 GPIO2 - CX25843 sleep
3593 GPIO3 - CS5340 reset
3594 GPIO5 - IRD
3595 GPIO6 - Power Supply
3596 GPIO8 - LNA (1=off 0=on)
3597 GPIO10 - CX25843 reset
3599 GPIO8 - xc4000 reset
3603 struct dib0700_state *st = adap->dev->priv; in pctv340e_frontend_attach()
3604 struct dib0700_adapter_state *state = adap->priv; in pctv340e_frontend_attach()
3606 if (!dvb_attach(dib7000p_attach, &state->dib7000p_ops)) in pctv340e_frontend_attach()
3607 return -ENODEV; in pctv340e_frontend_attach()
3609 /* Power Supply on */ in pctv340e_frontend_attach()
3610 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); in pctv340e_frontend_attach()
3612 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in pctv340e_frontend_attach()
3613 msleep(100); /* Allow power supply to settle before probing */ in pctv340e_frontend_attach()
3616 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in pctv340e_frontend_attach()
3618 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in pctv340e_frontend_attach()
3620 /* LNA off for now */ in pctv340e_frontend_attach()
3621 dib0700_set_gpio(adap->dev, GPIO8, GPIO_OUT, 1); in pctv340e_frontend_attach()
3624 dib0700_set_gpio(adap->dev, GPIO2, GPIO_OUT, 1); in pctv340e_frontend_attach()
3627 dib0700_ctrl_clock(adap->dev, 72, 1); in pctv340e_frontend_attach()
3631 if (state->dib7000p_ops.dib7000pc_detection(&adap->dev->i2c_adap) == 0) { in pctv340e_frontend_attach()
3633 dvb_detach(state->dib7000p_ops.set_wbd_ref); in pctv340e_frontend_attach()
3634 return -ENODEV; in pctv340e_frontend_attach()
3637 adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x12, in pctv340e_frontend_attach()
3639 st->is_dib7000pc = 1; in pctv340e_frontend_attach()
3641 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in pctv340e_frontend_attach()
3655 struct dib0700_adapter_state *state = adap->priv; in xc4000_tuner_attach()
3658 tun_i2c = state->dib7000p_ops.get_i2c_master(adap->fe_adap[0].fe, in xc4000_tuner_attach()
3666 adap->fe_adap[0].fe->callback = dib0700_xc4000_tuner_callback; in xc4000_tuner_attach()
3668 return dvb_attach(xc4000_attach, adap->fe_adap[0].fe, tun_i2c, in xc4000_tuner_attach()
3670 == NULL ? -ENODEV : 0; in xc4000_tuner_attach()
3691 /* TIGER-ATSC map:
3692 GPIO0 - LNA_CTR (H: LNA power enabled, L: LNA power disabled)
3693 GPIO1 - ANT_SEL (H: VPA, L: MCX)
3694 GPIO4 - SCL2
3695 GPIO6 - EN_TUNER
3696 GPIO7 - SDA2
3697 GPIO10 - DEM_RST
3703 struct dib0700_state *st = adap->dev->priv; in lgdt3305_frontend_attach()
3706 st->fw_use_new_i2c_api = 1; in lgdt3305_frontend_attach()
3708 st->disable_streaming_master_mode = 1; in lgdt3305_frontend_attach()
3711 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); in lgdt3305_frontend_attach()
3713 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in lgdt3305_frontend_attach()
3717 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in lgdt3305_frontend_attach()
3719 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in lgdt3305_frontend_attach()
3721 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in lgdt3305_frontend_attach()
3724 adap->fe_adap[0].fe = dvb_attach(lgdt3305_attach, in lgdt3305_frontend_attach()
3726 &adap->dev->i2c_adap); in lgdt3305_frontend_attach()
3728 return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; in lgdt3305_frontend_attach()
3733 return dvb_attach(mxl5007t_attach, adap->fe_adap[0].fe, in mxl5007t_tuner_attach()
3734 &adap->dev->i2c_adap, 0x60, in mxl5007t_tuner_attach()
3735 &hcw_mxl5007t_config) == NULL ? -ENODEV : 0; in mxl5007t_tuner_attach()
3740 struct dib0700_state *st = adap->dev->priv; in xbox_one_attach()
3742 struct dvb_usb_device *d = adap->dev; in xbox_one_attach()
3747 st->fw_use_new_i2c_api = 1; in xbox_one_attach()
3748 st->disable_streaming_master_mode = 1; in xbox_one_attach()
3751 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 0); in xbox_one_attach()
3753 dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); in xbox_one_attach()
3757 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in xbox_one_attach()
3759 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); in xbox_one_attach()
3761 dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); in xbox_one_attach()
3765 mn88472_config.fe = &adap->fe_adap[0].fe; in xbox_one_attach()
3775 client_demod = i2c_new_client_device(&d->i2c_adap, &info); in xbox_one_attach()
3778 if (!try_module_get(client_demod->dev.driver->owner)) in xbox_one_attach()
3781 st->i2c_client_demod = client_demod; in xbox_one_attach()
3783 adap->fe_adap[0].fe = mn88472_config.get_dvb_frontend(client_demod); in xbox_one_attach()
3795 tda18250_config.fe = adap->fe_adap[0].fe; in xbox_one_attach()
3803 client_tuner = i2c_new_client_device(&adap->dev->i2c_adap, &info); in xbox_one_attach()
3806 if (!try_module_get(client_tuner->dev.driver->owner)) in xbox_one_attach()
3809 st->i2c_client_tuner = client_tuner; in xbox_one_attach()
3815 module_put(client_demod->dev.driver->owner); in xbox_one_attach()
3819 return -ENODEV; in xbox_one_attach()
3823 /* DVB-USB and USB stuff follows */
4010 .firmware = "dvb-usb-dib0700-1.20.fw", \
4061 { "Hauppauge Nova-T Stick",
4065 { "AVerMedia AVerTV DVB-T Volar",
4081 { "AVerMedia AVerTV DVB-T Express",
4125 { "Hauppauge Nova-T 500 Dual DVB-T",
4181 { "Hauppauge Nova-TD Stick/Elgato Eye-TV Diversity",
4189 { "YUAN High-Tech DiBcom STK7700D",
4275 { "Pinnacle PCTV DVB-T Flash Stick",
4279 { "Artec T14BR DVB-T",
4287 { "Hauppauge Nova-T Stick",
4291 { "Hauppauge Nova-T MyTV.t",
4409 { "Hauppauge Nova-TD Stick (52009)",
4470 { "Pinnacle PCTV Dual DVB-T Diversity Stick",
4474 { "Hauppauge Nova-TD-500 (84xxx)",
4581 { "Gigabyte U8000-RH",
4585 { "YUAN High-Tech STK7700PH",
4589 { "Asus My Cinema-U3000Hybrid",
4593 { "YUAN High-Tech MC770",
4601 { "YUAN High-Tech STK7700D",
4717 { "Medion CTX1921 DVB-T USB",
5209 { "DiBcom STK8096-PVR reference design",