staticint msm_hdmi_phy_resource_init(struct hdmi_phy *phy)
{ struct hdmi_phy_cfg *cfg = phy->cfg; struct device *dev = &phy->pdev->dev; int i, ret;
phy->regs = devm_kcalloc(dev, cfg->num_regs, sizeof(phy->regs[0]),
GFP_KERNEL); if (!phy->regs) return -ENOMEM;
phy->clks = devm_kcalloc(dev, cfg->num_clks, sizeof(phy->clks[0]),
GFP_KERNEL); if (!phy->clks) return -ENOMEM;
for (i = 0; i < cfg->num_regs; i++)
phy->regs[i].supply = cfg->reg_names[i];
ret = devm_regulator_bulk_get(dev, cfg->num_regs, phy->regs); if (ret) { if (ret != -EPROBE_DEFER)
DRM_DEV_ERROR(dev, "failed to get phy regulators: %d\n", ret);
return ret;
}
for (i = 0; i < cfg->num_clks; i++) { struct clk *clk;
clk = msm_clk_get(phy->pdev, cfg->clk_names[i]); if (IS_ERR(clk)) {
ret = PTR_ERR(clk);
DRM_DEV_ERROR(dev, "failed to get phy clock: %s (%d)\n",
cfg->clk_names[i], ret); return ret;
}
phy->clks[i] = clk;
}
return 0;
}
int msm_hdmi_phy_resource_enable(struct hdmi_phy *phy)
{ struct hdmi_phy_cfg *cfg = phy->cfg; struct device *dev = &phy->pdev->dev; int i, ret = 0;
ret = pm_runtime_resume_and_get(dev); if (ret) {
DRM_DEV_ERROR(dev, "runtime resume failed: %d\n", ret); return ret;
}
ret = regulator_bulk_enable(cfg->num_regs, phy->regs); if (ret) {
DRM_DEV_ERROR(dev, "failed to enable regulators: (%d)\n", ret); return ret;
}
for (i = 0; i < cfg->num_clks; i++) {
ret = clk_prepare_enable(phy->clks[i]); if (ret)
DRM_DEV_ERROR(dev, "failed to enable clock: %s (%d)\n",
cfg->clk_names[i], ret);
}
void msm_hdmi_phy_powerdown(struct hdmi_phy *phy)
{ if (!phy || !phy->cfg->powerdown) return;
phy->cfg->powerdown(phy);
}
staticint msm_hdmi_phy_pll_init(struct platform_device *pdev, enum hdmi_phy_type type)
{ int ret;
switch (type) { case MSM_HDMI_PHY_8960:
ret = msm_hdmi_pll_8960_init(pdev); break; case MSM_HDMI_PHY_8996:
ret = msm_hdmi_pll_8996_init(pdev); break; case MSM_HDMI_PHY_8998:
ret = msm_hdmi_pll_8998_init(pdev); break; /* * we don't have PLL support for these, don't report an error for now
*/ case MSM_HDMI_PHY_8x60: case MSM_HDMI_PHY_8x74: default:
ret = 0; break;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.