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

1 // SPDX-License-Identifier: GPL-2.0-or-later
9 * Copyright (C) 1999-2002 Ralph Metzler
45 static void Set22K (struct budget *budget, int state) in Set22K() argument
47 struct saa7146_dev *dev=budget->dev; in Set22K()
49 saa7146_setgpio(dev, 3, (state ? SAA7146_GPIO_OUTHI : SAA7146_GPIO_OUTLO)); in Set22K()
58 struct saa7146_dev *dev=budget->dev; in DiseqcSendBit()
73 for (i=7; i>=0; i--) { in DiseqcSendByte()
84 struct saa7146_dev *dev=budget->dev; in SendDiSEqCMsg()
97 if (burst!=-1) { in SendDiSEqCMsg()
116 * GPIO 1: LNBP EN, GPIO 2: LNBP VSEL
121 struct saa7146_dev *dev=budget->dev; in SetVoltage_Activy()
138 return -EINVAL; in SetVoltage_Activy()
147 struct budget *budget = fe->dvb->priv; in siemens_budget_set_voltage()
155 struct budget *budget = fe->dvb->priv; in budget_set_tone()
167 return -EINVAL; in budget_set_tone()
175 struct budget *budget = fe->dvb->priv; in budget_diseqc_send_master_cmd()
177 SendDiSEqCMsg (budget, cmd->msg_len, cmd->msg, 0); in budget_diseqc_send_master_cmd()
185 struct budget *budget = fe->dvb->priv; in budget_diseqc_send_burst()
194 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in alps_bsrv2_tuner_set_params()
195 struct budget *budget = fe->dvb->priv; in alps_bsrv2_tuner_set_params()
199 u32 div = (c->frequency + 479500) / 125; in alps_bsrv2_tuner_set_params()
201 if (c->frequency > 2000000) in alps_bsrv2_tuner_set_params()
203 else if (c->frequency > 1800000) in alps_bsrv2_tuner_set_params()
205 else if (c->frequency > 1600000) in alps_bsrv2_tuner_set_params()
207 else if (c->frequency > 1200000) in alps_bsrv2_tuner_set_params()
209 else if (c->frequency >= 1100000) in alps_bsrv2_tuner_set_params()
221 if (fe->ops.i2c_gate_ctrl) in alps_bsrv2_tuner_set_params()
222 fe->ops.i2c_gate_ctrl(fe, 1); in alps_bsrv2_tuner_set_params()
223 if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; in alps_bsrv2_tuner_set_params()
236 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in alps_tdbe2_tuner_set_params()
237 struct budget *budget = fe->dvb->priv; in alps_tdbe2_tuner_set_params()
242 div = (c->frequency + 35937500 + 31250) / 62500; in alps_tdbe2_tuner_set_params()
247 data[3] = (c->frequency < 174000000 ? 0x88 : c->frequency < 470000000 ? 0x84 : 0x81); in alps_tdbe2_tuner_set_params()
249 if (fe->ops.i2c_gate_ctrl) in alps_tdbe2_tuner_set_params()
250 fe->ops.i2c_gate_ctrl(fe, 1); in alps_tdbe2_tuner_set_params()
251 if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; in alps_tdbe2_tuner_set_params()
264 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in grundig_29504_401_tuner_set_params()
265 struct budget *budget = fe->dvb->priv; in grundig_29504_401_tuner_set_params()
266 u8 *tuner_addr = fe->tuner_priv; in grundig_29504_401_tuner_set_params()
277 div = (36125000 + c->frequency) / 166666; in grundig_29504_401_tuner_set_params()
281 if (c->frequency < 175000000) in grundig_29504_401_tuner_set_params()
283 else if (c->frequency < 390000000) in grundig_29504_401_tuner_set_params()
285 else if (c->frequency < 470000000) in grundig_29504_401_tuner_set_params()
287 else if (c->frequency < 750000000) in grundig_29504_401_tuner_set_params()
292 if (c->frequency < 175000000) in grundig_29504_401_tuner_set_params()
294 else if (c->frequency < 470000000) in grundig_29504_401_tuner_set_params()
304 if (fe->ops.i2c_gate_ctrl) in grundig_29504_401_tuner_set_params()
305 fe->ops.i2c_gate_ctrl(fe, 1); in grundig_29504_401_tuner_set_params()
306 if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; in grundig_29504_401_tuner_set_params()
322 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in grundig_29504_451_tuner_set_params()
323 struct budget *budget = fe->dvb->priv; in grundig_29504_451_tuner_set_params()
328 div = c->frequency / 125; in grundig_29504_451_tuner_set_params()
334 if (fe->ops.i2c_gate_ctrl) in grundig_29504_451_tuner_set_params()
335 fe->ops.i2c_gate_ctrl(fe, 1); in grundig_29504_451_tuner_set_params()
336 if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; in grundig_29504_451_tuner_set_params()
346 struct dtv_frontend_properties *c = &fe->dtv_property_cache; in s5h1420_tuner_set_params()
347 struct budget *budget = fe->dvb->priv; in s5h1420_tuner_set_params()
352 div = c->frequency / 1000; in s5h1420_tuner_set_params()
366 if (fe->ops.i2c_gate_ctrl) in s5h1420_tuner_set_params()
367 fe->ops.i2c_gate_ctrl(fe, 1); in s5h1420_tuner_set_params()
368 if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; in s5h1420_tuner_set_params()
408 struct budget *budget = fe->dvb->priv; in alps_tdhd1_204_request_firmware()
410 return request_firmware(fw, name, &budget->dev->pci->dev); in alps_tdhd1_204_request_firmware()
422 return (i2c_transfer(i2c, msg, 2) != 2) ? -EIO : val; in i2c_readreg()
432 if ((i2c_transfer(&budget->i2c_adap, msg, 2) != 2) || (pwm == 0xff)) in read_pwm()
481 switch(budget->dev->pci->subsystem_device) { in frontend_init()
485 budget->dvb_frontend = dvb_attach(ves1x93_attach, &alps_bsrv2_config, &budget->i2c_adap); in frontend_init()
486 if (budget->dvb_frontend) { in frontend_init()
487 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; in frontend_init()
488 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; in frontend_init()
489 budget->dvb_frontend->ops.diseqc_send_burst = budget_diseqc_send_burst; in frontend_init()
490 budget->dvb_frontend->ops.set_tone = budget_set_tone; in frontend_init()
495 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_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_bsru6_tuner_set_params; in frontend_init()
498 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; in frontend_init()
499 if (budget->dev->pci->subsystem_device == 0x1003 && diseqc_method == 0) { in frontend_init()
500 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; in frontend_init()
501 budget->dvb_frontend->ops.diseqc_send_burst = budget_diseqc_send_burst; in frontend_init()
502 budget->dvb_frontend->ops.set_tone = budget_set_tone; in frontend_init()
508 case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) in frontend_init()
510 …budget->dvb_frontend = dvb_attach(ves1820_attach, &alps_tdbe2_config, &budget->i2c_adap, read_pwm(… in frontend_init()
511 if (budget->dvb_frontend) { in frontend_init()
512 budget->dvb_frontend->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; in frontend_init()
517 case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060)) in frontend_init()
519 budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config, &budget->i2c_adap); in frontend_init()
520 if (budget->dvb_frontend) { in frontend_init()
521 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params; in frontend_init()
522 budget->dvb_frontend->tuner_priv = NULL; in frontend_init()
528 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap); in frontend_init()
529 if (budget->dvb_frontend) { in frontend_init()
531 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; in frontend_init()
532 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; in frontend_init()
537 case 0x4f60: /* Fujitsu Siemens Activy Budget-S PCI rev AL (stv0299/tsa5059) */ in frontend_init()
539 int subtype = i2c_readreg(&budget->i2c_adap, 0x50, 0x67); in frontend_init()
546 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config_activy, &budget->i2c_adap); in frontend_init()
547 if (budget->dvb_frontend) { in frontend_init()
549 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; in frontend_init()
550 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; in frontend_init()
551 budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage; in frontend_init()
552 budget->dvb_frontend->ops.dishnetwork_send_legacy_command = NULL; in frontend_init()
558 saa7146_setgpio(budget->dev, 3, SAA7146_GPIO_OUTLO); in frontend_init()
560 saa7146_setgpio(budget->dev, 3, SAA7146_GPIO_OUTHI); in frontend_init()
562 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsbe1_config_activy, &budget->i2c_adap); in frontend_init()
563 if (budget->dvb_frontend) { in frontend_init()
565 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params; in frontend_init()
566 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; in frontend_init()
567 budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage; in frontend_init()
568 budget->dvb_frontend->ops.dishnetwork_send_legacy_command = NULL; in frontend_init()
575 case 0x4f61: // Fujitsu Siemens Activy Budget-S PCI rev GR (tda8083/Grundig 29504-451(tsa5522)) in frontend_init()
576 budget->dvb_frontend = dvb_attach(tda8083_attach, &grundig_29504_451_config, &budget->i2c_adap); in frontend_init()
577 if (budget->dvb_frontend) { in frontend_init()
578 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; in frontend_init()
579 budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage; in frontend_init()
580 budget->dvb_frontend->ops.dishnetwork_send_legacy_command = NULL; in frontend_init()
584 case 0x5f60: /* Fujitsu Siemens Activy Budget-T PCI rev AL (tda10046/ALPS TDHD1-204A) */ in frontend_init()
585 budget->dvb_frontend = dvb_attach(tda10046_attach, &alps_tdhd1_204a_config, &budget->i2c_adap); in frontend_init()
586 if (budget->dvb_frontend) { in frontend_init()
587 budget->dvb_frontend->ops.tuner_ops.set_params = alps_tdhd1_204a_tuner_set_params; in frontend_init()
588 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; in frontend_init()
592 case 0x5f61: /* Fujitsu Siemens Activy Budget-T PCI rev GR (L64781/Grundig 29504-401(tsa5060)) */ in frontend_init()
593 …budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config_activy, &budget->i2c_ad… in frontend_init()
594 if (budget->dvb_frontend) { in frontend_init()
595 budget->dvb_frontend->tuner_priv = &tuner_address_grundig_29504_401_activy; in frontend_init()
596 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params; in frontend_init()
600 case 0x1016: // Hauppauge/TT Nova-S SE (samsung s5h1420/????(tda8260)) in frontend_init()
604 fe = dvb_attach(s5h1420_attach, &s5h1420_config, &budget->i2c_adap); in frontend_init()
606 fe->ops.tuner_ops.set_params = s5h1420_tuner_set_params; in frontend_init()
607 budget->dvb_frontend = fe; in frontend_init()
608 if (dvb_attach(lnbp21_attach, fe, &budget->i2c_adap, in frontend_init()
617 case 0x1018: // TT Budget-S-1401 (philips tda10086/philips tda8262) in frontend_init()
621 // gpio2 is connected to CLB - reset it + leave it high in frontend_init()
622 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTLO); in frontend_init()
624 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTHI); in frontend_init()
627 fe = dvb_attach(tda10086_attach, &tda10086_config, &budget->i2c_adap); in frontend_init()
629 budget->dvb_frontend = fe; in frontend_init()
631 &budget->i2c_adap, 0) == NULL) in frontend_init()
634 &budget->i2c_adap, 0, 0) == NULL) { in frontend_init()
643 case 0x101c: { /* TT S2-1600 */ in frontend_init()
645 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTLO); in frontend_init()
647 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTHI); in frontend_init()
650 budget->dvb_frontend = dvb_attach(stv090x_attach, in frontend_init()
652 &budget->i2c_adap, in frontend_init()
655 if (budget->dvb_frontend) { in frontend_init()
658 budget->dvb_frontend, in frontend_init()
660 &budget->i2c_adap); in frontend_init()
663 tt1600_stv090x_config.tuner_init = ctl->tuner_init; in frontend_init()
664 tt1600_stv090x_config.tuner_sleep = ctl->tuner_sleep; in frontend_init()
665 tt1600_stv090x_config.tuner_set_mode = ctl->tuner_set_mode; in frontend_init()
666 tt1600_stv090x_config.tuner_set_frequency = ctl->tuner_set_frequency; in frontend_init()
667 tt1600_stv090x_config.tuner_get_frequency = ctl->tuner_get_frequency; in frontend_init()
668 tt1600_stv090x_config.tuner_set_bandwidth = ctl->tuner_set_bandwidth; in frontend_init()
669 tt1600_stv090x_config.tuner_get_bandwidth = ctl->tuner_get_bandwidth; in frontend_init()
670 tt1600_stv090x_config.tuner_set_bbgain = ctl->tuner_set_bbgain; in frontend_init()
671 tt1600_stv090x_config.tuner_get_bbgain = ctl->tuner_get_bbgain; in frontend_init()
672 tt1600_stv090x_config.tuner_set_refclk = ctl->tuner_set_refclk; in frontend_init()
673 tt1600_stv090x_config.tuner_get_status = ctl->tuner_get_status; in frontend_init()
678 if (budget->dvb_frontend->ops.init) in frontend_init()
679 budget->dvb_frontend->ops.init(budget->dvb_frontend); in frontend_init()
682 budget->dvb_frontend, in frontend_init()
683 &budget->i2c_adap, in frontend_init()
698 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTLO); in frontend_init()
700 saa7146_setgpio(budget->dev, 2, SAA7146_GPIO_OUTHI); in frontend_init()
703 budget->dvb_frontend = dvb_attach(stv090x_attach, in frontend_init()
705 &budget->i2c_adap, in frontend_init()
708 if (budget->dvb_frontend) { in frontend_init()
712 budget->dvb_frontend, in frontend_init()
714 &budget->i2c_adap); in frontend_init()
717 tt1600_stv090x_config.tuner_init = ctl->tuner_init; in frontend_init()
718 tt1600_stv090x_config.tuner_sleep = ctl->tuner_sleep; in frontend_init()
719 tt1600_stv090x_config.tuner_set_mode = ctl->tuner_set_mode; in frontend_init()
720 tt1600_stv090x_config.tuner_set_frequency = ctl->tuner_set_frequency; in frontend_init()
721 tt1600_stv090x_config.tuner_get_frequency = ctl->tuner_get_frequency; in frontend_init()
722 tt1600_stv090x_config.tuner_set_bandwidth = ctl->tuner_set_bandwidth; in frontend_init()
723 tt1600_stv090x_config.tuner_get_bandwidth = ctl->tuner_get_bandwidth; in frontend_init()
724 tt1600_stv090x_config.tuner_set_bbgain = ctl->tuner_set_bbgain; in frontend_init()
725 tt1600_stv090x_config.tuner_get_bbgain = ctl->tuner_get_bbgain; in frontend_init()
726 tt1600_stv090x_config.tuner_set_refclk = ctl->tuner_set_refclk; in frontend_init()
727 tt1600_stv090x_config.tuner_get_status = ctl->tuner_get_status; in frontend_init()
732 if (budget->dvb_frontend->ops.init) in frontend_init()
733 budget->dvb_frontend->ops.init(budget->dvb_frontend); in frontend_init()
736 budget->dvb_frontend, in frontend_init()
737 &budget->i2c_adap, in frontend_init()
753 if (budget->dvb_frontend == NULL) { in frontend_init()
755 budget->dev->pci->vendor, in frontend_init()
756 budget->dev->pci->device, in frontend_init()
757 budget->dev->pci->subsystem_vendor, in frontend_init()
758 budget->dev->pci->subsystem_device); in frontend_init()
760 if (dvb_register_frontend(&budget->dvb_adapter, budget->dvb_frontend)) in frontend_init()
767 dvb_frontend_detach(budget->dvb_frontend); in frontend_init()
768 budget->dvb_frontend = NULL; in frontend_init()
779 return -ENOMEM; in budget_attach()
784 dev->ext_priv = budget; in budget_attach()
793 budget->dvb_adapter.priv = budget; in budget_attach()
803 struct budget *budget = dev->ext_priv; in budget_detach()
806 if (budget->dvb_frontend) { in budget_detach()
807 dvb_unregister_frontend(budget->dvb_frontend); in budget_detach()
808 dvb_frontend_detach(budget->dvb_frontend); in budget_detach()
814 dev->ext_priv = NULL; in budget_detach()
821 MAKE_BUDGET_INFO(ttbs, "TT-Budget/WinTV-NOVA-S PCI", BUDGET_TT);
822 MAKE_BUDGET_INFO(ttbc, "TT-Budget/WinTV-NOVA-C PCI", BUDGET_TT);
823 MAKE_BUDGET_INFO(ttbt, "TT-Budget/WinTV-NOVA-T PCI", BUDGET_TT);
825 MAKE_BUDGET_INFO(ttbs1401, "TT-Budget-S-1401 PCI", BUDGET_TT);
826 MAKE_BUDGET_INFO(tt1600, "TT-Budget S2-1600 PCI", BUDGET_TT);
827 MAKE_BUDGET_INFO(fsacs0, "Fujitsu Siemens Activy Budget-S PCI (rev GR/grundig frontend)", BUDGET_FS…
828 MAKE_BUDGET_INFO(fsacs1, "Fujitsu Siemens Activy Budget-S PCI (rev AL/alps frontend)", BUDGET_FS_AC…
829 MAKE_BUDGET_INFO(fsact, "Fujitsu Siemens Activy Budget-T PCI (rev GR/Grundig frontend)", BUDGET_FS…
830 MAKE_BUDGET_INFO(fsact1, "Fujitsu Siemens Activy Budget-T PCI (rev AL/ALPS TDHD1-204A)", BUDGET_FS_…
883 MODULE_DESCRIPTION("driver for the SAA7146 based so-called budget PCI DVB cards by Siemens, Technot…