scsi: ufshcd: Properly set the device Icc Level

UFS version 3.0 and later devices use Vcc and Vccq regulators
while UFS version 2.0 and 2.1 devices use Vcc and Vccq2 .
Properly set the device's supported Icc level for the
regulators used by the device.

Change-Id: I3e657d6167976706d69a582b3983df794102e3af
Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
This commit is contained in:
Bao D. Nguyen 2020-06-18 13:20:30 -07:00
commit ac11399e77
2 changed files with 6 additions and 3 deletions

View file

@ -7613,7 +7613,9 @@ static u32 ufshcd_find_max_sup_active_icc_level(struct ufs_hba *hba,
* vendors don't use this rail for embedded UFS devices as well. So
* it is normal that VCCQ rail may not be provided for given platform.
*/
if (!hba->vreg_info.vcc || !hba->vreg_info.vccq2) {
if (!hba->vreg_info.vcc ||
(!hba->vreg_info.vccq && hba->dev_info.wspecversion >= 0x300) ||
(!hba->vreg_info.vccq2 && hba->dev_info.wspecversion < 0x300)) {
dev_err(hba->dev, "%s: Regulator capability was not set, bActiveICCLevel=%d\n",
__func__, icc_level);
goto out;

View file

@ -6636,8 +6636,9 @@ static u32 ufshcd_find_max_sup_active_icc_level(struct ufs_hba *hba,
{
u32 icc_level = 0;
if (!hba->vreg_info.vcc || !hba->vreg_info.vccq ||
!hba->vreg_info.vccq2) {
if (!hba->vreg_info.vcc ||
(!hba->vreg_info.vccq && hba->dev_info.wspecversion >= 0x300) ||
(!hba->vreg_info.vccq2 && hba->dev_info.wspecversion < 0x300)) {
dev_err(hba->dev,
"%s: Regulator capability was not set, actvIccLevel=%d",
__func__, icc_level);