diff options
author | Yaniv Gardi <ygardi@codeaurora.org> | 2015-02-03 15:47:08 +0200 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 10:58:45 -0700 |
commit | fac1cf559def03c510727353ec0b427eca44ff18 (patch) | |
tree | ecec2ebe4e9234899486451c1c27415aae071fdb /drivers/phy | |
parent | da7f098c895d1f612f308b25d38acadb492a058a (diff) |
phy: qcom-ufs: move decision of rate B calibration to ufs driver
Until now, the decision if phy calibration is according to rate A or
rate B values, was done in the phy driver. It made the phy dependent on
the ufs unipro which is unnecessary binding.
This change moves the decision into the ufs driver, and pass it through
a function parameter to the calibration routine in the phy driver.
Change-Id: I7a51d84142c31da57ba5de6ec98526e5c7d1b544
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
[venkatg@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
Diffstat (limited to 'drivers/phy')
-rw-r--r-- | drivers/phy/phy-qcom-ufs-qmp-20nm.c | 6 | ||||
-rw-r--r-- | drivers/phy/phy-qcom-ufs.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/phy/phy-qcom-ufs-qmp-20nm.c b/drivers/phy/phy-qcom-ufs-qmp-20nm.c index 65612c5187d3..c948f206282b 100644 --- a/drivers/phy/phy-qcom-ufs-qmp-20nm.c +++ b/drivers/phy/phy-qcom-ufs-qmp-20nm.c @@ -17,11 +17,11 @@ #define UFS_PHY_NAME "ufs_phy_qmp_20nm" static -int ufs_qcom_phy_qmp_20nm_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy) +int ufs_qcom_phy_qmp_20nm_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy, + bool is_rate_B) { struct ufs_qcom_phy_calibration *tbl_A, *tbl_B; int tbl_size_A, tbl_size_B; - int rate = UFS_QCOM_LIMIT_HS_RATE; int err; tbl_size_A = ARRAY_SIZE(phy_cal_table_rate_A); @@ -31,7 +31,7 @@ int ufs_qcom_phy_qmp_20nm_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy) tbl_B = phy_cal_table_rate_B; err = ufs_qcom_phy_calibrate(ufs_qcom_phy, tbl_A, tbl_size_A, - tbl_B, tbl_size_B, rate); + tbl_B, tbl_size_B, is_rate_B); if (err) dev_err(ufs_qcom_phy->dev, "%s: ufs_qcom_phy_calibrate() failed %d\n", diff --git a/drivers/phy/phy-qcom-ufs.c b/drivers/phy/phy-qcom-ufs.c index 8e93bf22fe68..a8a45dd09036 100644 --- a/drivers/phy/phy-qcom-ufs.c +++ b/drivers/phy/phy-qcom-ufs.c @@ -33,7 +33,7 @@ int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy, struct ufs_qcom_phy_calibration *tbl_A, int tbl_size_A, struct ufs_qcom_phy_calibration *tbl_B, - int tbl_size_B, int rate) + int tbl_size_B, bool is_rate_B) { int i; int ret = 0; @@ -54,7 +54,7 @@ int ufs_qcom_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy, * with registers of rate B table. * table. */ - if (rate == PA_HS_MODE_B) { + if (is_rate_B) { if (!tbl_B) { dev_err(ufs_qcom_phy->dev, "%s: tbl_B is NULL", __func__); @@ -543,7 +543,7 @@ void ufs_qcom_phy_save_controller_version(struct phy *generic_phy, ufs_qcom_phy->host_ctrl_rev_step = step; } -int ufs_qcom_phy_calibrate_phy(struct phy *generic_phy) +int ufs_qcom_phy_calibrate_phy(struct phy *generic_phy, bool is_rate_B) { struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(generic_phy); int ret = 0; @@ -554,7 +554,7 @@ int ufs_qcom_phy_calibrate_phy(struct phy *generic_phy) ret = -ENOTSUPP; } else { ret = ufs_qcom_phy->phy_spec_ops-> - calibrate_phy(ufs_qcom_phy); + calibrate_phy(ufs_qcom_phy, is_rate_B); if (ret) dev_err(ufs_qcom_phy->dev, "%s: calibrate_phy() failed %d\n", __func__, ret); |