scsi: ufs-qcom: Refactor phy_power_on/off calls
Commit 052553af ("ufs/phy: qcom: Refactor to use phy_init call") puts enabling regulators & clks, calibrating UFS PHY, starting serdes and polling PCS ready status into phy_power_on. Due to UFS PHY's registers are retained after power collapse, so calibrating UFS PHY, starting serdes and polling PCS ready status need to be done only when start hba, but not needed every time when phy_power_on is called during resume. Keep the codes which enables PHY's regulators & clks in phy_power_on but move the rest steps into PHY's general calibration func, namely phy_calibrate. Commit 3f6d1767 ("phy: ufs-qcom: Refactor all init steps into phy_poweron") removes the phy_power_on/off from ufs_qcom_setup_clocks. To have a better power saving, remove the phy_power_on/off calls from resume/suspend path and put them back to ufs_qcom_setup_clocks, so that PHY's regulators & clks can be turned on/off along with UFS's clocks. At last, add a mutex lock to protect the usage of is_phy_pwr_on against possible racing. Change-Id: I1ed5d5d6968c3f16018e9723eab010ea7ed798b2 Signed-off-by:Can Guo <cang@codeaurora.org>
Loading
Please register or sign in to comment