summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorHolger Waechtler <devnull@localhost>2003-06-29 21:56:50 +0000
committerHolger Waechtler <devnull@localhost>2003-06-29 21:56:50 +0000
commit77521aea06a577eb5dcad9c975a5801868f478bb (patch)
treec35bda0e4157fdde6936834ea7fece6617740684 /linux/drivers/media
parentac71da82b8b5decadf5e8781e9e3dbc82447093b (diff)
downloadmediapointer-dvb-s2-77521aea06a577eb5dcad9c975a5801868f478bb.tar.gz
mediapointer-dvb-s2-77521aea06a577eb5dcad9c975a5801868f478bb.tar.bz2
- remove obsolete fields from struct bt878
- make DMA block pointer volatile - use one local tasklet per card - remove spinlock bt->s_lock, it protected an atomic variable only - remove obsolete waitqueue code, the waitqueue was not used anymore
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/bt8xx/bt878.c20
-rw-r--r--linux/drivers/media/dvb/bt8xx/bt878.h13
-rw-r--r--linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c10
3 files changed, 11 insertions, 32 deletions
diff --git a/linux/drivers/media/dvb/bt8xx/bt878.c b/linux/drivers/media/dvb/bt8xx/bt878.c
index f876332e0..de4906222 100644
--- a/linux/drivers/media/dvb/bt8xx/bt878.c
+++ b/linux/drivers/media/dvb/bt8xx/bt878.c
@@ -229,9 +229,6 @@ void bt878_start(struct bt878 *bt, u32 controlreg)
btwrite(cpu_to_le32(bt->risc_dma), BT878_ARISC_START);
- if(bt->tasklet)
- tasklet_enable(bt->tasklet);
-
btwrite(0x000ff800,BT878_AINT_MASK);
btwrite(controlreg,BT878_AGPIO_DMA_CTL);
@@ -255,13 +252,10 @@ void bt878_stop(struct bt878 *bt)
if (!(stat&BT878_ARISC_EN))
break;
- i++;
-
+ i++;
+
} while (i < 500);
-
- if(bt->tasklet)
- tasklet_disable(bt->tasklet);
-
+
dprintk("bt878(%d) debug: bt878_stop, i=%d, stat=0x%8.8x\n",bt->nr,i,stat);
}
@@ -322,12 +316,8 @@ irqreturn_t bt878_irq(int irq, void *dev_id, struct pt_regs * regs)
}
}
if(astat&BT878_ARISCI) {
- spin_lock(&bt->s_lock);
bt->finished_block = (stat & BT878_ARISCS) >> 28;
- spin_unlock(&bt->s_lock);
- wake_up_interruptible(&bt->readq);
- if(bt->tasklet)
- tasklet_schedule(bt->tasklet);
+ tasklet_schedule(&bt->tasklet);
break;
}
count++;
@@ -360,8 +350,6 @@ static int __devinit bt878_probe(struct pci_dev *dev, const struct pci_device_id
bt=&bt878[bt878_num];
bt->dev=dev;
bt->nr = bt878_num;
- init_waitqueue_head(&bt->readq);
- bt->s_lock = SPIN_LOCK_UNLOCKED;
bt->shutdown=0;
bt->id=dev->device;
diff --git a/linux/drivers/media/dvb/bt8xx/bt878.h b/linux/drivers/media/dvb/bt8xx/bt878.h
index 5676f7708..2f3afc77d 100644
--- a/linux/drivers/media/dvb/bt8xx/bt878.h
+++ b/linux/drivers/media/dvb/bt8xx/bt878.h
@@ -88,8 +88,8 @@ struct bt878 {
unsigned long bt878_adr;
unsigned char *bt878_mem;
- u32 finished_block;
- u32 last_block;
+ volatile u32 finished_block;
+ volatile u32 last_block;
u32 block_count;
u32 block_bytes;
u32 line_bytes;
@@ -104,14 +104,9 @@ struct bt878 {
dma_addr_t risc_dma;
u32 risc_pos;
- int writebuf;
- int readbuf;
- int readptr;
-
- wait_queue_head_t readq;
- struct tasklet_struct *tasklet;
+ struct tasklet_struct tasklet;
int shutdown;
- };
+};
void bt878_start(struct bt878 *bt, u32 controlreg);
void bt878_stop(struct bt878 *bt);
diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 1d47f90da..71613d39b 100644
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -47,13 +47,10 @@ static void dvb_bt8xx_task(unsigned long data)
{
struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *)data;
- u8 finished_block = card->bt->finished_block;
//printk("%d ", finished_block);
- while (card->bt->last_block != finished_block) {
-
- //printk("dvb_bt8xx: missed irq (%d/%d)\n", card->bt->last_block, finished_block);
+ while (card->bt->last_block != card->bt->finished_block) {
dvb_dmx_swfilter(&card->demux, &card->bt->buf_cpu[card->bt->last_block * card->bt->block_bytes], card->bt->block_bytes);
@@ -63,7 +60,6 @@ static void dvb_bt8xx_task(unsigned long data)
}
-static DECLARE_TASKLET_DISABLED(dvb_bt8xx_tasklet, dvb_bt8xx_task, 0);
static int dvb_bt8xx_master_xfer(struct dvb_i2c_bus *i2c, const struct i2c_msg msgs[], int num)
{
@@ -282,8 +278,7 @@ static int __init dvb_bt8xx_load(unsigned int bttv_nr, char *card_name, u32 gpio
dvb_net_init(card->adapter, &card->dvbnet, &card->demux.dmx);
- dvb_bt8xx_tasklet.data = (long)card;
- card->bt->tasklet = &dvb_bt8xx_tasklet;
+ tasklet_init(&card->bt->tasklet, dvb_bt8xx_task, (unsigned long) card);
bt878_start(card->bt, card->gpio_mode);
@@ -307,6 +302,7 @@ static void dvb_bt8xx_close(void)
bt878_stop(card->bt);
+ tasklet_kill(&card->bt->tasklet);
dvb_net_release(&card->dvbnet);
card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_mem);
card->demux.dmx.remove_frontend(&card->demux.dmx, &card->fe_hw);