Lines Matching refs:phy
18 static int msm_hdmi_phy_resource_init(struct hdmi_phy *phy) in msm_hdmi_phy_resource_init() argument
20 struct hdmi_phy_cfg *cfg = phy->cfg; in msm_hdmi_phy_resource_init()
21 struct device *dev = &phy->pdev->dev; in msm_hdmi_phy_resource_init()
24 phy->regs = devm_kzalloc(dev, sizeof(phy->regs[0]) * cfg->num_regs, in msm_hdmi_phy_resource_init()
26 if (!phy->regs) in msm_hdmi_phy_resource_init()
29 phy->clks = devm_kzalloc(dev, sizeof(phy->clks[0]) * cfg->num_clks, in msm_hdmi_phy_resource_init()
31 if (!phy->clks) in msm_hdmi_phy_resource_init()
45 phy->regs[i] = reg; in msm_hdmi_phy_resource_init()
59 phy->clks[i] = clk; in msm_hdmi_phy_resource_init()
65 int msm_hdmi_phy_resource_enable(struct hdmi_phy *phy) in msm_hdmi_phy_resource_enable() argument
67 struct hdmi_phy_cfg *cfg = phy->cfg; in msm_hdmi_phy_resource_enable()
68 struct device *dev = &phy->pdev->dev; in msm_hdmi_phy_resource_enable()
74 ret = regulator_enable(phy->regs[i]); in msm_hdmi_phy_resource_enable()
81 ret = clk_prepare_enable(phy->clks[i]); in msm_hdmi_phy_resource_enable()
90 void msm_hdmi_phy_resource_disable(struct hdmi_phy *phy) in msm_hdmi_phy_resource_disable() argument
92 struct hdmi_phy_cfg *cfg = phy->cfg; in msm_hdmi_phy_resource_disable()
93 struct device *dev = &phy->pdev->dev; in msm_hdmi_phy_resource_disable()
97 clk_disable_unprepare(phy->clks[i]); in msm_hdmi_phy_resource_disable()
100 regulator_disable(phy->regs[i]); in msm_hdmi_phy_resource_disable()
105 void msm_hdmi_phy_powerup(struct hdmi_phy *phy, unsigned long int pixclock) in msm_hdmi_phy_powerup() argument
107 if (!phy || !phy->cfg->powerup) in msm_hdmi_phy_powerup()
110 phy->cfg->powerup(phy, pixclock); in msm_hdmi_phy_powerup()
113 void msm_hdmi_phy_powerdown(struct hdmi_phy *phy) in msm_hdmi_phy_powerdown() argument
115 if (!phy || !phy->cfg->powerdown) in msm_hdmi_phy_powerdown()
118 phy->cfg->powerdown(phy); in msm_hdmi_phy_powerdown()
149 struct hdmi_phy *phy; in msm_hdmi_phy_probe() local
152 phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); in msm_hdmi_phy_probe()
153 if (!phy) in msm_hdmi_phy_probe()
156 phy->cfg = (struct hdmi_phy_cfg *)of_device_get_match_data(dev); in msm_hdmi_phy_probe()
157 if (!phy->cfg) in msm_hdmi_phy_probe()
160 phy->mmio = msm_ioremap(pdev, "hdmi_phy", "HDMI_PHY"); in msm_hdmi_phy_probe()
161 if (IS_ERR(phy->mmio)) { in msm_hdmi_phy_probe()
166 phy->pdev = pdev; in msm_hdmi_phy_probe()
168 ret = msm_hdmi_phy_resource_init(phy); in msm_hdmi_phy_probe()
174 ret = msm_hdmi_phy_resource_enable(phy); in msm_hdmi_phy_probe()
178 ret = msm_hdmi_phy_pll_init(pdev, phy->cfg->type); in msm_hdmi_phy_probe()
181 msm_hdmi_phy_resource_disable(phy); in msm_hdmi_phy_probe()
185 msm_hdmi_phy_resource_disable(phy); in msm_hdmi_phy_probe()
187 platform_set_drvdata(pdev, phy); in msm_hdmi_phy_probe()