Commit b4520dcfc6dc976c5304dddb51d7b9043ce138cf
Committed by
Jason Liu
1 parent
69d60faafa
Exists in
smarc_8mm_imx_4.14.98_2.0.0_ga
and in
4 other branches
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> (cherry picked from commit 61869f787fb0ee2f00d0fe9443cb8b487e16e5ec)
Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff
drivers/staging/typec/tcpci.c
... | ... | @@ -860,6 +860,7 @@ |
860 | 860 | if (err) |
861 | 861 | goto err1; |
862 | 862 | |
863 | + irq_set_status_flags(client->irq, IRQ_DISABLE_UNLAZY); | |
863 | 864 | err = devm_request_threaded_irq(tcpci->dev, client->irq, NULL, |
864 | 865 | tcpci_irq, |
865 | 866 | IRQF_ONESHOT | IRQF_TRIGGER_LOW, |
... | ... | @@ -880,6 +881,7 @@ |
880 | 881 | struct tcpci *tcpci = i2c_get_clientdata(client); |
881 | 882 | |
882 | 883 | tcpm_unregister_port(tcpci->port); |
884 | + irq_clear_status_flags(client->irq, IRQ_DISABLE_UNLAZY); | |
883 | 885 | |
884 | 886 | return 0; |
885 | 887 | } |
... | ... | @@ -890,6 +892,8 @@ |
890 | 892 | |
891 | 893 | if (device_may_wakeup(dev)) |
892 | 894 | enable_irq_wake(tcpci->client->irq); |
895 | + else | |
896 | + disable_irq(tcpci->client->irq); | |
893 | 897 | |
894 | 898 | return 0; |
895 | 899 | } |
... | ... | @@ -900,6 +904,8 @@ |
900 | 904 | |
901 | 905 | if (device_may_wakeup(dev)) |
902 | 906 | disable_irq_wake(tcpci->client->irq); |
907 | + else | |
908 | + enable_irq(tcpci->client->irq); | |
903 | 909 | |
904 | 910 | return 0; |
905 | 911 | } |