phy: usb: Improve port mode selection
authorJustin Chen <justinpopo6@gmail.com>
Wed, 5 Oct 2022 21:30:13 +0000 (14:30 -0700)
committerVinod Koul <vkoul@kernel.org>
Sat, 5 Nov 2022 07:42:55 +0000 (13:12 +0530)
commit32fb07f35675c4c3311ae370471ee1ae6cc3e694
treee97719220dfbe0b81c19db682b44f44130f9d250
parentc0a6c25283672facaa57cb3daad71c6586736312
phy: usb: Improve port mode selection

Split port modes into two different variables. Supported port modes
is what the hardware supports. While port mode is how the hardware
is currently configured and can be dynamically changed through the
sysfs. We initialize all supported port modes on init even though
the port mode may not be selected because we cannot guarantee the
downstream interface from the phy will be active or not.

This also fixes an issue where port modes selected via sysfs were
not being saved through suspend/resume.

Signed-off-by: Justin Chen <justinpopo6@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/1665005418-15807-2-git-send-email-justinpopo6@gmail.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.c
drivers/phy/broadcom/phy-brcm-usb-init.h
drivers/phy/broadcom/phy-brcm-usb.c