Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192878
b: refs/heads/master
c: 085b54a
h: refs/heads/master
v: v3
  • Loading branch information
Vaibhav Hiremath authored and Mauro Carvalho Chehab committed May 18, 2010
1 parent 9678388 commit 3072140
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fcc63274e69f95aee9dbb7c1dc3af3d2961813cc
refs/heads/master: 085b54a24fd0c7353cd1b2d462879b7a4a4070fa
24 changes: 20 additions & 4 deletions trunk/drivers/media/video/davinci/vpfe_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,11 @@ static int vpfe_initialize_device(struct vpfe_device *vpfe_dev)
ret = ccdc_dev->hw_ops.open(vpfe_dev->pdev);
if (!ret)
vpfe_dev->initialized = 1;

/* Clear all VPFE/CCDC interrupts */
if (vpfe_dev->cfg->clr_intr)
vpfe_dev->cfg->clr_intr(-1);

unlock:
mutex_unlock(&ccdc_lock);
return ret;
Expand Down Expand Up @@ -562,7 +567,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)

/* if streaming not started, don't do anything */
if (!vpfe_dev->started)
return IRQ_HANDLED;
goto clear_intr;

/* only for 6446 this will be applicable */
if (NULL != ccdc_dev->hw_ops.reset)
Expand All @@ -574,7 +579,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
"frame format is progressive...\n");
if (vpfe_dev->cur_frm != vpfe_dev->next_frm)
vpfe_process_buffer_complete(vpfe_dev);
return IRQ_HANDLED;
goto clear_intr;
}

/* interlaced or TB capture check which field we are in hardware */
Expand Down Expand Up @@ -604,7 +609,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
addr += vpfe_dev->field_off;
ccdc_dev->hw_ops.setfbaddr(addr);
}
return IRQ_HANDLED;
goto clear_intr;
}
/*
* if one field is just being captured configure
Expand All @@ -624,6 +629,10 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
*/
vpfe_dev->field_id = fid;
}
clear_intr:
if (vpfe_dev->cfg->clr_intr)
vpfe_dev->cfg->clr_intr(irq);

return IRQ_HANDLED;
}

Expand All @@ -635,15 +644,22 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id)
v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "\nInside vdint1_isr...\n");

/* if streaming not started, don't do anything */
if (!vpfe_dev->started)
if (!vpfe_dev->started) {
if (vpfe_dev->cfg->clr_intr)
vpfe_dev->cfg->clr_intr(irq);
return IRQ_HANDLED;
}

spin_lock(&vpfe_dev->dma_queue_lock);
if ((vpfe_dev->fmt.fmt.pix.field == V4L2_FIELD_NONE) &&
!list_empty(&vpfe_dev->dma_queue) &&
vpfe_dev->cur_frm == vpfe_dev->next_frm)
vpfe_schedule_next_buffer(vpfe_dev);
spin_unlock(&vpfe_dev->dma_queue_lock);

if (vpfe_dev->cfg->clr_intr)
vpfe_dev->cfg->clr_intr(irq);

return IRQ_HANDLED;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/media/davinci/vpfe_capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ struct vpfe_config {
/* vpfe clock */
struct clk *vpssclk;
struct clk *slaveclk;
/* Function for Clearing the interrupt */
void (*clr_intr)(int vdint);
};

struct vpfe_device {
Expand Down

0 comments on commit 3072140

Please sign in to comment.