Commit 3d4640f1 authored by Vivek Gautam's avatar Vivek Gautam Committed by Martin K. Petersen

phy: qcom-ufs: Remove common layer phy exit callback

The common layer phy exit callback ufs_qcom_phy_exit()
calls phy_power_off() that has no meaning when phy_power_off()
callback is already registered with the phy provider and
the consumer makes use of the same.
Instead, add a no-op specific phy_exit() callback for now
to add the exit sequence at a later point.
Signed-off-by: default avatarVivek Gautam <vivek.gautam@codeaurora.org>
Reviewed-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent feb3d798
...@@ -141,7 +141,6 @@ struct ufs_qcom_phy_specific_ops { ...@@ -141,7 +141,6 @@ struct ufs_qcom_phy_specific_ops {
struct ufs_qcom_phy *get_ufs_qcom_phy(struct phy *generic_phy); struct ufs_qcom_phy *get_ufs_qcom_phy(struct phy *generic_phy);
int ufs_qcom_phy_power_on(struct phy *generic_phy); int ufs_qcom_phy_power_on(struct phy *generic_phy);
int ufs_qcom_phy_power_off(struct phy *generic_phy); int ufs_qcom_phy_power_off(struct phy *generic_phy);
int ufs_qcom_phy_exit(struct phy *generic_phy);
int ufs_qcom_phy_init_clks(struct ufs_qcom_phy *phy_common); int ufs_qcom_phy_init_clks(struct ufs_qcom_phy *phy_common);
int ufs_qcom_phy_init_vregulators(struct ufs_qcom_phy *phy_common); int ufs_qcom_phy_init_vregulators(struct ufs_qcom_phy *phy_common);
int ufs_qcom_phy_remove(struct phy *generic_phy, int ufs_qcom_phy_remove(struct phy *generic_phy,
......
...@@ -47,6 +47,11 @@ static int ufs_qcom_phy_qmp_14nm_init(struct phy *generic_phy) ...@@ -47,6 +47,11 @@ static int ufs_qcom_phy_qmp_14nm_init(struct phy *generic_phy)
return 0; return 0;
} }
static int ufs_qcom_phy_qmp_14nm_exit(struct phy *generic_phy)
{
return 0;
}
static static
void ufs_qcom_phy_qmp_14nm_power_control(struct ufs_qcom_phy *phy, bool val) void ufs_qcom_phy_qmp_14nm_power_control(struct ufs_qcom_phy *phy, bool val)
{ {
...@@ -94,7 +99,7 @@ static int ufs_qcom_phy_qmp_14nm_is_pcs_ready(struct ufs_qcom_phy *phy_common) ...@@ -94,7 +99,7 @@ static int ufs_qcom_phy_qmp_14nm_is_pcs_ready(struct ufs_qcom_phy *phy_common)
static const struct phy_ops ufs_qcom_phy_qmp_14nm_phy_ops = { static const struct phy_ops ufs_qcom_phy_qmp_14nm_phy_ops = {
.init = ufs_qcom_phy_qmp_14nm_init, .init = ufs_qcom_phy_qmp_14nm_init,
.exit = ufs_qcom_phy_exit, .exit = ufs_qcom_phy_qmp_14nm_exit,
.power_on = ufs_qcom_phy_power_on, .power_on = ufs_qcom_phy_power_on,
.power_off = ufs_qcom_phy_power_off, .power_off = ufs_qcom_phy_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -66,6 +66,11 @@ static int ufs_qcom_phy_qmp_20nm_init(struct phy *generic_phy) ...@@ -66,6 +66,11 @@ static int ufs_qcom_phy_qmp_20nm_init(struct phy *generic_phy)
return 0; return 0;
} }
static int ufs_qcom_phy_qmp_20nm_exit(struct phy *generic_phy)
{
return 0;
}
static static
void ufs_qcom_phy_qmp_20nm_power_control(struct ufs_qcom_phy *phy, bool val) void ufs_qcom_phy_qmp_20nm_power_control(struct ufs_qcom_phy *phy, bool val)
{ {
...@@ -152,7 +157,7 @@ static int ufs_qcom_phy_qmp_20nm_is_pcs_ready(struct ufs_qcom_phy *phy_common) ...@@ -152,7 +157,7 @@ static int ufs_qcom_phy_qmp_20nm_is_pcs_ready(struct ufs_qcom_phy *phy_common)
static const struct phy_ops ufs_qcom_phy_qmp_20nm_phy_ops = { static const struct phy_ops ufs_qcom_phy_qmp_20nm_phy_ops = {
.init = ufs_qcom_phy_qmp_20nm_init, .init = ufs_qcom_phy_qmp_20nm_init,
.exit = ufs_qcom_phy_exit, .exit = ufs_qcom_phy_qmp_20nm_exit,
.power_on = ufs_qcom_phy_power_on, .power_on = ufs_qcom_phy_power_on,
.power_off = ufs_qcom_phy_power_off, .power_off = ufs_qcom_phy_power_off,
.owner = THIS_MODULE, .owner = THIS_MODULE,
......
...@@ -602,17 +602,6 @@ int ufs_qcom_phy_calibrate_phy(struct phy *generic_phy, bool is_rate_B) ...@@ -602,17 +602,6 @@ int ufs_qcom_phy_calibrate_phy(struct phy *generic_phy, bool is_rate_B)
} }
EXPORT_SYMBOL_GPL(ufs_qcom_phy_calibrate_phy); EXPORT_SYMBOL_GPL(ufs_qcom_phy_calibrate_phy);
int ufs_qcom_phy_exit(struct phy *generic_phy)
{
struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(generic_phy);
if (ufs_qcom_phy->is_powered_on)
phy_power_off(generic_phy);
return 0;
}
EXPORT_SYMBOL_GPL(ufs_qcom_phy_exit);
int ufs_qcom_phy_is_pcs_ready(struct phy *generic_phy) int ufs_qcom_phy_is_pcs_ready(struct phy *generic_phy)
{ {
struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(generic_phy); struct ufs_qcom_phy *ufs_qcom_phy = get_ufs_qcom_phy(generic_phy);
...@@ -634,6 +623,9 @@ int ufs_qcom_phy_power_on(struct phy *generic_phy) ...@@ -634,6 +623,9 @@ int ufs_qcom_phy_power_on(struct phy *generic_phy)
struct device *dev = phy_common->dev; struct device *dev = phy_common->dev;
int err; int err;
if (phy_common->is_powered_on)
return 0;
err = ufs_qcom_phy_enable_vreg(dev, &phy_common->vdda_phy); err = ufs_qcom_phy_enable_vreg(dev, &phy_common->vdda_phy);
if (err) { if (err) {
dev_err(dev, "%s enable vdda_phy failed, err=%d\n", dev_err(dev, "%s enable vdda_phy failed, err=%d\n",
...@@ -696,6 +688,9 @@ int ufs_qcom_phy_power_off(struct phy *generic_phy) ...@@ -696,6 +688,9 @@ int ufs_qcom_phy_power_off(struct phy *generic_phy)
{ {
struct ufs_qcom_phy *phy_common = get_ufs_qcom_phy(generic_phy); struct ufs_qcom_phy *phy_common = get_ufs_qcom_phy(generic_phy);
if (!phy_common->is_powered_on)
return 0;
phy_common->phy_spec_ops->power_control(phy_common, false); phy_common->phy_spec_ops->power_control(phy_common, false);
if (phy_common->vddp_ref_clk.reg) if (phy_common->vddp_ref_clk.reg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment