/** * zynq_pll_round_rate() - Round a clock frequency * @hw: Handle between common and hardware-specific interfaces * @rate: Desired clock frequency * @prate: Clock frequency of parent clock * Return: frequency closest to @rate the hardware can generate.
*/ staticlong zynq_pll_round_rate(struct clk_hw *hw, unsignedlong rate, unsignedlong *prate)
{
u32 fbdiv;
/** * zynq_pll_recalc_rate() - Recalculate clock frequency * @hw: Handle between common and hardware-specific interfaces * @parent_rate: Clock frequency of parent clock * Return: current clock frequency.
*/ staticunsignedlong zynq_pll_recalc_rate(struct clk_hw *hw, unsignedlong parent_rate)
{ struct zynq_pll *clk = to_zynq_pll(hw);
u32 fbdiv;
/* * makes probably sense to redundantly save fbdiv in the struct * zynq_pll to save the IO access.
*/
fbdiv = (readl(clk->pll_ctrl) & PLLCTRL_FBDIV_MASK) >>
PLLCTRL_FBDIV_SHIFT;
return parent_rate * fbdiv;
}
/** * zynq_pll_is_enabled - Check if a clock is enabled * @hw: Handle between common and hardware-specific interfaces * Return: 1 if the clock is enabled, 0 otherwise. * * Not sure this is a good idea, but since disabled means bypassed for * this clock implementation we say we are always enabled.
*/ staticint zynq_pll_is_enabled(struct clk_hw *hw)
{ unsignedlong flags = 0;
u32 reg; struct zynq_pll *clk = to_zynq_pll(hw);
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.