Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 490 → Rev 491

/shark/trunk/drivers/bttv/bttv-driver.c
720,8 → 720,8
for (i=0; i<10; i++) {
/* Let other people run while the PLL stabilizes */
vprintk(".");
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(HZ/10);
//current->state = TASK_INTERRUPTIBLE;
//schedule_timeout(HZ/10);
if (btread(BT848_DSTATUS) & BT848_DSTATUS_PLOCK) {
btwrite(0,BT848_DSTATUS);
2789,6 → 2789,7
return retval;
}
 
/*
static unsigned int bttv_poll(struct file *file, poll_table *wait)
{
struct bttv_fh *fh = file->private_data;
2802,15 → 2803,12
}
 
if (check_btres(fh,RESOURCE_VIDEO)) {
/* streaming capture */
if (list_empty(&fh->cap.stream))
return POLLERR;
buf = list_entry(fh->cap.stream.next,struct bttv_buffer,vb.stream);
} else {
/* read() capture */
//down(&fh->cap.lock);
if (NULL == fh->cap.read_buf) {
/* need to capture a new frame */
if (locked_btres(fh->btv,RESOURCE_VIDEO)) {
//up(&fh->cap.lock);
return POLLERR;
2833,12 → 2831,13
buf = (struct bttv_buffer*)fh->cap.read_buf;
}
poll_wait(file, &buf->vb.done, wait);
//poll_wait(file, &buf->vb.done, wait);
if (buf->vb.state == STATE_DONE ||
buf->vb.state == STATE_ERROR)
return POLLIN|POLLRDNORM;
return 0;
}
*/
 
static int bttv_open(struct inode *inode, struct file *file)
{
2958,7 → 2957,6
.llseek = no_llseek,
.read = bttv_read,
.mmap = bttv_mmap,
.poll = bttv_poll,
};
 
static struct video_device bttv_video_template =
3215,7 → 3213,7
wakeup->vbi->vb.ts = ts;
wakeup->vbi->vb.field_count = btv->field_count;
wakeup->vbi->vb.state = state;
wake_up(&wakeup->vbi->vb.done);
//wake_up(&wakeup->vbi->vb.done);
}
if (wakeup->top == wakeup->bottom) {
if (NULL != wakeup->top && curr->top != wakeup->top) {
3224,7 → 3222,7
wakeup->top->vb.ts = ts;
wakeup->top->vb.field_count = btv->field_count;
wakeup->top->vb.state = state;
wake_up(&wakeup->top->vb.done);
//wake_up(&wakeup->top->vb.done);
}
} else {
if (NULL != wakeup->top && curr->top != wakeup->top) {
3233,7 → 3231,7
wakeup->top->vb.ts = ts;
wakeup->top->vb.field_count = btv->field_count;
wakeup->top->vb.state = state;
wake_up(&wakeup->top->vb.done);
//wake_up(&wakeup->top->vb.done);
}
if (NULL != wakeup->bottom && curr->bottom != wakeup->bottom) {
if (irq_debug > 1)
3241,7 → 3239,7
wakeup->bottom->vb.ts = ts;
wakeup->bottom->vb.field_count = btv->field_count;
wakeup->bottom->vb.state = state;
wake_up(&wakeup->bottom->vb.done);
//wake_up(&wakeup->bottom->vb.done);
}
}
}
3276,13 → 3274,13
item = list_entry(btv->capture.next, struct bttv_buffer, vb.queue);
list_del(&item->vb.queue);
item->vb.state = STATE_ERROR;
wake_up(&item->vb.done);
//wake_up(&item->vb.done);
}
while (!list_empty(&btv->vcapture)) {
item = list_entry(btv->vcapture.next, struct bttv_buffer, vb.queue);
list_del(&item->vb.queue);
item->vb.state = STATE_ERROR;
wake_up(&item->vb.done);
//wake_up(&item->vb.done);
}
btv->errors++;
3305,7 → 3303,7
do_gettimeofday(&wakeup->vb.ts);
wakeup->vb.field_count = btv->field_count;
wakeup->vb.state = STATE_DONE;
wake_up(&wakeup->vb.done);
//wake_up(&wakeup->vb.done);
spin_unlock(&btv->s_lock);
}
 
3394,7 → 3392,7
if (btv->remote)
bttv_input_irq(btv);
#endif
wake_up(&btv->gpioq);
//wake_up(&btv->gpioq);
}
 
if ((astat & BT848_INT_RISCI) && (stat & (2<<28)))
3557,7 → 3555,7
init_MUTEX(&btv->lock);
init_MUTEX(&btv->reslock);
btv->s_lock = SPIN_LOCK_UNLOCKED;
init_waitqueue_head(&btv->gpioq);
//init_waitqueue_head(&btv->gpioq);
INIT_LIST_HEAD(&btv->capture);
INIT_LIST_HEAD(&btv->vcapture);
#ifdef VIDIOC_G_PRIORITY
3609,7 → 3607,7
bttv_num,btv->id, btv->revision, pci_name(dev));
printk("irq: %d, latency: %d, mmio: 0x%lx\n",
btv->dev->irq, lat, pci_resource_start(dev,0));
schedule();
//schedule();
btv->bt848_mmio=ioremap(pci_resource_start(dev,0), 0x1000);
if (NULL == ioremap(pci_resource_start(dev,0), 0x1000)) {
3725,7 → 3723,7
 
/* tell gpio modules we are leaving ... */
btv->shutdown=1;
wake_up(&btv->gpioq);
//wake_up(&btv->gpioq);
 
/* unregister i2c_bus + input */
fini_bttv_i2c(btv);