diff options
-rw-r--r-- | drivers/media/video/davinci/vpfe_capture.c | 24 | ||||
-rw-r--r-- | include/media/davinci/vpfe_capture.h | 2 |
2 files changed, 22 insertions, 4 deletions
diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c index 398dbe71cb82..caeac199d15b 100644 --- a/drivers/media/video/davinci/vpfe_capture.c +++ b/drivers/media/video/davinci/vpfe_capture.c | |||
@@ -475,6 +475,11 @@ static int vpfe_initialize_device(struct vpfe_device *vpfe_dev) | |||
475 | ret = ccdc_dev->hw_ops.open(vpfe_dev->pdev); | 475 | ret = ccdc_dev->hw_ops.open(vpfe_dev->pdev); |
476 | if (!ret) | 476 | if (!ret) |
477 | vpfe_dev->initialized = 1; | 477 | vpfe_dev->initialized = 1; |
478 | |||
479 | /* Clear all VPFE/CCDC interrupts */ | ||
480 | if (vpfe_dev->cfg->clr_intr) | ||
481 | vpfe_dev->cfg->clr_intr(-1); | ||
482 | |||
478 | unlock: | 483 | unlock: |
479 | mutex_unlock(&ccdc_lock); | 484 | mutex_unlock(&ccdc_lock); |
480 | return ret; | 485 | return ret; |
@@ -562,7 +567,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id) | |||
562 | 567 | ||
563 | /* if streaming not started, don't do anything */ | 568 | /* if streaming not started, don't do anything */ |
564 | if (!vpfe_dev->started) | 569 | if (!vpfe_dev->started) |
565 | return IRQ_HANDLED; | 570 | goto clear_intr; |
566 | 571 | ||
567 | /* only for 6446 this will be applicable */ | 572 | /* only for 6446 this will be applicable */ |
568 | if (NULL != ccdc_dev->hw_ops.reset) | 573 | if (NULL != ccdc_dev->hw_ops.reset) |
@@ -574,7 +579,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id) | |||
574 | "frame format is progressive...\n"); | 579 | "frame format is progressive...\n"); |
575 | if (vpfe_dev->cur_frm != vpfe_dev->next_frm) | 580 | if (vpfe_dev->cur_frm != vpfe_dev->next_frm) |
576 | vpfe_process_buffer_complete(vpfe_dev); | 581 | vpfe_process_buffer_complete(vpfe_dev); |
577 | return IRQ_HANDLED; | 582 | goto clear_intr; |
578 | } | 583 | } |
579 | 584 | ||
580 | /* interlaced or TB capture check which field we are in hardware */ | 585 | /* interlaced or TB capture check which field we are in hardware */ |
@@ -604,7 +609,7 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id) | |||
604 | addr += vpfe_dev->field_off; | 609 | addr += vpfe_dev->field_off; |
605 | ccdc_dev->hw_ops.setfbaddr(addr); | 610 | ccdc_dev->hw_ops.setfbaddr(addr); |
606 | } | 611 | } |
607 | return IRQ_HANDLED; | 612 | goto clear_intr; |
608 | } | 613 | } |
609 | /* | 614 | /* |
610 | * if one field is just being captured configure | 615 | * if one field is just being captured configure |
@@ -624,6 +629,10 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id) | |||
624 | */ | 629 | */ |
625 | vpfe_dev->field_id = fid; | 630 | vpfe_dev->field_id = fid; |
626 | } | 631 | } |
632 | clear_intr: | ||
633 | if (vpfe_dev->cfg->clr_intr) | ||
634 | vpfe_dev->cfg->clr_intr(irq); | ||
635 | |||
627 | return IRQ_HANDLED; | 636 | return IRQ_HANDLED; |
628 | } | 637 | } |
629 | 638 | ||
@@ -635,8 +644,11 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id) | |||
635 | v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "\nInside vdint1_isr...\n"); | 644 | v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "\nInside vdint1_isr...\n"); |
636 | 645 | ||
637 | /* if streaming not started, don't do anything */ | 646 | /* if streaming not started, don't do anything */ |
638 | if (!vpfe_dev->started) | 647 | if (!vpfe_dev->started) { |
648 | if (vpfe_dev->cfg->clr_intr) | ||
649 | vpfe_dev->cfg->clr_intr(irq); | ||
639 | return IRQ_HANDLED; | 650 | return IRQ_HANDLED; |
651 | } | ||
640 | 652 | ||
641 | spin_lock(&vpfe_dev->dma_queue_lock); | 653 | spin_lock(&vpfe_dev->dma_queue_lock); |
642 | if ((vpfe_dev->fmt.fmt.pix.field == V4L2_FIELD_NONE) && | 654 | if ((vpfe_dev->fmt.fmt.pix.field == V4L2_FIELD_NONE) && |
@@ -644,6 +656,10 @@ static irqreturn_t vdint1_isr(int irq, void *dev_id) | |||
644 | vpfe_dev->cur_frm == vpfe_dev->next_frm) | 656 | vpfe_dev->cur_frm == vpfe_dev->next_frm) |
645 | vpfe_schedule_next_buffer(vpfe_dev); | 657 | vpfe_schedule_next_buffer(vpfe_dev); |
646 | spin_unlock(&vpfe_dev->dma_queue_lock); | 658 | spin_unlock(&vpfe_dev->dma_queue_lock); |
659 | |||
660 | if (vpfe_dev->cfg->clr_intr) | ||
661 | vpfe_dev->cfg->clr_intr(irq); | ||
662 | |||
647 | return IRQ_HANDLED; | 663 | return IRQ_HANDLED; |
648 | } | 664 | } |
649 | 665 | ||
diff --git a/include/media/davinci/vpfe_capture.h b/include/media/davinci/vpfe_capture.h index 4314a5f6a087..cc973ed845a7 100644 --- a/include/media/davinci/vpfe_capture.h +++ b/include/media/davinci/vpfe_capture.h | |||
@@ -94,6 +94,8 @@ struct vpfe_config { | |||
94 | /* vpfe clock */ | 94 | /* vpfe clock */ |
95 | struct clk *vpssclk; | 95 | struct clk *vpssclk; |
96 | struct clk *slaveclk; | 96 | struct clk *slaveclk; |
97 | /* Function for Clearing the interrupt */ | ||
98 | void (*clr_intr)(int vdint); | ||
97 | }; | 99 | }; |
98 | 100 | ||
99 | struct vpfe_device { | 101 | struct vpfe_device { |