aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/bt8xx/dvb-bt8xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/bt8xx/dvb-bt8xx.c')
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index ea27b15007e9..baa8227ef87c 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -76,13 +76,13 @@ static int dvb_bt8xx_start_feed(struct dvb_demux_feed *dvbdmxfeed)
76 if (!dvbdmx->dmx.frontend) 76 if (!dvbdmx->dmx.frontend)
77 return -EINVAL; 77 return -EINVAL;
78 78
79 down(&card->lock); 79 mutex_lock(&card->lock);
80 card->nfeeds++; 80 card->nfeeds++;
81 rc = card->nfeeds; 81 rc = card->nfeeds;
82 if (card->nfeeds == 1) 82 if (card->nfeeds == 1)
83 bt878_start(card->bt, card->gpio_mode, 83 bt878_start(card->bt, card->gpio_mode,
84 card->op_sync_orin, card->irq_err_ignore); 84 card->op_sync_orin, card->irq_err_ignore);
85 up(&card->lock); 85 mutex_unlock(&card->lock);
86 return rc; 86 return rc;
87} 87}
88 88
@@ -96,11 +96,11 @@ static int dvb_bt8xx_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
96 if (!dvbdmx->dmx.frontend) 96 if (!dvbdmx->dmx.frontend)
97 return -EINVAL; 97 return -EINVAL;
98 98
99 down(&card->lock); 99 mutex_lock(&card->lock);
100 card->nfeeds--; 100 card->nfeeds--;
101 if (card->nfeeds == 0) 101 if (card->nfeeds == 0)
102 bt878_stop(card->bt); 102 bt878_stop(card->bt);
103 up(&card->lock); 103 mutex_unlock(&card->lock);
104 104
105 return 0; 105 return 0;
106} 106}
@@ -239,6 +239,20 @@ static int cx24108_pll_set(struct dvb_frontend* fe, struct dvb_frontend_paramete
239 239
240static int pinnsat_pll_init(struct dvb_frontend* fe) 240static int pinnsat_pll_init(struct dvb_frontend* fe)
241{ 241{
242 struct dvb_bt8xx_card *card = fe->dvb->priv;
243
244 bttv_gpio_enable(card->bttv_nr, 1, 1); /* output */
245 bttv_write_gpio(card->bttv_nr, 1, 1); /* relay on */
246
247 return 0;
248}
249
250static int pinnsat_pll_sleep(struct dvb_frontend* fe)
251{
252 struct dvb_bt8xx_card *card = fe->dvb->priv;
253
254 bttv_write_gpio(card->bttv_nr, 1, 0); /* relay off */
255
242 return 0; 256 return 0;
243} 257}
244 258
@@ -246,6 +260,7 @@ static struct cx24110_config pctvsat_config = {
246 .demod_address = 0x55, 260 .demod_address = 0x55,
247 .pll_init = pinnsat_pll_init, 261 .pll_init = pinnsat_pll_init,
248 .pll_set = cx24108_pll_set, 262 .pll_set = cx24108_pll_set,
263 .pll_sleep = pinnsat_pll_sleep,
249}; 264};
250 265
251static int microtune_mt7202dtf_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) 266static int microtune_mt7202dtf_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
@@ -788,7 +803,7 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
788 if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL))) 803 if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL)))
789 return -ENOMEM; 804 return -ENOMEM;
790 805
791 init_MUTEX(&card->lock); 806 mutex_init(&card->lock);
792 card->bttv_nr = sub->core->nr; 807 card->bttv_nr = sub->core->nr;
793 strncpy(card->card_name, sub->core->name, sizeof(sub->core->name)); 808 strncpy(card->card_name, sub->core->name, sizeof(sub->core->name));
794 card->i2c_adapter = &sub->core->i2c_adap; 809 card->i2c_adapter = &sub->core->i2c_adap;
@@ -798,14 +813,14 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
798 card->gpio_mode = 0x0400c060; 813 card->gpio_mode = 0x0400c060;
799 /* should be: BT878_A_GAIN=0,BT878_A_PWRDN,BT878_DA_DPM,BT878_DA_SBR, 814 /* should be: BT878_A_GAIN=0,BT878_A_PWRDN,BT878_DA_DPM,BT878_DA_SBR,
800 BT878_DA_IOM=1,BT878_DA_APP to enable serial highspeed mode. */ 815 BT878_DA_IOM=1,BT878_DA_APP to enable serial highspeed mode. */
801 card->op_sync_orin = 0; 816 card->op_sync_orin = BT878_RISC_SYNC_MASK;
802 card->irq_err_ignore = 0; 817 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
803 break; 818 break;
804 819
805 case BTTV_BOARD_DVICO_DVBT_LITE: 820 case BTTV_BOARD_DVICO_DVBT_LITE:
806 card->gpio_mode = 0x0400C060; 821 card->gpio_mode = 0x0400C060;
807 card->op_sync_orin = 0; 822 card->op_sync_orin = BT878_RISC_SYNC_MASK;
808 card->irq_err_ignore = 0; 823 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
809 /* 26, 15, 14, 6, 5 824 /* 26, 15, 14, 6, 5
810 * A_PWRDN DA_DPM DA_SBR DA_IOM_DA 825 * A_PWRDN DA_DPM DA_SBR DA_IOM_DA
811 * DA_APP(parallel) */ 826 * DA_APP(parallel) */
@@ -820,15 +835,15 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
820 case BTTV_BOARD_NEBULA_DIGITV: 835 case BTTV_BOARD_NEBULA_DIGITV:
821 case BTTV_BOARD_AVDVBT_761: 836 case BTTV_BOARD_AVDVBT_761:
822 card->gpio_mode = (1 << 26) | (1 << 14) | (1 << 5); 837 card->gpio_mode = (1 << 26) | (1 << 14) | (1 << 5);
823 card->op_sync_orin = 0; 838 card->op_sync_orin = BT878_RISC_SYNC_MASK;
824 card->irq_err_ignore = 0; 839 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
825 /* A_PWRDN DA_SBR DA_APP (high speed serial) */ 840 /* A_PWRDN DA_SBR DA_APP (high speed serial) */
826 break; 841 break;
827 842
828 case BTTV_BOARD_AVDVBT_771: //case 0x07711461: 843 case BTTV_BOARD_AVDVBT_771: //case 0x07711461:
829 card->gpio_mode = 0x0400402B; 844 card->gpio_mode = 0x0400402B;
830 card->op_sync_orin = BT878_RISC_SYNC_MASK; 845 card->op_sync_orin = BT878_RISC_SYNC_MASK;
831 card->irq_err_ignore = 0; 846 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
832 /* A_PWRDN DA_SBR DA_APP[0] PKTP=10 RISC_ENABLE FIFO_ENABLE*/ 847 /* A_PWRDN DA_SBR DA_APP[0] PKTP=10 RISC_ENABLE FIFO_ENABLE*/
833 break; 848 break;
834 849
@@ -852,8 +867,8 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
852 867
853 case BTTV_BOARD_PC_HDTV: 868 case BTTV_BOARD_PC_HDTV:
854 card->gpio_mode = 0x0100EC7B; 869 card->gpio_mode = 0x0100EC7B;
855 card->op_sync_orin = 0; 870 card->op_sync_orin = BT878_RISC_SYNC_MASK;
856 card->irq_err_ignore = 0; 871 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
857 break; 872 break;
858 873
859 default: 874 default:
@@ -881,7 +896,7 @@ static int dvb_bt8xx_probe(struct bttv_sub_device *sub)
881 return -EFAULT; 896 return -EFAULT;
882 } 897 }
883 898
884 init_MUTEX(&card->bt->gpio_lock); 899 mutex_init(&card->bt->gpio_lock);
885 card->bt->bttv_nr = sub->core->nr; 900 card->bt->bttv_nr = sub->core->nr;
886 901
887 if ( (ret = dvb_bt8xx_load_card(card, sub->core->type)) ) { 902 if ( (ret = dvb_bt8xx_load_card(card, sub->core->type)) ) {