Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB: V4L: vpfe_capture: Add call back function for interrupt clear for vpfe_cfg

For the devices like AM3517, it is expected that driver clears the
interrupt in ISR. Since this is device spcific, callback function
added to the platform_data.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Muralidharan Karicheri <mkaricheri@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Vaibhav Hiremath and committed by
Mauro Carvalho Chehab
085b54a2 fcc63274

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