[RFT][PATCH 2/2] irqchip: vt8500: Support 'rising and falling edge'trigger mode

From: Axel Lin
Date: Mon Jul 08 2013 - 20:33:43 EST


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@xxxxxxxxxx>
---
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



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/