Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164223
b: refs/heads/master
c: cca0e54
h: refs/heads/master
i:
  164221: f91d5eb
  164219: 9949812
  164215: 6178aa9
  164207: 446de1d
  164191: 32a468c
  164159: ed608c5
  164095: b4f5e5e
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Sep 19, 2009
1 parent 04aa63c commit 9e9be00
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa48984e36ee73e964eeb994a45de6525114e871
refs/heads/master: cca0e54905259a456d97652d4f1e2fe8b188b6ad
27 changes: 27 additions & 0 deletions trunk/drivers/media/video/sh_mobile_ceu_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,27 @@ static void sh_mobile_ceu_videobuf_queue(struct videobuf_queue *vq,
static void sh_mobile_ceu_videobuf_release(struct videobuf_queue *vq,
struct videobuf_buffer *vb)
{
struct soc_camera_device *icd = vq->priv_data;
struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
struct sh_mobile_ceu_dev *pcdev = ici->priv;
unsigned long flags;

spin_lock_irqsave(&pcdev->lock, flags);

if (pcdev->active == vb) {
/* disable capture (release DMA buffer), reset */
ceu_write(pcdev, CAPSR, 1 << 16);
pcdev->active = NULL;
}

if ((vb->state == VIDEOBUF_ACTIVE || vb->state == VIDEOBUF_QUEUED) &&
!list_empty(&vb->queue)) {
vb->state = VIDEOBUF_ERROR;
list_del_init(&vb->queue);
}

spin_unlock_irqrestore(&pcdev->lock, flags);

free_buffer(vq, container_of(vb, struct sh_mobile_ceu_buffer, vb));
}

Expand All @@ -326,6 +347,10 @@ static irqreturn_t sh_mobile_ceu_irq(int irq, void *data)
spin_lock_irqsave(&pcdev->lock, flags);

vb = pcdev->active;
if (!vb)
/* Stale interrupt from a released buffer */
goto out;

list_del_init(&vb->queue);

if (!list_empty(&pcdev->capture))
Expand All @@ -340,6 +365,8 @@ static irqreturn_t sh_mobile_ceu_irq(int irq, void *data)
do_gettimeofday(&vb->ts);
vb->field_count++;
wake_up(&vb->done);

out:
spin_unlock_irqrestore(&pcdev->lock, flags);

return IRQ_HANDLED;
Expand Down

0 comments on commit 9e9be00

Please sign in to comment.