From cab11920a90103ade8b4cb0f83d046753514e80f Mon Sep 17 00:00:00 2001 From: Yaniv Gardi Date: Wed, 8 Jul 2015 16:47:50 +0300 Subject: [PATCH] phy: qcom-ufs: remove hard-coded vdda-phy voltage definition This patch removes the hard-coded voltage number of vdda-phy regulator and instead, gets it by using the appropriate API. Change-Id: Iab753c7e94424dd3ccce95296258bba264979cf2 Signed-off-by: Yaniv Gardi --- drivers/phy/phy-qcom-ufs-qmp-14nm.c | 3 --- drivers/phy/phy-qcom-ufs.c | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/phy/phy-qcom-ufs-qmp-14nm.c b/drivers/phy/phy-qcom-ufs-qmp-14nm.c index 132a1f1f6be7..a1922045c948 100644 --- a/drivers/phy/phy-qcom-ufs-qmp-14nm.c +++ b/drivers/phy/phy-qcom-ufs-qmp-14nm.c @@ -15,7 +15,6 @@ #include "phy-qcom-ufs-qmp-14nm.h" #define UFS_PHY_NAME "ufs_phy_qmp_14nm" -#define UFS_PHY_VDDA_PHY_UV (925000) static int ufs_qcom_phy_qmp_14nm_phy_calibrate(struct ufs_qcom_phy *ufs_qcom_phy, @@ -94,8 +93,6 @@ static int ufs_qcom_phy_qmp_14nm_init(struct phy *generic_phy) __func__, err); goto out; } - phy_common->vdda_phy.max_uV = UFS_PHY_VDDA_PHY_UV; - phy_common->vdda_phy.min_uV = UFS_PHY_VDDA_PHY_UV; ufs_qcom_phy_qmp_14nm_advertise_quirks(phy_common); diff --git a/drivers/phy/phy-qcom-ufs.c b/drivers/phy/phy-qcom-ufs.c index 33fa3727b850..f8c4fd819d2c 100644 --- a/drivers/phy/phy-qcom-ufs.c +++ b/drivers/phy/phy-qcom-ufs.c @@ -239,6 +239,7 @@ ufs_qcom_phy_init_vregulators(struct phy *generic_phy, struct ufs_qcom_phy *phy_common) { int err; + int vdda_phy_uV; err = ufs_qcom_phy_init_vreg(generic_phy, &phy_common->vdda_pll, "vdda-pll"); @@ -247,10 +248,13 @@ ufs_qcom_phy_init_vregulators(struct phy *generic_phy, err = ufs_qcom_phy_init_vreg(generic_phy, &phy_common->vdda_phy, "vdda-phy"); - if (err) goto out; + vdda_phy_uV = regulator_get_voltage(phy_common->vdda_phy.reg); + phy_common->vdda_phy.max_uV = vdda_phy_uV; + phy_common->vdda_phy.min_uV = vdda_phy_uV; + /* vddp-ref-clk-* properties are optional */ __ufs_qcom_phy_init_vreg(generic_phy, &phy_common->vddp_ref_clk, "vddp-ref-clk", true);