phy: usb: Turn off phy when port is in suspend
authorJustin Chen <justin.chen@broadcom.com>
Thu, 15 Jun 2023 20:06:16 +0000 (13:06 -0700)
committerVinod Koul <vkoul@kernel.org>
Wed, 21 Jun 2023 12:13:27 +0000 (17:43 +0530)
commit5095d045a96235687199015ca94a03c00d68234f
treeab10e67707dc28b7655bd731ac180fe98e2051a8
parentc0c2fcb1325d0d4f3b322b5ee49385f8eca2560d
phy: usb: Turn off phy when port is in suspend

The COMMONONN bit turns off the PHY when the host controller puts it
into suspend state. This can happen during the following...
- Nothing is connected to the port
- The host controller goes into low power mode whatever due to auto
  suspend or system suspend.

With COMMONONN we also must unset U2_FREECLK_EXISTS since the UTMI
clock is fed by the PHY.

With these changes we see a power savings of ~12mW when port is in
suspend.

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Justin Chen <justin.chen@broadcom.com>
Link: https://lore.kernel.org/r/1686859578-45242-2-git-send-email-justin.chen@broadcom.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c
drivers/phy/broadcom/phy-brcm-usb-init.h