scsi: ufs-qcom: Add flag to keep track of PHY's power state
Add a flag to keep track of the UFS PHY's power state.
This flag is used to prevent the phy_power_on() and phy_power_off()
functions from being called multiple times consecutively.
Each time the phy_power_on() is called, a reference count maintained
in the PHY driver is incremented by 1. In the same manner, each time
phy_power_off() is called, this reference count is decremented by 1.
The PHY resources can only be turned off by the PHY driver if this
reference count being 1 when the phy_power_off() is called indicating
this is the last client using the PHY resources. Therefore, to ensure
that the UFS PHY resources can be turned off in case of UFS
clock gate/ungate and suspend/resume scenarios, the UFS driver needs
to keep track of the PHY power state and avoids any extra
phy_power_on() calls.
Change-Id: Ia4af2fbb1d23028692f91f7df4f2eab6947bad4d
Signed-off-by:
Bao D. Nguyen <nguyenb@codeaurora.org>
Loading
Please register or sign in to comment