usb: phy: msm: Handle multiport suspend/resume
On some platforms the SSPHY and HSPHY are actually shared
multi-port PHYs that are paired with separate DWC3 controllers.
In this case suspending into low power mode must not be allowed
unless all instances are suspended. Add reference counting to
keep track of when all ports have suspended before allowing PHY
to be placed in low power mode.
The approaches used for the SS versus the HS PHY are slightly
different, so the reference counting semantics differ as follows:
- The HS PHY instances can be operated more or less indepedently,
as each port has its own set of QSCRATCH registers. The only
exception is the PHY reset, which is managed by the primary
instance. So the reference counter is added as a static global
to keep track across multiple instances of when to allow reset.
- The SS PHY instances can share a single device driver instance,
as only the primary controller QSCRATCH registers are useful.
Both controllers can then share the same PHY device, so reference
counting is added within the instance structure and is used to
prevent powering off the PHY until all instances have called
set_suspend(0).
Change-Id: Ia5a03ff711d60da84bec8bd9086b70c386de0b93
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment