usb: mtu3: fix failed runtime suspend in host only mode
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Thu, 29 Sep 2022 06:44:59 +0000 (14:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:35:19 +0000 (12:35 +0200)
commitfaabbb103d604e52bb5b0591b4fe86e349856131
tree94c14bb9ac231858e8ca71ee436d1aa85c524986
parent57f66534a41a75f0ab12250030827777cb38f8aa
usb: mtu3: fix failed runtime suspend in host only mode

[ Upstream commit 1c703e29da5efac6180e4c189029fa34b7e48e97 ]

When the dr_mode is "host", after the host enter runtime suspend,
the mtu3 can't do it, because the mtu3's device wakeup function is
not enabled, instead it's enabled in gadget init function, to fix
the issue, init wakeup early in mtu3's probe()

Fixes: 6b587394c65c ("usb: mtu3: support suspend/resume for dual-role mode")
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reported-by: Tianping Fang <tianping.fang@mediatek.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20220929064459.32522-1-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/mtu3/mtu3_core.c
drivers/usb/mtu3/mtu3_plat.c