Lines Matching refs:handle
77 static int scmi_clock_protocol_attributes_get(const struct scmi_handle *handle,
84 ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES,
91 ret = scmi_do_xfer(handle, t);
97 scmi_xfer_put(handle, t);
101 static int scmi_clock_attributes_get(const struct scmi_handle *handle,
108 ret = scmi_xfer_get_init(handle, CLOCK_ATTRIBUTES, SCMI_PROTOCOL_CLOCK,
116 ret = scmi_do_xfer(handle, t);
122 scmi_xfer_put(handle, t);
139 scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
151 ret = scmi_xfer_get_init(handle, CLOCK_DESCRIBE_RATES,
164 ret = scmi_do_xfer(handle, t);
174 dev_err(handle->dev, "No. of rates > MAX_NUM_RATES");
182 dev_dbg(handle->dev, "Min %llu Max %llu Step %llu Hz\n",
191 dev_dbg(handle->dev, "Rate %llu Hz\n", *rate);
196 scmi_reset_rx_to_maxsz(handle, t);
212 scmi_xfer_put(handle, t);
217 scmi_clock_rate_get(const struct scmi_handle *handle, u32 clk_id, u64 *value)
222 ret = scmi_xfer_get_init(handle, CLOCK_RATE_GET, SCMI_PROTOCOL_CLOCK,
229 ret = scmi_do_xfer(handle, t);
233 scmi_xfer_put(handle, t);
237 static int scmi_clock_rate_set(const struct scmi_handle *handle, u32 clk_id,
244 struct clock_info *ci = handle->clk_priv;
246 ret = scmi_xfer_get_init(handle, CLOCK_RATE_SET, SCMI_PROTOCOL_CLOCK,
262 ret = scmi_do_xfer_with_response(handle, t);
264 ret = scmi_do_xfer(handle, t);
269 scmi_xfer_put(handle, t);
274 scmi_clock_config_set(const struct scmi_handle *handle, u32 clk_id, u32 config)
280 ret = scmi_xfer_get_init(handle, CLOCK_CONFIG_SET, SCMI_PROTOCOL_CLOCK,
289 ret = scmi_do_xfer(handle, t);
291 scmi_xfer_put(handle, t);
295 static int scmi_clock_enable(const struct scmi_handle *handle, u32 clk_id)
297 return scmi_clock_config_set(handle, clk_id, CLOCK_ENABLE);
300 static int scmi_clock_disable(const struct scmi_handle *handle, u32 clk_id)
302 return scmi_clock_config_set(handle, clk_id, 0);
305 static int scmi_clock_count_get(const struct scmi_handle *handle)
307 struct clock_info *ci = handle->clk_priv;
313 scmi_clock_info_get(const struct scmi_handle *handle, u32 clk_id)
315 struct clock_info *ci = handle->clk_priv;
333 static int scmi_clock_protocol_init(struct scmi_handle *handle)
339 scmi_version_get(handle, SCMI_PROTOCOL_CLOCK, &version);
341 dev_dbg(handle->dev, "Clock Version %d.%d\n",
344 cinfo = devm_kzalloc(handle->dev, sizeof(*cinfo), GFP_KERNEL);
348 scmi_clock_protocol_attributes_get(handle, cinfo);
350 cinfo->clk = devm_kcalloc(handle->dev, cinfo->num_clocks,
358 ret = scmi_clock_attributes_get(handle, clkid, clk);
360 scmi_clock_describe_rates_get(handle, clkid, clk);
364 handle->clk_ops = &clk_ops;
365 handle->clk_priv = cinfo;