summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJulien Stephan <[email protected]>2026-03-18 17:50:55 +0100
committerDavid Lechner <[email protected]>2026-04-17 17:05:54 -0500
commitad2422cc050572965f06ce9fec670a1cb3c5d170 (patch)
tree4866a5863237549992b8fe0cb3718da46c693fbc /drivers
parent51cf6ad9659ab3695b83914068d5bb31296025c5 (diff)
drivers: phy: phy-mtk-ufs: use clk_bulk functions
simply the driver by using clk_bulk functions Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Julien Stephan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: David Lechner <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/phy/phy-mtk-ufs.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/drivers/phy/phy-mtk-ufs.c b/drivers/phy/phy-mtk-ufs.c
index 321151172d9..c7a671ebfad 100644
--- a/drivers/phy/phy-mtk-ufs.c
+++ b/drivers/phy/phy-mtk-ufs.c
@@ -40,8 +40,7 @@ struct mtk_ufs_phy {
struct udevice *dev;
void __iomem *mmio;
- struct clk *unipro_clk;
- struct clk *mp_clk;
+ struct clk_bulk clk_bulk;
};
static void ufs_mtk_phy_set_active(struct mtk_ufs_phy *phy)
@@ -78,16 +77,9 @@ static int mtk_phy_power_on(struct phy *phy)
struct mtk_ufs_phy *ufs_phy = dev_get_priv(phy->dev);
int ret;
- ret = clk_enable(ufs_phy->mp_clk);
- if (ret < 0) {
- dev_err(phy->dev, "failed to enable mp_clk\n");
- return ret;
- }
-
- ret = clk_enable(ufs_phy->unipro_clk);
- if (ret < 0) {
- dev_err(phy->dev, "failed to enable unipro_clk %d\n", ret);
- clk_disable(ufs_phy->unipro_clk);
+ ret = clk_enable_bulk(&ufs_phy->clk_bulk);
+ if (ret) {
+ dev_err(phy->dev, "failed to enable clocks (ret=%d)\n", ret);
return ret;
}
@@ -148,21 +140,11 @@ static int mtk_ufs_phy_probe(struct udevice *dev)
phy->dev = dev;
phy->mmio = map_sysmem(addr, 0);
- phy->mp_clk = devm_clk_get(dev, "mp");
- if (IS_ERR(phy->mp_clk)) {
- ret = PTR_ERR(phy->mp_clk);
- dev_err(dev, "Failed to get mp clock (ret=%d)\n", ret);
- return ret;
- }
+ ret = clk_get_bulk(dev, &phy->clk_bulk);
+ if (ret)
+ dev_err(dev, "Failed to get clocks (ret=%d)\n", ret);
- phy->unipro_clk = devm_clk_get(dev, "unipro");
- if (IS_ERR(phy->unipro_clk)) {
- ret = PTR_ERR(phy->unipro_clk);
- dev_err(dev, "Failed to get unipro clock (ret=%d)\n", ret);
- return ret;
- }
-
- return 0;
+ return ret;
}
static const struct udevice_id mtk_ufs_phy_id_table[] = {