Lines Matching +full:vsel +full:- +full:state +full:- +full:high

1 // SPDX-License-Identifier: GPL-2.0-or-later
10 * Copyright (C) 1999-2002 Ralph Metzler
46 static void Set22K(struct budget *budget, int state) in Set22K() argument
48 struct saa7146_dev *dev = budget->dev; in Set22K()
51 saa7146_setgpio(dev, 3, (state ? SAA7146_GPIO_OUTHI : SAA7146_GPIO_OUTLO)); in Set22K()
62 struct saa7146_dev *dev = budget->dev; in DiseqcSendBit()
78 for (i = 7; i >= 0; i--) { in DiseqcSendByte()
89 struct saa7146_dev *dev = budget->dev; in SendDiSEqCMsg()
102 if (burst != -1) { in SendDiSEqCMsg()
121 * GPIO 1: LNBP EN, GPIO 2: LNBP VSEL
126 struct saa7146_dev *dev = budget->dev; in SetVoltage_Activy()
143 return -EINVAL; in SetVoltage_Activy()
152 struct budget *budget = fe->dvb->priv; in siemens_budget_set_voltage()
160 struct budget *budget = fe->dvb->priv; in budget_set_tone()
172 return -EINVAL; in budget_set_tone()
180 struct budget *budget = fe->dvb->priv; in budget_diseqc_send_master_cmd()
182 SendDiSEqCMsg(budget, cmd->msg_len, cmd->msg, 0); in budget_diseqc_send_master_cmd()
190 struct budget *budget = fe->dvb->priv; in budget_diseqc_send_burst()
199 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in alps_bsrv2_tuner_set_params()
200 struct budget *budget = fe->dvb->priv; in alps_bsrv2_tuner_set_params()
204 u32 div = (c->frequency + 479500) / 125; in alps_bsrv2_tuner_set_params()
206 if (c->frequency > 2000000) in alps_bsrv2_tuner_set_params()
208 else if (c->frequency > 1800000) in alps_bsrv2_tuner_set_params()
210 else if (c->frequency > 1600000) in alps_bsrv2_tuner_set_params()
212 else if (c->frequency > 1200000) in alps_bsrv2_tuner_set_params()
214 else if (c->frequency >= 1100000) in alps_bsrv2_tuner_set_params()
227 if (fe->ops.i2c_gate_ctrl) in alps_bsrv2_tuner_set_params()
228 fe->ops.i2c_gate_ctrl(fe, 1); in alps_bsrv2_tuner_set_params()
229 if (i2c_transfer(&budget->i2c_adap, &msg, 1) != 1) in alps_bsrv2_tuner_set_params()
230 return -EIO; in alps_bsrv2_tuner_set_params()
242 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in alps_tdbe2_tuner_set_params()
243 struct budget *budget = fe->dvb->priv; in alps_tdbe2_tuner_set_params()
248 div = (c->frequency + 35937500 + 31250) / 62500; in alps_tdbe2_tuner_set_params()
253 data[3] = (c->frequency < 174000000 ? 0x88 : c->frequency < 470000000 ? 0x84 : 0x81); in alps_tdbe2_tuner_set_params()
255 if (fe->ops.i2c_gate_ctrl) in alps_tdbe2_tuner_set_params()
256 fe->ops.i2c_gate_ctrl(fe, 1); in alps_tdbe2_tuner_set_params()
257 if (i2c_transfer(&budget->i2c_adap, &msg, 1) != 1) in alps_tdbe2_tuner_set_params()
258 return -EIO; in alps_tdbe2_tuner_set_params()
271 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in grundig_29504_401_tuner_set_params()
272 struct budget *budget = fe->dvb->priv; in grundig_29504_401_tuner_set_params()
273 u8 *tuner_addr = fe->tuner_priv; in grundig_29504_401_tuner_set_params()
284 div = (36125000 + c->frequency) / 166666; in grundig_29504_401_tuner_set_params()
288 if (c->frequency < 175000000) in grundig_29504_401_tuner_set_params()
290 else if (c->frequency < 390000000) in grundig_29504_401_tuner_set_params()
292 else if (c->frequency < 470000000) in grundig_29504_401_tuner_set_params()
294 else if (c->frequency < 750000000) in grundig_29504_401_tuner_set_params()
299 if (c->frequency < 175000000) in grundig_29504_401_tuner_set_params()
301 else if (c->frequency < 470000000) in grundig_29504_401_tuner_set_params()
311 if (fe->ops.i2c_gate_ctrl) in grundig_29504_401_tuner_set_params()
312 fe->ops.i2c_gate_ctrl(fe, 1); in grundig_29504_401_tuner_set_params()
313 if (i2c_transfer(&budget->i2c_adap, &msg, 1) != 1) in grundig_29504_401_tuner_set_params()
314 return -EIO; in grundig_29504_401_tuner_set_params()
330 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in grundig_29504_451_tuner_set_params()
331 struct budget *budget = fe->dvb->priv; in grundig_29504_451_tuner_set_params()
336 div = c->frequency / 125; in grundig_29504_451_tuner_set_params()
342 if (fe->ops.i2c_gate_ctrl) in grundig_29504_451_tuner_set_params()
343 fe->ops.i2c_gate_ctrl(fe, 1); in grundig_29504_451_tuner_set_params()
344 if (i2c_transfer(&budget->i2c_adap, &msg, 1) != 1) in grundig_29504_451_tuner_set_params()
345 return -EIO; in grundig_29504_451_tuner_set_params()
355 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in s5h1420_tuner_set_params()
356 struct budget *budget = fe->dvb->priv; in s5h1420_tuner_set_params()
361 div = c->frequency / 1000; in s5h1420_tuner_set_params()
375 if (fe->ops.i2c_gate_ctrl) in s5h1420_tuner_set_params()
376 fe->ops.i2c_gate_ctrl(fe, 1); in s5h1420_tuner_set_params()
377 if (i2c_transfer(&budget->i2c_adap, &msg, 1) != 1) in s5h1420_tuner_set_params()
378 return -EIO; in s5h1420_tuner_set_params()
418 struct budget *budget = fe->dvb->priv; in alps_tdhd1_204_request_firmware()
420 return request_firmware(fw, name, &budget->dev->pci->dev); in alps_tdhd1_204_request_firmware()
432 return (i2c_transfer(i2c, msg, 2) != 2) ? -EIO : val; in i2c_readreg()
442 if ((i2c_transfer(&budget->i2c_adap, msg, 2) != 2) || (pwm == 0xff)) in read_pwm()
491 switch (budget->dev->pci->subsystem_device) { in frontend_init()
495 budget->dvb_frontend = dvb_attach(ves1x93_attach, &alps_bsrv2_config, &budget->i2c_adap); in frontend_init()
496 if (budget->dvb_frontend) { in frontend_init()
497 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; in frontend_init()
498 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; in frontend_init()
499 budget->dvb_frontend->ops.diseqc_send_burst = budget_diseqc_send_burst; in frontend_init()
500 budget->dvb_frontend->ops.set_tone = budget_set_tone; in frontend_init()
505 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap); in frontend_init()
506 if (budget->dvb_frontend) { in frontend_init()
507 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; in frontend_init()
508 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; in frontend_init()
509 if (budget->dev->pci->subsystem_device == 0x1003 && diseqc_method == 0) { in frontend_init()
510 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; in frontend_init()
511 budget->dvb_frontend->ops.diseqc_send_burst = budget_diseqc_send_burst; in frontend_init()
512 budget->dvb_frontend->ops.set_tone = budget_set_tone; in frontend_init()
518 case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) in frontend_init()
520 …budget->dvb_frontend = dvb_attach(ves1820_attach, &alps_tdbe2_config, &budget->i2c_adap, read_pwm(… in frontend_init()
521 if (budget->dvb_frontend) { in frontend_init()
522 budget->dvb_frontend->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; in frontend_init()
527 case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060)) in frontend_init()
529 budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config, &budget->i2c_adap); in frontend_init()
530 if (budget->dvb_frontend) { in frontend_init()
531 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params; in frontend_init()
532 budget->dvb_frontend->tuner_priv = NULL; in frontend_init()
538 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap); in frontend_init()
539 if (budget->dvb_frontend) { in frontend_init()
541 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; in frontend_init()
542 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; in frontend_init()
547 case 0x4f60: /* Fujitsu Siemens Activy Budget-S PCI rev AL (stv0299/tsa5059) */ in frontend_init()
549 int subtype = i2c_readreg(&budget->i2c_adap, 0x50, 0x67); in frontend_init()
556 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config_activy, &budget->i2c_adap); in frontend_init()
557 if (budget->dvb_frontend) { in frontend_init()
559 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; in frontend_init()
560 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; in frontend_init()
561 budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage; in frontend_init()
562 budget->dvb_frontend->ops.dishnetwork_send_legacy_command = NULL; in frontend_init()
568 saa7146_setgpio(budget->dev, 3, SAA7146_GPIO_OUTLO); in frontend_init()
570 saa7146_setgpio(budget->dev, 3, SAA7146_GPIO_OUTHI); in frontend_init()
572 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsbe1_config_activy, &budget->i2c_adap); in frontend_init()
573 if (budget->dvb_frontend) { in frontend_init()
575 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params; in frontend_init()
576 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; in frontend_init()
577 budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage; in frontend_init()
578 budget->dvb_frontend->ops.dishnetwork_send_legacy_command = NULL; in frontend_init()
585 case 0x4f61: // Fujitsu Siemens Activy Budget-S PCI rev GR (tda8083/Grundig 29504-451(tsa5522)) in frontend_init()
586 budget->dvb_frontend = dvb_attach(tda8083_attach, &grundig_29504_451_config, &budget->i2c_adap); in frontend_init()
587 if (budget->dvb_frontend) { in frontend_init()
588 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; in frontend_init()
589 budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage; in frontend_init()
590 budget->dvb_frontend->ops.dishnetwork_send_legacy_command = NULL; in frontend_init()
594 case 0x5f60: /* Fujitsu Siemens Activy Budget-T PCI rev AL (tda10046/ALPS TDHD1-204A) */ in frontend_init()
595 budget->dvb_frontend = dvb_attach(tda10046_attach, &alps_tdhd1_204a_config, &budget->i2c_adap); in frontend_init()
596 if (budget->dvb_frontend) { in frontend_init()
597 budget->dvb_frontend->ops.tuner_ops.set_params = alps_tdhd1_204a_tuner_set_params; in frontend_init()
598 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; in frontend_init()
602 case 0x5f61: /* Fujitsu Siemens Activy Budget-T PCI rev GR (L64781/Grundig 29504-401(tsa5060)) */ in frontend_init()
603 …budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config_activy, &budget->i2c_ad… in frontend_init()
604 if (budget->dvb_frontend) { in frontend_init()
605 budget->dvb_frontend->tuner_priv = &tuner_address_grundig_29504_401_activy; in frontend_init()
606 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params; in frontend_init()
610 case 0x1016: // Hauppauge/TT Nova-S SE (samsung s5h1420/????(tda8260)) in frontend_init()
614 fe = dvb_attach(s5h1420_attach, &s5h1420_config, &budget->i2c_adap); in frontend_init()
616 fe->ops.tuner_ops.set_params = s5h1420_tuner_set_params; in frontend_init()
617 budget->dvb_frontend = fe; in frontend_init()
618 if (dvb_attach(lnbp21_attach, fe, &budget->i2c_adap, in frontend_init()
627 case 0x1018: // TT Budget-S-1401 (philips tda10086/philips tda8262) in frontend_init()
631 // gpio2 is connected to CLB - reset it + leave it high in frontend_init()
632 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTLO); in frontend_init()
634 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTHI); in frontend_init()
637 fe = dvb_attach(tda10086_attach, &tda10086_config, &budget->i2c_adap); in frontend_init()
639 budget->dvb_frontend = fe; in frontend_init()
641 &budget->i2c_adap, 0) == NULL) in frontend_init()
644 &budget->i2c_adap, 0, 0) == NULL) { in frontend_init()
653 case 0x101c: { /* TT S2-1600 */ in frontend_init()
656 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTLO); in frontend_init()
658 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTHI); in frontend_init()
661 budget->dvb_frontend = dvb_attach(stv090x_attach, in frontend_init()
663 &budget->i2c_adap, in frontend_init()
666 if (budget->dvb_frontend) { in frontend_init()
669 budget->dvb_frontend, in frontend_init()
671 &budget->i2c_adap); in frontend_init()
674 tt1600_stv090x_config.tuner_init = ctl->tuner_init; in frontend_init()
675 tt1600_stv090x_config.tuner_sleep = ctl->tuner_sleep; in frontend_init()
676 tt1600_stv090x_config.tuner_set_mode = ctl->tuner_set_mode; in frontend_init()
677 tt1600_stv090x_config.tuner_set_frequency = ctl->tuner_set_frequency; in frontend_init()
678 tt1600_stv090x_config.tuner_get_frequency = ctl->tuner_get_frequency; in frontend_init()
679 tt1600_stv090x_config.tuner_set_bandwidth = ctl->tuner_set_bandwidth; in frontend_init()
680 tt1600_stv090x_config.tuner_get_bandwidth = ctl->tuner_get_bandwidth; in frontend_init()
681 tt1600_stv090x_config.tuner_set_bbgain = ctl->tuner_set_bbgain; in frontend_init()
682 tt1600_stv090x_config.tuner_get_bbgain = ctl->tuner_get_bbgain; in frontend_init()
683 tt1600_stv090x_config.tuner_set_refclk = ctl->tuner_set_refclk; in frontend_init()
684 tt1600_stv090x_config.tuner_get_status = ctl->tuner_get_status; in frontend_init()
691 if (budget->dvb_frontend->ops.init) in frontend_init()
692 budget->dvb_frontend->ops.init(budget->dvb_frontend); in frontend_init()
695 budget->dvb_frontend, in frontend_init()
696 &budget->i2c_adap, in frontend_init()
712 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTLO); in frontend_init()
714 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTHI); in frontend_init()
717 budget->dvb_frontend = dvb_attach(stv090x_attach, in frontend_init()
719 &budget->i2c_adap, in frontend_init()
722 if (budget->dvb_frontend) { in frontend_init()
726 budget->dvb_frontend, in frontend_init()
728 &budget->i2c_adap); in frontend_init()
731 tt1600_stv090x_config.tuner_init = ctl->tuner_init; in frontend_init()
732 tt1600_stv090x_config.tuner_sleep = ctl->tuner_sleep; in frontend_init()
733 tt1600_stv090x_config.tuner_set_mode = ctl->tuner_set_mode; in frontend_init()
734 tt1600_stv090x_config.tuner_set_frequency = ctl->tuner_set_frequency; in frontend_init()
735 tt1600_stv090x_config.tuner_get_frequency = ctl->tuner_get_frequency; in frontend_init()
736 tt1600_stv090x_config.tuner_set_bandwidth = ctl->tuner_set_bandwidth; in frontend_init()
737 tt1600_stv090x_config.tuner_get_bandwidth = ctl->tuner_get_bandwidth; in frontend_init()
738 tt1600_stv090x_config.tuner_set_bbgain = ctl->tuner_set_bbgain; in frontend_init()
739 tt1600_stv090x_config.tuner_get_bbgain = ctl->tuner_get_bbgain; in frontend_init()
740 tt1600_stv090x_config.tuner_set_refclk = ctl->tuner_set_refclk; in frontend_init()
741 tt1600_stv090x_config.tuner_get_status = ctl->tuner_get_status; in frontend_init()
748 if (budget->dvb_frontend->ops.init) in frontend_init()
749 budget->dvb_frontend->ops.init(budget->dvb_frontend); in frontend_init()
752 budget->dvb_frontend, in frontend_init()
753 &budget->i2c_adap, in frontend_init()
768 if (budget->dvb_frontend == NULL) { in frontend_init()
770 budget->dev->pci->vendor, in frontend_init()
771 budget->dev->pci->device, in frontend_init()
772 budget->dev->pci->subsystem_vendor, in frontend_init()
773 budget->dev->pci->subsystem_device); in frontend_init()
775 if (dvb_register_frontend(&budget->dvb_adapter, budget->dvb_frontend)) in frontend_init()
782 dvb_frontend_detach(budget->dvb_frontend); in frontend_init()
783 budget->dvb_frontend = NULL; in frontend_init()
793 return -ENOMEM; in budget_attach()
797 dev->ext_priv = budget; in budget_attach()
806 budget->dvb_adapter.priv = budget; in budget_attach()
816 struct budget *budget = dev->ext_priv; in budget_detach()
819 if (budget->dvb_frontend) { in budget_detach()
820 dvb_unregister_frontend(budget->dvb_frontend); in budget_detach()
821 dvb_frontend_detach(budget->dvb_frontend); in budget_detach()
827 dev->ext_priv = NULL; in budget_detach()
834 MAKE_BUDGET_INFO(ttbs, "TT-Budget/WinTV-NOVA-S PCI", BUDGET_TT);
835 MAKE_BUDGET_INFO(ttbc, "TT-Budget/WinTV-NOVA-C PCI", BUDGET_TT);
836 MAKE_BUDGET_INFO(ttbt, "TT-Budget/WinTV-NOVA-T PCI", BUDGET_TT);
838 MAKE_BUDGET_INFO(ttbs1401, "TT-Budget-S-1401 PCI", BUDGET_TT);
839 MAKE_BUDGET_INFO(tt1600, "TT-Budget S2-1600 PCI", BUDGET_TT);
840 MAKE_BUDGET_INFO(fsacs0, "Fujitsu Siemens Activy Budget-S PCI (rev GR/grundig frontend)", BUDGET_FS…
841 MAKE_BUDGET_INFO(fsacs1, "Fujitsu Siemens Activy Budget-S PCI (rev AL/alps frontend)", BUDGET_FS_AC…
842 MAKE_BUDGET_INFO(fsact, "Fujitsu Siemens Activy Budget-T PCI (rev GR/Grundig frontend)", BUDGET_FS…
843 MAKE_BUDGET_INFO(fsact1, "Fujitsu Siemens Activy Budget-T PCI (rev AL/ALPS TDHD1-204A)", BUDGET_FS_…
896 MODULE_DESCRIPTION("driver for the SAA7146 based so-called budget PCI DVB cards by Siemens, Technot…