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:03:17 +0000 (12:03 +0100)
commit6a469cf7f3729f74039b2c1d121c8143d41ce62d
treea181d3d93ee60611f23264de02b4e24310b0d544
parent9492e1e53e7d71a52bdb4433bb9f646299f75bb1
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