lkml.org 
[lkml]   [2013]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[RFT][PATCH 2/2] irqchip: vt8500: Support 'rising and falling edge' trigger mode
From
Date
This chip supports below interrupt request trigger mode:

Destination Control Register:
BIT[5:4] Interrupt Request Trigger Mode.
00: High level trigger
01: Posedge trigger
10: Negedge trigger
11: Both posedge and negedge trigger

This patch adds support for setting 'posedge and negedge trigger' mode.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Current code does not correctly handle the case if a driver request irq with
"IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING" flag.
I'm not sure if we have such use case in current code.

drivers/irqchip/irq-vt8500.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/irqchip/irq-vt8500.c b/drivers/irqchip/irq-vt8500.c
index eb6d05a..e040994 100644
--- a/drivers/irqchip/irq-vt8500.c
+++ b/drivers/irqchip/irq-vt8500.c
@@ -136,6 +136,10 @@ static int vt8500_irq_set_type(struct irq_data *d, unsigned int flow_type)
dctr |= VT8500_TRIGGER_RISING;
__irq_set_handler_locked(d->irq, handle_edge_irq);
break;
+ case IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING:
+ dctr |= VT8500_EDGE;
+ __irq_set_handler_locked(d->irq, handle_edge_irq);
+ break;
}
writeb(dctr, base + VT8500_ICDC + d->hwirq);

--
1.8.1.2




\
 
 \ /
  Last update: 2013-07-10 23:24    [W:0.042 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site