Lines Matching full:rate
56 u32 rate; member
76 * struct imx_sc_msg_req_set_clock_rate - clock set rate protocol
78 * @rate: rate to set
79 * @resource: clock resource to set rate
82 * This structure describes the SCU protocol of clock rate set
86 __le32 rate; member
97 __le32 rate; member
101 * struct imx_sc_msg_get_clock_rate - clock get rate protocol
103 * @req: get rate request protocol
104 * @resp: get rate response protocol
106 * This structure describes the SCU protocol of clock rate get
220 * clk_scu_recalc_rate - Get clock rate for a SCU clock
221 * @hw: clock to get rate for
222 * @parent_rate: parent rate provided by common clock framework, not used
224 * Gets the current clock rate of a SCU clock. Returns the current
225 * clock rate, or zero in failure.
245 pr_err("%s: failed to get clock rate %d\n", in clk_scu_recalc_rate()
250 return le32_to_cpu(msg.data.resp.rate); in clk_scu_recalc_rate()
254 * clk_scu_round_rate - Round clock rate for a SCU clock
255 * @hw: clock to round rate for
256 * @rate: rate to round
257 * @parent_rate: parent rate provided by common clock framework, not used
259 * Returns the current clock rate, or zero in failure.
261 static long clk_scu_round_rate(struct clk_hw *hw, unsigned long rate, in clk_scu_round_rate() argument
265 * Assume we support all the requested rate and let the SCU firmware in clk_scu_round_rate()
268 return rate; in clk_scu_round_rate()
271 static int clk_scu_atf_set_cpu_rate(struct clk_hw *hw, unsigned long rate, in clk_scu_atf_set_cpu_rate() argument
287 cluster_id, rate, 0, 0, 0, 0, &res); in clk_scu_atf_set_cpu_rate()
293 * clk_scu_set_rate - Set rate for a SCU clock
294 * @hw: clock to change rate for
295 * @rate: target rate for the clock
296 * @parent_rate: rate of the clock parent, not used for SCU clocks
301 static int clk_scu_set_rate(struct clk_hw *hw, unsigned long rate, in clk_scu_set_rate() argument
313 msg.rate = cpu_to_le32(rate); in clk_scu_set_rate()
482 * cached rate. in __imx_clk_scu()
572 /* DC SS needs to handle bypass clock using non-cached clock rate */ in imx_clk_scu_suspend()
577 clk->rate = clk_scu_recalc_rate(&clk->hw, 0); in imx_clk_scu_suspend()
579 clk->rate = clk_hw_get_rate(&clk->hw); in imx_clk_scu_suspend()
586 if (clk->rate) in imx_clk_scu_suspend()
587 dev_dbg(dev, "save rate %d\n", clk->rate); in imx_clk_scu_suspend()
612 if (clk->rate) { in imx_clk_scu_resume()
613 ret = clk_scu_set_rate(&clk->hw, clk->rate, 0); in imx_clk_scu_resume()
614 dev_dbg(dev, "restore rate %d %s\n", clk->rate, in imx_clk_scu_resume()
716 unsigned long rate = 0; in clk_gpr_div_scu_recalc_rate() local
723 rate = val ? parent_rate / 2 : parent_rate; in clk_gpr_div_scu_recalc_rate()
725 return err ? 0 : rate; in clk_gpr_div_scu_recalc_rate()
728 static long clk_gpr_div_scu_round_rate(struct clk_hw *hw, unsigned long rate, in clk_gpr_div_scu_round_rate() argument
731 if (rate < *prate) in clk_gpr_div_scu_round_rate()
732 rate = *prate / 2; in clk_gpr_div_scu_round_rate()
734 rate = *prate; in clk_gpr_div_scu_round_rate()
736 return rate; in clk_gpr_div_scu_round_rate()
739 static int clk_gpr_div_scu_set_rate(struct clk_hw *hw, unsigned long rate, in clk_gpr_div_scu_set_rate() argument
746 val = (rate < parent_rate) ? 1 : 0; in clk_gpr_div_scu_set_rate()