dev_dbg(drv->dev, "Request to power_on \"%s\" usb phy\n",
inst->cfg->label);
if (drv->vbus) {
ret = regulator_enable(drv->vbus); if (ret) goto err_regulator;
}
ret = clk_prepare_enable(drv->clk); if (ret) goto err_main_clk;
ret = clk_prepare_enable(drv->ref_clk); if (ret) goto err_instance_clk; if (inst->cfg->power_on) {
spin_lock(&drv->lock);
ret = inst->cfg->power_on(inst);
spin_unlock(&drv->lock); if (ret) goto err_power_on;
}
staticint samsung_usb2_phy_power_off(struct phy *phy)
{ struct samsung_usb2_phy_instance *inst = phy_get_drvdata(phy); struct samsung_usb2_phy_driver *drv = inst->drv; int ret = 0;
dev_dbg(drv->dev, "Request to power_off \"%s\" usb phy\n",
inst->cfg->label); if (inst->cfg->power_off) {
spin_lock(&drv->lock);
ret = inst->cfg->power_off(inst);
spin_unlock(&drv->lock); if (ret) return ret;
}
clk_disable_unprepare(drv->ref_clk);
clk_disable_unprepare(drv->clk); if (drv->vbus)
ret = regulator_disable(drv->vbus);
drv->reg_phy = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(drv->reg_phy)) {
dev_err(dev, "Failed to map register memory (phy)\n"); return PTR_ERR(drv->reg_phy);
}
drv->reg_pmu = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "samsung,pmureg-phandle"); if (IS_ERR(drv->reg_pmu)) {
dev_err(dev, "Failed to map PMU registers (via syscon)\n"); return PTR_ERR(drv->reg_pmu);
}
if (drv->cfg->has_mode_switch) {
drv->reg_sys = syscon_regmap_lookup_by_phandle(
pdev->dev.of_node, "samsung,sysreg-phandle"); if (IS_ERR(drv->reg_sys)) {
dev_err(dev, "Failed to map system registers (via syscon)\n"); return PTR_ERR(drv->reg_sys);
}
}
drv->clk = devm_clk_get(dev, "phy"); if (IS_ERR(drv->clk)) {
dev_err(dev, "Failed to get clock of phy controller\n"); return PTR_ERR(drv->clk);
}
drv->ref_clk = devm_clk_get(dev, "ref"); if (IS_ERR(drv->ref_clk)) {
dev_err(dev, "Failed to get reference clock for the phy controller\n"); return PTR_ERR(drv->ref_clk);
}
drv->ref_rate = clk_get_rate(drv->ref_clk); if (drv->cfg->rate_to_clk) {
ret = drv->cfg->rate_to_clk(drv->ref_rate, &drv->ref_reg_val); if (ret) return ret;
}
drv->vbus = devm_regulator_get(dev, "vbus"); if (IS_ERR(drv->vbus)) {
ret = PTR_ERR(drv->vbus); if (ret == -EPROBE_DEFER) return ret;
drv->vbus = NULL;
}
for (i = 0; i < drv->cfg->num_phys; i++) { char *label = drv->cfg->phys[i].label; struct samsung_usb2_phy_instance *p = &drv->instances[i];
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.