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_determine_rate - Returns the closest rate for a SCU clock
255 * @hw: clock to round rate for
256 * @req: clock rate request
264 * Assume we support all the requested rate and let the SCU firmware in clk_scu_determine_rate()
271 * clk_scu_round_rate - Round clock rate for a SCU clock
272 * @hw: clock to round rate for
273 * @rate: rate to round
274 * @parent_rate: parent rate provided by common clock framework, not used
276 * Returns the current clock rate, or zero in failure.
278 static long clk_scu_round_rate(struct clk_hw *hw, unsigned long rate, in clk_scu_round_rate() argument
282 * Assume we support all the requested rate and let the SCU firmware in clk_scu_round_rate()
285 return rate; in clk_scu_round_rate()
288 static int clk_scu_atf_set_cpu_rate(struct clk_hw *hw, unsigned long rate, in clk_scu_atf_set_cpu_rate() argument
304 cluster_id, rate, 0, 0, 0, 0, &res); in clk_scu_atf_set_cpu_rate()
310 * clk_scu_set_rate - Set rate for a SCU clock
311 * @hw: clock to change rate for
312 * @rate: target rate for the clock
313 * @parent_rate: rate of the clock parent, not used for SCU clocks
318 static int clk_scu_set_rate(struct clk_hw *hw, unsigned long rate, in clk_scu_set_rate() argument
330 msg.rate = cpu_to_le32(rate); in clk_scu_set_rate()
499 * cached rate. in __imx_clk_scu()
589 /* DC SS needs to handle bypass clock using non-cached clock rate */ in imx_clk_scu_suspend()
594 clk->rate = clk_scu_recalc_rate(&clk->hw, 0); in imx_clk_scu_suspend()
596 clk->rate = clk_hw_get_rate(&clk->hw); in imx_clk_scu_suspend()
603 if (clk->rate) in imx_clk_scu_suspend()
604 dev_dbg(dev, "save rate %d\n", clk->rate); in imx_clk_scu_suspend()
629 if (clk->rate) { in imx_clk_scu_resume()
630 ret = clk_scu_set_rate(&clk->hw, clk->rate, 0); in imx_clk_scu_resume()
631 dev_dbg(dev, "restore rate %d %s\n", clk->rate, in imx_clk_scu_resume()
742 unsigned long rate = 0; in clk_gpr_div_scu_recalc_rate() local
749 rate = val ? parent_rate / 2 : parent_rate; in clk_gpr_div_scu_recalc_rate()
751 return err ? 0 : rate; in clk_gpr_div_scu_recalc_rate()
754 static long clk_gpr_div_scu_round_rate(struct clk_hw *hw, unsigned long rate, in clk_gpr_div_scu_round_rate() argument
757 if (rate < *prate) in clk_gpr_div_scu_round_rate()
758 rate = *prate / 2; in clk_gpr_div_scu_round_rate()
760 rate = *prate; in clk_gpr_div_scu_round_rate()
762 return rate; in clk_gpr_div_scu_round_rate()
765 static int clk_gpr_div_scu_set_rate(struct clk_hw *hw, unsigned long rate, in clk_gpr_div_scu_set_rate() argument
772 val = (rate < parent_rate) ? 1 : 0; in clk_gpr_div_scu_set_rate()