summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ufs/ufs-qcom.c
diff options
context:
space:
mode:
authorYaniv Gardi <ygardi@codeaurora.org>2015-03-31 17:37:13 +0300
committerJames Bottomley <JBottomley@Odin.com>2015-04-10 08:52:58 -0700
commitbfdbe8ba21291c024afcec95b7bd515b5bf69689 (patch)
tree6193eececc213269af26b7f66135f95e4ac8375b /drivers/scsi/ufs/ufs-qcom.c
parenta776e39416cc4580b5a1688c3e44258888955996 (diff)
downloadlinux-bfdbe8ba21291c024afcec95b7bd515b5bf69689.tar.gz
linux-bfdbe8ba21291c024afcec95b7bd515b5bf69689.tar.bz2
linux-bfdbe8ba21291c024afcec95b7bd515b5bf69689.zip
ufs-qcom: save controller revision info in internal structure
Sometimes, specific information about the UFS controller revision is required in order to determine certain operations or execute controller dependent quirks. In order to avoid reading the controller revision multiple times, we simply read it once and save this information in internal structure. Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs-qcom.c')
-rw-r--r--drivers/scsi/ufs/ufs-qcom.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index 9217af9bf734..d7cb8435b697 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -214,8 +214,6 @@ static int ufs_qcom_power_up_sequence(struct ufs_hba *hba)
struct ufs_qcom_host *host = hba->priv;
struct phy *phy = host->generic_phy;
int ret = 0;
- u8 major;
- u16 minor, step;
bool is_rate_B = (UFS_QCOM_LIMIT_HS_RATE == PA_HS_MODE_B)
? true : false;
@@ -224,8 +222,6 @@ static int ufs_qcom_power_up_sequence(struct ufs_hba *hba)
/* provide 1ms delay to let the reset pulse propagate */
usleep_range(1000, 1100);
- ufs_qcom_get_controller_revision(hba, &major, &minor, &step);
- ufs_qcom_phy_save_controller_version(phy, major, minor, step);
ret = ufs_qcom_phy_calibrate_phy(phy, is_rate_B);
if (ret) {
dev_err(hba->dev, "%s: ufs_qcom_phy_calibrate_phy() failed, ret = %d\n",
@@ -698,10 +694,7 @@ out:
*/
static void ufs_qcom_advertise_quirks(struct ufs_hba *hba)
{
- u8 major;
- u16 minor, step;
- ufs_qcom_get_controller_revision(hba, &major, &minor, &step);
/*
* TBD
@@ -929,6 +922,13 @@ static int ufs_qcom_init(struct ufs_hba *hba)
if (err)
goto out_host_free;
+ ufs_qcom_get_controller_revision(hba, &host->hw_ver.major,
+ &host->hw_ver.minor, &host->hw_ver.step);
+
+ /* update phy revision information before calling phy_init() */
+ ufs_qcom_phy_save_controller_version(host->generic_phy,
+ host->hw_ver.major, host->hw_ver.minor, host->hw_ver.step);
+
phy_init(host->generic_phy);
err = phy_power_on(host->generic_phy);
if (err)