Lines Matching refs:rate
56 u32 rate;
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;
97 __le32 rate;
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",
250 return le32_to_cpu(msg.data.resp.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
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,
282 * Assume we support all the requested rate and let the SCU firmware
285 return rate;
288 static int clk_scu_atf_set_cpu_rate(struct clk_hw *hw, unsigned long rate,
304 cluster_id, rate, 0, 0, 0, 0, &res);
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,
330 msg.rate = cpu_to_le32(rate);
499 * cached rate.
589 /* DC SS needs to handle bypass clock using non-cached clock rate */
594 clk->rate = clk_scu_recalc_rate(&clk->hw, 0);
596 clk->rate = clk_hw_get_rate(&clk->hw);
603 if (clk->rate)
604 dev_dbg(dev, "save rate %d\n", clk->rate);
629 if (clk->rate) {
630 ret = clk_scu_set_rate(&clk->hw, clk->rate, 0);
631 dev_dbg(dev, "restore rate %d %s\n", clk->rate,
742 unsigned long rate = 0;
749 rate = val ? parent_rate / 2 : parent_rate;
751 return err ? 0 : rate;
754 static long clk_gpr_div_scu_round_rate(struct clk_hw *hw, unsigned long rate,
757 if (rate < *prate)
758 rate = *prate / 2;
760 rate = *prate;
762 return rate;
765 static int clk_gpr_div_scu_set_rate(struct clk_hw *hw, unsigned long rate,
772 val = (rate < parent_rate) ? 1 : 0;