summaryrefslogtreecommitdiff
path: root/drivers/media/pci/cx23885/cx23885-av.c
diff options
context:
space:
mode:
authorLuis Alves <ljalvs@gmail.com>2013-07-24 09:06:01 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-08-01 14:55:24 -0300
commit5bc08e1921e46101457d3be09835697490177fdd (patch)
tree36b33c6c42a531adf12804a69da0513778208b04 /drivers/media/pci/cx23885/cx23885-av.c
parent00865fe61e2e0c7641b8a96d871003d6287ec7bc (diff)
downloadlwn-5bc08e1921e46101457d3be09835697490177fdd.tar.gz
lwn-5bc08e1921e46101457d3be09835697490177fdd.zip
[media] cx23885[v4]: Fix interrupt storm when enabling IR receiver
Apparently the Flatiron genereates an interrupt after the built-in self test for each of its left and right channels has completed. Apparently Conexant wire-OR'ed the Flatiron's interrupt output with the interrupt output of the CX23885 A/V core. Those interrupts need to be handled, otherwise, they generate an interrrupt request storm. So: - Add flatiron readreg and writereg functions prototypes on a new header file; - Modify the av interrupt handler to cleanup flatiron IRQs if no other interrupt handling happens. Signed-off-by: Luis Alves <ljalvs@gmail.com> Acked-by: Andy Walls <awalls@md.metrocast.net> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/pci/cx23885/cx23885-av.c')
-rw-r--r--drivers/media/pci/cx23885/cx23885-av.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-av.c b/drivers/media/pci/cx23885/cx23885-av.c
index e958a01fd554..c443b7ac5adf 100644
--- a/drivers/media/pci/cx23885/cx23885-av.c
+++ b/drivers/media/pci/cx23885/cx23885-av.c
@@ -23,6 +23,7 @@
#include "cx23885.h"
#include "cx23885-av.h"
+#include "cx23885-video.h"
void cx23885_av_work_handler(struct work_struct *work)
{
@@ -32,5 +33,17 @@ void cx23885_av_work_handler(struct work_struct *work)
v4l2_subdev_call(dev->sd_cx25840, core, interrupt_service_routine,
PCI_MSK_AV_CORE, &handled);
+
+ /* Getting here with the interrupt not handled
+ then probbaly flatiron does have pending interrupts.
+ */
+ if (!handled) {
+ /* clear left and right adc channel interrupt request flag */
+ cx23885_flatiron_write(dev, 0x1f,
+ cx23885_flatiron_read(dev, 0x1f) | 0x80);
+ cx23885_flatiron_write(dev, 0x23,
+ cx23885_flatiron_read(dev, 0x23) | 0x80);
+ }
+
cx23885_irq_enable(dev, PCI_MSK_AV_CORE);
}