diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2020-09-28 23:51:33 +0800 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2020-09-29 07:47:46 +0800 |
commit | 03a0b976f9c539a8b1202ade584a06a3414f64ae (patch) | |
tree | bd38a0300f703e04c61a05c385373705f6c94664 | |
parent | 133d893c8e05fafc5bb855aa0bba27fea3feb1ac (diff) |
ANDROID: usb: chipidea: abort system suspend in peripheral modelinaro-m5-squid-2020_09_30
For peripheral mode, we get USB disconnect from host PC across system
suspend/resume cycle. This is not desirable for T2 device, which would
rather not suspend in that case. So let's abort system suspend in
peripheral mode.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-rw-r--r-- | drivers/usb/chipidea/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index c47505802220..03938dd7decd 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -1342,6 +1342,10 @@ static int ci_suspend(struct device *dev) { struct ci_hdrc *ci = dev_get_drvdata(dev); + /* Abort suspend in peripheral mode */ + if (ci->role == CI_ROLE_GADGET) + return -EBUSY; + if (ci->wq) flush_workqueue(ci->wq); /* |