aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-04-03 10:26:01 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:56:52 -0400
commitbdf1c98e4205832c07d6dedbfd0ec6eab83df358 (patch)
tree9d3cb7c2d543fc5e90dc334c86e73c1605541d20 /drivers/media/video/saa7134
parent3629e1dadff88d22f35f88d53edbac14fd8931de (diff)
V4L/DVB: saa7134: Add support for both positive and negative edge IRQ
The code that enables IRQ for the Remote Controller on saa7134 is a little messy: it is outside saa7134-input, it checks if RC is GPIO based, and it mixes both serial raw decode with parallel reads from a hardware-based IR decoder. Also, currently, it doesn't allow to trigger both transition edges at GPIO16 and GPIO18 lines. A rework on the code is needed to provide a better way to specify what saa7134-input needs, maybe even moving part of the code from saa7134-core and saa7134-cards into saa7134-input. Yet, as a large rework is happening at RC core, it is better to wait until the core changes stablize, in order to rework saa7134 RC internals.While this don't happen, let's just change the logic a little bit to allow enabling IRQ to be generated on both edge transitions, in order to better support pulse/space raw decoders. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7134')
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 0612fffdd1fe..90f231881297 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -701,10 +701,12 @@ static int saa7134_hw_enable2(struct saa7134_dev *dev)
701 if (dev->has_remote == SAA7134_REMOTE_GPIO && dev->remote) { 701 if (dev->has_remote == SAA7134_REMOTE_GPIO && dev->remote) {
702 if (dev->remote->mask_keydown & 0x10000) 702 if (dev->remote->mask_keydown & 0x10000)
703 irq2_mask |= SAA7134_IRQ2_INTE_GPIO16_N; 703 irq2_mask |= SAA7134_IRQ2_INTE_GPIO16_N;
704 else if (dev->remote->mask_keydown & 0x40000) 704 else { /* Allow enabling both IRQ edge triggers */
705 irq2_mask |= SAA7134_IRQ2_INTE_GPIO18_P; 705 if (dev->remote->mask_keydown & 0x40000)
706 else if (dev->remote->mask_keyup & 0x40000) 706 irq2_mask |= SAA7134_IRQ2_INTE_GPIO18_P;
707 irq2_mask |= SAA7134_IRQ2_INTE_GPIO18_N; 707 if (dev->remote->mask_keyup & 0x40000)
708 irq2_mask |= SAA7134_IRQ2_INTE_GPIO18_N;
709 }
708 } 710 }
709 711
710 if (dev->has_remote == SAA7134_REMOTE_I2C) { 712 if (dev->has_remote == SAA7134_REMOTE_I2C) {