summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2004-09-20 14:15:56 +0000
committerMichael Hunold <devnull@localhost>2004-09-20 14:15:56 +0000
commit27dfb1458738c40d152f0b6604b82b5b177949d9 (patch)
tree024da97923c4da39ab140024995d29fb4366ec53 /linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
parent5dce00ad8a70ef13fecd227df0b4e8bf5500976a (diff)
downloadmediapointer-dvb-s2-27dfb1458738c40d152f0b6604b82b5b177949d9.tar.gz
mediapointer-dvb-s2-27dfb1458738c40d152f0b6604b82b5b177949d9.tar.bz2
Apply patches by Christopher Pascoe, thanks for your work.
Notes: Note that to use this with either of the DVICO FusionHDTV DVB-T boards you will need to fetch and build against a recent snapshot of the video4linux code that you can obtain from http://dl.bytesex.org/cvs-snapshots/. This will get you the board ID for the Lite board, and/or the kernel I2C support needed for the DVB-T1. Cleanups (mt352-0-cleanup.patch) include: - moving the card_type and dvb_frontend_info structure into the adapter state to permit more than one card type in a system at once converting the force_card parameter to an array to permit the same; - removing incorrect "shift" values reintroduced by the merge of the TDTC9251DH01C driver which was based on an old version of the code with incorrect values - changes discussed and tested by Antonio Mancuso; - removing the incorrect use of I2C_M_NOSTART from the driver. The only boards where this worked were the boards where use_i2c_hw was enabled in the bttv driver, and there only because the i2c_hw code ignores the I2C_M_NOSTART flag and always generates a start condition. On other boards where the clag is respected, this violates the i2c protocol and causes only errors. No-op; - cleaning up some double initialisation (specifically that of the ACQ_CTL register - no-op; - converts some routines to pass the true frequency around, rather than the frequency in MHz - need the real frequency for other boards - no-op; - ignoring FEC_NONE for the LP coderate in the case where OFDM hierarchy mode is either set to be auto-detected or is disabled. The demodulator ignores our settings anyway; - changing the detect_avermedia function to a more generic function that can be used to detect other bt878 or cx2388x cards in a similar way; - rounding the frequency programmed into the PLL so that it will be closer to the desired received frequency; - decoupling requirement for FE_REGISTER/FE_UNREGISTER to be called synchronously from within mt352_attach_adapter/mt352_detach_client, so that mt352 can be used with drivers such as cx88 which have i2c and DVB support in separate modules. The DVICO hardware support (mt352-1-dvico.patch): - introduces functionality for the DVICO FusionHDTV DVB-T1 and DVICO FusionHDTV DVB-T Lite boards in the mt352 frontend; - activates autodetection for these boards; The dvb-bt8xx patch (dvb-bt8xx.patch): - adds hardware support for the DVICO FusionHDTV DVB-T Lite - adds functionality to the bt8xx code to switch on/off DMA of the transport stream only when the DVB layer wants data, rather than generating a constant interrupt stream the entire time that the driver is loaded. The mt352 speedup patch (mt352-2-speedups.patch) helps with tuning speed on the mt352 frontend, by: - reinitialising the frontend only in the case when it has not yet been initialised or when it has been put to sleep; - ignoring requests from the frontend thread to repetitively acquire a transponder with the same parameters. Each time it does this, the tuner/demodulator lose sync and acquisition time is needlessly extended.
Diffstat (limited to 'linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c')
-rw-r--r--linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 94925f90c..b239065df 100644
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -68,20 +68,21 @@ static int dvb_bt8xx_start_feed(struct dvb_demux_feed *dvbdmxfeed)
{
struct dvb_demux *dvbdmx = dvbdmxfeed->demux;
struct dvb_bt8xx_card *card = dvbdmx->priv;
+ int rc;
dprintk("dvb_bt8xx: start_feed\n");
if (!dvbdmx->dmx.frontend)
return -EINVAL;
- if (card->active)
- return 0;
-
- card->active = 1;
-
-// bt878_start(card->bt, card->gpio_mode);
-
- return 0;
+ down(&card->lock);
+ card->nfeeds++;
+ rc = card->nfeeds;
+ if (card->nfeeds == 1)
+ bt878_start(card->bt, card->gpio_mode,
+ card->op_sync_orin, card->irq_err_ignore);
+ up(&card->lock);
+ return rc;
}
static int dvb_bt8xx_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
@@ -93,13 +94,12 @@ static int dvb_bt8xx_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
if (!dvbdmx->dmx.frontend)
return -EINVAL;
-
- if (!card->active)
- return 0;
-
-// bt878_stop(card->bt);
- card->active = 0;
+ down(&card->lock);
+ card->nfeeds--;
+ if (card->nfeeds == 0)
+ bt878_stop(card->bt);
+ up(&card->lock);
return 0;
}
@@ -207,8 +207,6 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card)
tasklet_init(&card->bt->tasklet, dvb_bt8xx_task, (unsigned long) card);
- bt878_start(card->bt, card->gpio_mode, card->op_sync_orin, card->irq_err_ignore);
-
return 0;
}
@@ -223,6 +221,7 @@ static int dvb_bt8xx_probe(struct device *dev)
return -ENOMEM;
memset(card, 0, sizeof(*card));
+ init_MUTEX(&card->lock);
card->bttv_nr = sub->core->nr;
strncpy(card->card_name, sub->core->name, sizeof(sub->core->name));
card->i2c_adapter = &sub->core->i2c_adap;
@@ -230,6 +229,8 @@ static int dvb_bt8xx_probe(struct device *dev)
switch(sub->core->type)
{
case BTTV_PINNACLESAT:
+#ifdef BTTV_DVICO_DVBT_LITE
+ case BTTV_DVICO_DVBT_LITE:
card->gpio_mode = 0x0400C060;
card->op_sync_orin = 0;
card->irq_err_ignore = 0;
@@ -237,7 +238,7 @@ static int dvb_bt8xx_probe(struct device *dev)
* A_PWRDN DA_DPM DA_SBR DA_IOM_DA
* DA_APP(parallel) */
break;
-
+#endif
case BTTV_NEBULA_DIGITV:
case BTTV_AVDVBT_761:
card->gpio_mode = (1 << 26) | (1 << 14) | (1 << 5);
@@ -321,7 +322,6 @@ static int dvb_bt8xx_remove(struct device *dev)
dvb_dmx_release(&card->demux);
dvb_unregister_adapter(card->dvb_adapter);
- list_del(&card->list);
kfree(card);
return 0;