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

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

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: default avatarJack Pham <jackp@codeaurora.org>
parent 61a09d4a
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