Lines Matching defs:phy
12 #include <linux/phy/phy.h>
15 #include "phy-mtk-io.h"
45 static struct ufs_mtk_phy *get_ufs_mtk_phy(struct phy *generic_phy)
50 static int ufs_mtk_phy_clk_init(struct ufs_mtk_phy *phy)
52 struct device *dev = phy->dev;
53 struct clk_bulk_data *clks = phy->clks;
60 static void ufs_mtk_phy_set_active(struct ufs_mtk_phy *phy)
62 void __iomem *mmio = phy->mmio;
91 static void ufs_mtk_phy_set_deep_hibern(struct ufs_mtk_phy *phy)
93 void __iomem *mmio = phy->mmio;
119 static int ufs_mtk_phy_power_on(struct phy *generic_phy)
121 struct ufs_mtk_phy *phy = get_ufs_mtk_phy(generic_phy);
124 ret = clk_bulk_prepare_enable(UFSPHY_CLKS_CNT, phy->clks);
128 ufs_mtk_phy_set_active(phy);
133 static int ufs_mtk_phy_power_off(struct phy *generic_phy)
135 struct ufs_mtk_phy *phy = get_ufs_mtk_phy(generic_phy);
137 ufs_mtk_phy_set_deep_hibern(phy);
139 clk_bulk_disable_unprepare(UFSPHY_CLKS_CNT, phy->clks);
153 struct phy *generic_phy;
155 struct ufs_mtk_phy *phy;
158 phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
159 if (!phy)
162 phy->mmio = devm_platform_ioremap_resource(pdev, 0);
163 if (IS_ERR(phy->mmio))
164 return PTR_ERR(phy->mmio);
166 phy->dev = dev;
168 ret = ufs_mtk_phy_clk_init(phy);
176 phy_set_drvdata(generic_phy, phy);