/** * zynqmp_clk_gate_enable() - Enable clock * @hw: handle between common and hardware-specific interfaces * * Return: 0 on success else error code
*/ staticint zynqmp_clk_gate_enable(struct clk_hw *hw)
{ struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(hw); constchar *clk_name = clk_hw_get_name(hw);
u32 clk_id = gate->clk_id; int ret;
ret = zynqmp_pm_clock_enable(clk_id);
if (ret)
pr_debug("%s() clock enable failed for %s (id %d), ret = %d\n",
__func__, clk_name, clk_id, ret);
return ret;
}
/* * zynqmp_clk_gate_disable() - Disable clock * @hw: handle between common and hardware-specific interfaces
*/ staticvoid zynqmp_clk_gate_disable(struct clk_hw *hw)
{ struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(hw); constchar *clk_name = clk_hw_get_name(hw);
u32 clk_id = gate->clk_id; int ret;
ret = zynqmp_pm_clock_disable(clk_id);
if (ret)
pr_debug("%s() clock disable failed for %s (id %d), ret = %d\n",
__func__, clk_name, clk_id, ret);
}
/** * zynqmp_clk_gate_is_enabled() - Check clock state * @hw: handle between common and hardware-specific interfaces * * Return: 1 if enabled, 0 if disabled else error code
*/ staticint zynqmp_clk_gate_is_enabled(struct clk_hw *hw)
{ struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(hw); constchar *clk_name = clk_hw_get_name(hw);
u32 clk_id = gate->clk_id; int state, ret;
ret = zynqmp_pm_clock_getstate(clk_id, &state); if (ret) {
pr_debug("%s() clock get state failed for %s, ret = %d\n",
__func__, clk_name, ret); return -EIO;
}
/** * zynqmp_clk_register_gate() - Register a gate clock with the clock framework * @name: Name of this clock * @clk_id: Id of this clock * @parents: Name of this clock's parents * @num_parents: Number of parents * @nodes: Clock topology node * * Return: clock hardware of the registered clock gate
*/ struct clk_hw *zynqmp_clk_register_gate(constchar *name, u32 clk_id, constchar * const *parents,
u8 num_parents, conststruct clock_topology *nodes)
{ struct zynqmp_clk_gate *gate; struct clk_hw *hw; int ret; struct clk_init_data init;
/* allocate the gate */
gate = kzalloc(sizeof(*gate), GFP_KERNEL); if (!gate) return ERR_PTR(-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.