summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2022-01-28 13:41:32 +0530
committerTom Rini <trini@konsulko.com>2022-02-08 11:00:03 -0500
commitc1c1b345b1bd06328c9f16225ebbceb6f165bbb2 (patch)
treed27b13fa3751ef14071b9147ff72098baa1a4e66 /drivers/phy
parenta9382b07d0962a4826b069bde92407e71dc79253 (diff)
downloadu-boot-c1c1b345b1bd06328c9f16225ebbceb6f165bbb2.tar.gz
u-boot-c1c1b345b1bd06328c9f16225ebbceb6f165bbb2.tar.bz2
u-boot-c1c1b345b1bd06328c9f16225ebbceb6f165bbb2.zip
phy: cadence: Sierra: Move all reset_control_get*() to a separate function
No functional change. Group devm_reset_control_get() and devm_reset_control_get_optional() to a separate function. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/cadence/phy-cadence-sierra.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c
index d07cf1d97d..eaa32939c1 100644
--- a/drivers/phy/cadence/phy-cadence-sierra.c
+++ b/drivers/phy/cadence/phy-cadence-sierra.c
@@ -480,6 +480,21 @@ static int cdns_sierra_phy_get_clocks(struct cdns_sierra_phy *sp,
return 0;
}
+static int cdns_sierra_phy_get_resets(struct cdns_sierra_phy *sp,
+ struct udevice *dev)
+{
+ struct reset_control *rst;
+
+ rst = devm_reset_control_get(dev, "sierra_reset");
+ if (IS_ERR(rst)) {
+ dev_err(dev, "failed to get reset\n");
+ return PTR_ERR(rst);
+ }
+ sp->phy_rst = rst;
+
+ return 0;
+}
+
static int cdns_sierra_phy_probe(struct udevice *dev)
{
struct cdns_sierra_phy *sp = dev_get_priv(dev);
@@ -520,6 +535,10 @@ static int cdns_sierra_phy_probe(struct udevice *dev)
return PTR_ERR(sp->phy_rst);
}
+ ret = cdns_sierra_phy_get_resets(sp, dev);
+ if (ret)
+ return ret;
+
ret = clk_prepare_enable(sp->clk);
if (ret)
return ret;