diff options
author | Can Guo | 2020-02-11 21:38:29 -0800 |
---|---|---|
committer | Martin K. Petersen | 2020-02-12 19:34:22 -0500 |
commit | 518b32f1ddf5830698f270272d2ca465e788a273 (patch) | |
tree | 61be03f9a1c4104be85b08e49dc847a7ce1cf5b3 /drivers/scsi/ufs/ufs-qcom.c | |
parent | 984eaac133e3d6d993ffd4de9e4bdc2c94de742b (diff) |
scsi: ufs: Select INITIAL ADAPT type for HS Gear4
ADAPT is added specifically for HS Gear4 mode only. Select INITIAL ADAPT
before power mode change to G4 and select NO ADAPT before switch to non-G4
modes.
[mkp: fixed typo in header file]
Link: https://lore.kernel.org/r/1581485910-8307-3-git-send-email-cang@codeaurora.org
Signed-off-by: Can Guo <cang@codeaurora.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs-qcom.c')
-rw-r--r-- | drivers/scsi/ufs/ufs-qcom.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index c2e703d58f63..78849fd097d4 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -896,6 +896,20 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba, if (!ufshcd_is_hs_mode(&hba->pwr_info) && ufshcd_is_hs_mode(dev_req_params)) ufs_qcom_dev_ref_clk_ctrl(host, true); + + if (host->hw_ver.major >= 0x4) { + if (dev_req_params->gear_tx == UFS_HS_G4) { + /* INITIAL ADAPT */ + ufshcd_dme_set(hba, + UIC_ARG_MIB(PA_TXHSADAPTTYPE), + PA_INITIAL_ADAPT); + } else { + /* NO ADAPT */ + ufshcd_dme_set(hba, + UIC_ARG_MIB(PA_TXHSADAPTTYPE), + PA_NO_ADAPT); + } + } break; case POST_CHANGE: if (ufs_qcom_cfg_timers(hba, dev_req_params->gear_rx, |