summaryrefslogtreecommitdiff
path: root/drivers/spmi
diff options
context:
space:
mode:
authorAbhijeet Dharmapurikar <adharmap@codeaurora.org>2016-04-19 20:06:46 -0700
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-10 13:20:10 -0700
commit673688e86399f4318fa1772c851dcfadda6b0b4a (patch)
treed4b5defa52eb218cc0008bbc0ffa0982ff9b9bb1 /drivers/spmi
parentd02e7d9235d54c8530f53c66b73354ea59186f54 (diff)
spmi: pmic_arb: use appropriate flow handler
The current code uses handle_level_irq flow handler even if the trigger type of the interrupt is edge. This can lead to missing of an edge transition that happens when the interrupt is being handled. The level flow handler masks the interrupt while it is being handled, so if an edge transition happens at that time, that edge is lost. Use an edge flow handler for edge type interrupts which ensures that the interrupt stays enabled while being handled - at least until it triggers at which point the flow handler sets the IRQF_PENDING flag and only then masks the interrupt. That IRQF_PENDING state indicates an edge transition happened while the interrupt was being handled and the handler is called again. CRs-Fixed: 1001770 Change-Id: Id2554c9e6ed79188fa1b64728be464bda45f07ec Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Diffstat (limited to 'drivers/spmi')
-rw-r--r--drivers/spmi/spmi-pmic-arb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index 2d480f1af11f..89408ef71302 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -629,6 +629,12 @@ static int qpnpint_irq_set_type(struct irq_data *d, unsigned int flow_type)
}
qpnpint_spmi_write(d, QPNPINT_REG_SET_TYPE, &type, sizeof(type));
+
+ if (flow_type & IRQ_TYPE_EDGE_BOTH)
+ irq_set_handler_locked(d, handle_edge_irq);
+ else
+ irq_set_handler_locked(d, handle_level_irq);
+
return 0;
}