summaryrefslogtreecommitdiffstats
path: root/drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c
diff options
context:
space:
mode:
authorVivek Gautam <vivek.gautam@codeaurora.org>2017-10-12 08:19:36 +0200
committerKishon Vijay Abraham I <kishon@ti.com>2017-10-23 07:49:27 +0200
commit052553af6a31b459adfdc6fd1eebced75de332fc (patch)
treedf42d5791e9d0f36d53e76790baf99473aacc284 /drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c
parentscsi/ufs: qcom: Set phy mode based on the controllers HS MODE (diff)
downloadlinux-052553af6a31b459adfdc6fd1eebced75de332fc.tar.xz
linux-052553af6a31b459adfdc6fd1eebced75de332fc.zip
ufs/phy: qcom: Refactor to use phy_init call
Refactor ufs_qcom_power_up_sequence() to get rid of ugly exported phy APIs and use the phy_init() and phy_power_on() to do the phy initialization. Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c')
-rw-r--r--drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c b/drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c
index 5c18c41dbdb4..49f435c71147 100644
--- a/drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c
+++ b/drivers/phy/qualcomm/phy-qcom-ufs-qmp-20nm.c
@@ -63,7 +63,19 @@ void ufs_qcom_phy_qmp_20nm_advertise_quirks(struct ufs_qcom_phy *phy_common)
static int ufs_qcom_phy_qmp_20nm_init(struct phy *generic_phy)
{
- return 0;
+ struct ufs_qcom_phy *phy_common = get_ufs_qcom_phy(generic_phy);
+ bool is_rate_B = false;
+ int ret;
+
+ if (phy_common->mode == PHY_MODE_UFS_HS_B)
+ is_rate_B = true;
+
+ ret = ufs_qcom_phy_qmp_20nm_phy_calibrate(phy_common, is_rate_B);
+ if (!ret)
+ /* phy calibrated, but yet to be started */
+ phy_common->is_started = false;
+
+ return ret;
}
static int ufs_qcom_phy_qmp_20nm_exit(struct phy *generic_phy)
@@ -178,7 +190,6 @@ static const struct phy_ops ufs_qcom_phy_qmp_20nm_phy_ops = {
};
static struct ufs_qcom_phy_specific_ops phy_20nm_ops = {
- .calibrate_phy = ufs_qcom_phy_qmp_20nm_phy_calibrate,
.start_serdes = ufs_qcom_phy_qmp_20nm_start_serdes,
.is_physical_coding_sublayer_ready = ufs_qcom_phy_qmp_20nm_is_pcs_ready,
.set_tx_lane_enable = ufs_qcom_phy_qmp_20nm_set_tx_lane_enable,