/* Check for presence of each component clock */ for (i = 0; i < CLK_COMPONENT_TYPE_MAX; i++) { if (!cclk->comp_nodes[i]) continue;
comp = _lookup_component(cclk->comp_nodes[i]); if (!comp) {
pr_debug("component %s not ready for %pOFn, retry\n",
cclk->comp_nodes[i]->name, node); if (!ti_clk_retry_init(node, hw,
_register_composite)) return;
goto cleanup;
} if (cclk->comp_clks[comp->type] != NULL) {
pr_err("duplicate component types for %pOFn (%s)!\n",
node, component_clk_types[comp->type]); goto cleanup;
}
cclk->comp_clks[comp->type] = comp;
/* Mark this node as found */
cclk->comp_nodes[i] = NULL;
}
/* All components exists, proceed with registration */ for (i = CLK_COMPONENT_TYPE_MAX - 1; i >= 0; i--) {
comp = cclk->comp_clks[i]; if (!comp) continue; if (comp->num_parents) {
num_parents = comp->num_parents;
parent_names = comp->parent_names; break;
}
}
if (!num_parents) {
pr_err("%s: no parents found for %pOFn!\n", __func__, node); goto cleanup;
}
if (!IS_ERR(clk)) {
ret = ti_clk_add_alias(clk, name); if (ret) {
clk_unregister(clk); goto cleanup;
}
of_clk_add_provider(node, of_clk_src_simple_get, clk);
}
cleanup: /* Free component clock list entries */ for (i = 0; i < CLK_COMPONENT_TYPE_MAX; i++) { if (!cclk->comp_clks[i]) continue;
list_del(&cclk->comp_clks[i]->link);
kfree(cclk->comp_clks[i]->parent_names);
kfree(cclk->comp_clks[i]);
}
/** * ti_clk_add_component - add a component clock to the pool * @node: device node of the component clock * @hw: hardware clock definition for the component clock * @type: type of the component clock * * Adds a component clock to the list of available components, so that * it can be registered by a composite clock.
*/ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw, int type)
{ unsignedint num_parents; constchar **parent_names; struct component_clk *clk;
num_parents = of_clk_get_parent_count(node);
if (!num_parents) {
pr_err("component-clock %pOFn must have parent(s)\n", node); return -EINVAL;
}
parent_names = kcalloc(num_parents, sizeof(char *), GFP_KERNEL); if (!parent_names) return -ENOMEM;
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.