Lines Matching full:rate
58 u32 rate; member
78 * struct imx_sc_msg_req_set_clock_rate - clock set rate protocol
80 * @rate: rate to set
81 * @resource: clock resource to set rate
84 * This structure describes the SCU protocol of clock rate set
88 __le32 rate; member
99 __le32 rate; member
103 * struct imx_sc_msg_get_clock_rate - clock get rate protocol
105 * @req: get rate request protocol
106 * @resp: get rate response protocol
108 * This structure describes the SCU protocol of clock rate get
222 * clk_scu_recalc_rate - Get clock rate for a SCU clock
223 * @hw: clock to get rate for
224 * @parent_rate: parent rate provided by common clock framework, not used
226 * Gets the current clock rate of a SCU clock. Returns the current
227 * clock rate, or zero in failure.
247 pr_err("%s: failed to get clock rate %d\n", in clk_scu_recalc_rate()
252 return le32_to_cpu(msg.data.resp.rate); in clk_scu_recalc_rate()
256 * clk_scu_determine_rate - Returns the closest rate for a SCU clock
257 * @hw: clock to round rate for
258 * @req: clock rate request
266 * Assume we support all the requested rate and let the SCU firmware in clk_scu_determine_rate()
273 * clk_scu_round_rate - Round clock rate for a SCU clock
274 * @hw: clock to round rate for
275 * @rate: rate to round
276 * @parent_rate: parent rate provided by common clock framework, not used
278 * Returns the current clock rate, or zero in failure.
280 static long clk_scu_round_rate(struct clk_hw *hw, unsigned long rate, in clk_scu_round_rate() argument
284 * Assume we support all the requested rate and let the SCU firmware in clk_scu_round_rate()
287 return rate; in clk_scu_round_rate()
290 static int clk_scu_atf_set_cpu_rate(struct clk_hw *hw, unsigned long rate, in clk_scu_atf_set_cpu_rate() argument
306 cluster_id, rate, 0, 0, 0, 0, &res); in clk_scu_atf_set_cpu_rate()
312 * clk_scu_set_rate - Set rate for a SCU clock
313 * @hw: clock to change rate for
314 * @rate: target rate for the clock
315 * @parent_rate: rate of the clock parent, not used for SCU clocks
320 static int clk_scu_set_rate(struct clk_hw *hw, unsigned long rate, in clk_scu_set_rate() argument
332 msg.rate = cpu_to_le32(rate); in clk_scu_set_rate()
501 * cached rate. in __imx_clk_scu()
591 /* DC SS needs to handle bypass clock using non-cached clock rate */ in imx_clk_scu_suspend()
596 clk->rate = clk_scu_recalc_rate(&clk->hw, 0); in imx_clk_scu_suspend()
598 clk->rate = clk_hw_get_rate(&clk->hw); in imx_clk_scu_suspend()
605 if (clk->rate) in imx_clk_scu_suspend()
606 dev_dbg(dev, "save rate %d\n", clk->rate); in imx_clk_scu_suspend()
631 if (clk->rate) { in imx_clk_scu_resume()
632 ret = clk_scu_set_rate(&clk->hw, clk->rate, 0); in imx_clk_scu_resume()
633 dev_dbg(dev, "restore rate %d %s\n", clk->rate, in imx_clk_scu_resume()
757 unsigned long rate = 0; in clk_gpr_div_scu_recalc_rate() local
764 rate = val ? parent_rate / 2 : parent_rate; in clk_gpr_div_scu_recalc_rate()
766 return err ? 0 : rate; in clk_gpr_div_scu_recalc_rate()
769 static long clk_gpr_div_scu_round_rate(struct clk_hw *hw, unsigned long rate, in clk_gpr_div_scu_round_rate() argument
772 if (rate < *prate) in clk_gpr_div_scu_round_rate()
773 rate = *prate / 2; in clk_gpr_div_scu_round_rate()
775 rate = *prate; in clk_gpr_div_scu_round_rate()
777 return rate; in clk_gpr_div_scu_round_rate()
780 static int clk_gpr_div_scu_set_rate(struct clk_hw *hw, unsigned long rate, in clk_gpr_div_scu_set_rate() argument
787 val = (rate < parent_rate) ? 1 : 0; in clk_gpr_div_scu_set_rate()