diff options
author | Subhash Jadavani <subhashj@codeaurora.org> | 2015-07-10 18:49:16 -0700 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:00:19 -0700 |
commit | ec66dacb420defc1ec96d7b95a11d71453a5677f (patch) | |
tree | b19d67d1b436fca03f68421f667a6e58be838904 /drivers/scsi/ufs | |
parent | 77ec9106c4e39bb1daf8e3b16ea8c0fca7ec4b37 (diff) |
scsi: ufs: core power collapse after clock gating
Currently we power collapse UFS controller core only during runtime suspend
but we could also power collapse it during clock gating as power collapse
latencies are only few microseconds. This change adds this aggressive power
collapse to save power.
Change-Id: Id550bcbcd044670cec08a6abb7225cb9386993b5
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Diffstat (limited to 'drivers/scsi/ufs')
-rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 8568809798c2..7b4955db1225 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -371,6 +371,8 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba); static void ufshcd_resume_clkscaling(struct ufs_hba *hba); static void ufshcd_suspend_clkscaling(struct ufs_hba *hba); static void ufshcd_release_all(struct ufs_hba *hba); +static void ufshcd_hba_vreg_set_lpm(struct ufs_hba *hba); +static void ufshcd_hba_vreg_set_hpm(struct ufs_hba *hba); static inline bool ufshcd_valid_tag(struct ufs_hba *hba, int tag) { @@ -1132,6 +1134,7 @@ static void ufshcd_ungate_work(struct work_struct *work) } spin_unlock_irqrestore(hba->host->host_lock, flags); + ufshcd_hba_vreg_set_hpm(hba); ufshcd_setup_clocks(hba, true); /* Exit from hibern8 */ @@ -1273,6 +1276,9 @@ static void ufshcd_gate_work(struct work_struct *work) /* If link is active, device ref_clk can't be switched off */ __ufshcd_setup_clocks(hba, false, true); + /* Put the host controller in low power mode if possible */ + ufshcd_hba_vreg_set_lpm(hba); + /* * In case you are here to cancel this work the gating state * would be marked as REQ_CLKS_ON. In this case keep the state |