phy: usb: Leave some clocks running during suspend
authorAl Cooper <alcooperx@gmail.com>
Wed, 1 Dec 2021 18:06:51 +0000 (13:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Feb 2022 11:01:05 +0000 (12:01 +0100)
commit98bc06c46d1fc9ff86c39e59cd559c2cc8c3228b
treeeaa3a5fddcb7d3e0912580deb6c1613320f99a3f
parent717f2fa858228b2bd2ffb7aad3c68b55828d4092
phy: usb: Leave some clocks running during suspend

[ Upstream commit 42fed57046fc74586d7058bd51a1c10ac9c690cb ]

The PHY client driver does a phy_exit() call on suspend or rmmod and
the PHY driver needs to know the difference because some clocks need
to be kept running for suspend but can be shutdown on unbind/rmmod
(or if there are no PHY clients at all).

The fix is to use a PM notifier so the driver can tell if a PHY
client is calling exit() because of a system suspend or a driver
unbind/rmmod.

Signed-off-by: Al Cooper <alcooperx@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20211201180653.35097-2-alcooperx@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/phy/broadcom/phy-brcm-usb.c