aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/davinci
diff options
context:
space:
mode:
authorManjunath Hadli <manjunath.hadli@ti.com>2012-04-13 03:43:10 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-30 17:59:50 -0400
commitb1fc42302b75bb9c4940317e3bf2f1e2efdb3a1a (patch)
tree934aef5be42746a192fa403d66324b4ec3b3f01d /drivers/media/video/davinci
parent4099040eaaa4fe543c4e915b8cab51b1d843edee (diff)
[media] davinci: vpif: add check for genuine interrupts in the isr
As the same interrupt is shared between capture and display devices, sometimes we get isr calls where the interrupt might not genuinely belong to capture or display. Hence, add a condition in the isr to check for interrupt ownership and channel number to make sure we do not service wrong interrupts. Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/davinci')
-rw-r--r--drivers/media/video/davinci/vpif.h15
-rw-r--r--drivers/media/video/davinci/vpif_capture.c3
-rw-r--r--drivers/media/video/davinci/vpif_display.c3
3 files changed, 21 insertions, 0 deletions
diff --git a/drivers/media/video/davinci/vpif.h b/drivers/media/video/davinci/vpif.h
index 8bcac65f9294..a4d2141d1ef3 100644
--- a/drivers/media/video/davinci/vpif.h
+++ b/drivers/media/video/davinci/vpif.h
@@ -569,6 +569,21 @@ static inline void ch3_set_vbi_addr(unsigned long top_strt_luma,
569 regw(btm_strt_luma, VPIF_CH3_BTM_STRT_ADD_VANC); 569 regw(btm_strt_luma, VPIF_CH3_BTM_STRT_ADD_VANC);
570} 570}
571 571
572static inline int vpif_intr_status(int channel)
573{
574 int status = 0;
575 int mask;
576
577 if (channel < 0 || channel > 3)
578 return 0;
579
580 mask = 1 << channel;
581 status = regr(VPIF_STATUS) & mask;
582 regw(status, VPIF_STATUS_CLR);
583
584 return status;
585}
586
572#define VPIF_MAX_NAME (30) 587#define VPIF_MAX_NAME (30)
573 588
574/* This structure will store size parameters as per the mode selected by user */ 589/* This structure will store size parameters as per the mode selected by user */
diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index 96046957bf21..e01141234846 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -341,6 +341,9 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
341 int fid = -1, i; 341 int fid = -1, i;
342 342
343 channel_id = *(int *)(dev_id); 343 channel_id = *(int *)(dev_id);
344 if (!vpif_intr_status(channel_id))
345 return IRQ_NONE;
346
344 ch = dev->dev[channel_id]; 347 ch = dev->dev[channel_id];
345 348
346 field = ch->common[VPIF_VIDEO_INDEX].fmt.fmt.pix.field; 349 field = ch->common[VPIF_VIDEO_INDEX].fmt.fmt.pix.field;
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index e6488ee7db18..a5049a92f851 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -307,6 +307,9 @@ static irqreturn_t vpif_channel_isr(int irq, void *dev_id)
307 int channel_id = 0; 307 int channel_id = 0;
308 308
309 channel_id = *(int *)(dev_id); 309 channel_id = *(int *)(dev_id);
310 if (!vpif_intr_status(channel_id + 2))
311 return IRQ_NONE;
312
310 ch = dev->dev[channel_id]; 313 ch = dev->dev[channel_id];
311 field = ch->common[VPIF_VIDEO_INDEX].fmt.fmt.pix.field; 314 field = ch->common[VPIF_VIDEO_INDEX].fmt.fmt.pix.field;
312 for (i = 0; i < VPIF_NUMOBJECTS; i++) { 315 for (i = 0; i < VPIF_NUMOBJECTS; i++) {