summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorLi Jun <jun.li@nxp.com>2019-04-03 15:24:03 +0800
committerPeter Chen <peter.chen@nxp.com>2019-04-04 14:37:17 +0800
commit61869f787fb0ee2f00d0fe9443cb8b487e16e5ec (patch)
tree46cc008f0ee62707549342d425907ae725d01da0 /drivers/staging
parent270d4df94b7c2c773a171fe012fb8ce89196964f (diff)
MLK-21368 staging: typec: tcpci: disable irq when system suspend
Disable typec irq when suspend to avoid the threaded irq to access some resource(e.g. i2c over rpmsg) but those resource is not available at later phrase, also use IRQ_DISABLE_UNLAZY flag to mask the irq on irq chip level when irq happens. Suggested-by: Anson Huang <anson.huang@nxp.com> Acked-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Li Jun <jun.li@nxp.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/typec/tcpci.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c
index 0bd9a2e55c0f..f4ae8f55992a 100644
--- a/drivers/staging/typec/tcpci.c
+++ b/drivers/staging/typec/tcpci.c
@@ -860,6 +860,7 @@ static int tcpci_probe(struct i2c_client *client,
if (err)
goto err1;
+ irq_set_status_flags(client->irq, IRQ_DISABLE_UNLAZY);
err = devm_request_threaded_irq(tcpci->dev, client->irq, NULL,
tcpci_irq,
IRQF_ONESHOT | IRQF_TRIGGER_LOW,
@@ -880,6 +881,7 @@ static int tcpci_remove(struct i2c_client *client)
struct tcpci *tcpci = i2c_get_clientdata(client);
tcpm_unregister_port(tcpci->port);
+ irq_clear_status_flags(client->irq, IRQ_DISABLE_UNLAZY);
return 0;
}
@@ -890,6 +892,8 @@ static int tcpci_suspend(struct device *dev)
if (device_may_wakeup(dev))
enable_irq_wake(tcpci->client->irq);
+ else
+ disable_irq(tcpci->client->irq);
return 0;
}
@@ -900,6 +904,8 @@ static int tcpci_resume(struct device *dev)
if (device_may_wakeup(dev))
disable_irq_wake(tcpci->client->irq);
+ else
+ enable_irq(tcpci->client->irq);
return 0;
}