usb: phy-msm: Don't allow multiple set_suspend() calls
During USB controller initialization usb_phy_set_suspend(0) is
called to place the PHYs in active mode even though they might
already be after probing. This results in regulator_enable()
being called multiple times. Since the regulator framework
uses reference-counting semantics, a later regulator_disable()
won't fully decrement the ref count, thereby leaving the regulators
still enabled when entering low-power mode. Similarly in the resume
case the regulators could be left disabled if suspend was called
multiple times but resume was called only once.
Fix this by adding a variable to keep track of the PHY suspended
state, so that the operation can be no-op'ed if previously called.
Change-Id: I510d4a7383c919e9b44ea1fb58dcb937047c5c44
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment