MLK-17077 staging: typec: clear vbus change event in irq handler
authorLi Jun <jun.li@nxp.com>
Wed, 6 Dec 2017 14:05:31 +0000 (22:05 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:50:26 +0000 (14:50 -0500)
For vbus change event, we need read the vbus status to clear
the alert. Current code do this in queue work, this has problem
on single core running, the queue work of vbus change may have
no chance to be scheduled as we continue receive the vbus change
event in threaded irq.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
drivers/staging/typec/tcpci.c

index 589beeb..530a05b 100644 (file)
@@ -547,6 +547,9 @@ static irqreturn_t tcpci_irq(int irq, void *dev_id)
                tcpm_cc_change(tcpci->port);
 
        if (status & TCPC_ALERT_POWER_STATUS) {
+               /* Read power status to clear the event */
+               regmap_read(tcpci->regmap, TCPC_POWER_STATUS, &reg);
+
                regmap_read(tcpci->regmap, TCPC_POWER_STATUS_MASK, &reg);
 
                /*