Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit fc017bf3 authored by Jack Pham's avatar Jack Pham
Browse files

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: default avatarJack Pham <jackp@codeaurora.org>
parent 3fd4f55f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment