Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fc201a8 authored by Subhash Jadavani's avatar Subhash Jadavani Committed by Bao D. Nguyen
Browse files

scsi: ufs: UFS device spec version for G4 and low voltage support



UFS HS-G4 and low voltage support features are supported in UFS
device specification version 3.0. To enable these features, driver
is not just checking the specification version but it also reads
the HS-G4 capability. Checking HS-G4 capability is not required so
this change removes the check.

Change-Id: I1e712aeabaa63fb742809a8f9c2dced94a71f5a8
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: default avatarBao D. Nguyen <nguyenb@codeaurora.org>
parent 47938762
Loading
Loading
Loading
Loading
+1 −30
Original line number Diff line number Diff line
@@ -477,7 +477,6 @@ static int ufshcd_config_vreg(struct device *dev,
				struct ufs_vreg *vreg, bool on);
static int ufshcd_enable_vreg(struct device *dev, struct ufs_vreg *vreg);
static int ufshcd_disable_vreg(struct device *dev, struct ufs_vreg *vreg);
static bool ufshcd_is_g4_supported(struct ufs_hba *hba);

#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
static struct devfreq_simple_ondemand_data ufshcd_ondemand_data = {
@@ -8193,7 +8192,7 @@ static int ufshcd_set_low_vcc_level(struct ufs_hba *hba,
	struct ufs_vreg *vreg = hba->vreg_info.vcc;

	/* Check if device supports the low voltage VCC feature */
	if (dev_desc->wspecversion < 0x300 && !ufshcd_is_g4_supported(hba))
	if (dev_desc->wspecversion < 0x300)
		return 0;

	/*
@@ -8728,34 +8727,6 @@ static int ufs_read_device_desc_data(struct ufs_hba *hba)
	return 0;
}

/**
 * ufshcd_is_g4_supported - check if device supports HS-G4
 * @hba: per-adapter instance
 *
 * Returns True if device supports HS-G4, False otherwise.
 */
static bool ufshcd_is_g4_supported(struct ufs_hba *hba)
{
	int ret;
	u32 tx_hsgear = 0;

	/* check device capability */
	ret = ufshcd_dme_peer_get(hba,
			UIC_ARG_MIB_SEL(TX_HSGEAR_CAPABILITY,
			UIC_ARG_MPHY_TX_GEN_SEL_INDEX(0)),
			&tx_hsgear);
	if (ret) {
		dev_err(hba->dev, "%s: Failed getting peer TX_HSGEAR_CAPABILITY. err = %d\n",
			__func__, ret);
		return false;
	}

	if (tx_hsgear == UFS_HS_G4)
		return true;
	else
		return false;
}

/**
 * ufshcd_probe_hba - probe hba to detect device and initialize
 * @hba: per-adapter instance