Lines Matching full:handle

77 static int scmi_clock_protocol_attributes_get(const struct scmi_handle *handle,  in scmi_clock_protocol_attributes_get()  argument
84 ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES, in scmi_clock_protocol_attributes_get()
91 ret = scmi_do_xfer(handle, t); in scmi_clock_protocol_attributes_get()
97 scmi_xfer_put(handle, t); in scmi_clock_protocol_attributes_get()
101 static int scmi_clock_attributes_get(const struct scmi_handle *handle, in scmi_clock_attributes_get() argument
108 ret = scmi_xfer_get_init(handle, CLOCK_ATTRIBUTES, SCMI_PROTOCOL_CLOCK, in scmi_clock_attributes_get()
116 ret = scmi_do_xfer(handle, t); in scmi_clock_attributes_get()
122 scmi_xfer_put(handle, t); in scmi_clock_attributes_get()
139 scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id, in scmi_clock_describe_rates_get() argument
151 ret = scmi_xfer_get_init(handle, CLOCK_DESCRIBE_RATES, in scmi_clock_describe_rates_get()
164 ret = scmi_do_xfer(handle, t); in scmi_clock_describe_rates_get()
174 dev_err(handle->dev, "No. of rates > MAX_NUM_RATES"); in scmi_clock_describe_rates_get()
182 dev_dbg(handle->dev, "Min %llu Max %llu Step %llu Hz\n", in scmi_clock_describe_rates_get()
191 dev_dbg(handle->dev, "Rate %llu Hz\n", *rate); in scmi_clock_describe_rates_get()
196 scmi_reset_rx_to_maxsz(handle, t); in scmi_clock_describe_rates_get()
211 scmi_xfer_put(handle, t); in scmi_clock_describe_rates_get()
216 scmi_clock_rate_get(const struct scmi_handle *handle, u32 clk_id, u64 *value) in scmi_clock_rate_get() argument
221 ret = scmi_xfer_get_init(handle, CLOCK_RATE_GET, SCMI_PROTOCOL_CLOCK, in scmi_clock_rate_get()
228 ret = scmi_do_xfer(handle, t); in scmi_clock_rate_get()
232 scmi_xfer_put(handle, t); in scmi_clock_rate_get()
236 static int scmi_clock_rate_set(const struct scmi_handle *handle, u32 clk_id, in scmi_clock_rate_set() argument
243 struct clock_info *ci = handle->clk_priv; in scmi_clock_rate_set()
245 ret = scmi_xfer_get_init(handle, CLOCK_RATE_SET, SCMI_PROTOCOL_CLOCK, in scmi_clock_rate_set()
261 ret = scmi_do_xfer_with_response(handle, t); in scmi_clock_rate_set()
263 ret = scmi_do_xfer(handle, t); in scmi_clock_rate_set()
268 scmi_xfer_put(handle, t); in scmi_clock_rate_set()
273 scmi_clock_config_set(const struct scmi_handle *handle, u32 clk_id, u32 config) in scmi_clock_config_set() argument
279 ret = scmi_xfer_get_init(handle, CLOCK_CONFIG_SET, SCMI_PROTOCOL_CLOCK, in scmi_clock_config_set()
288 ret = scmi_do_xfer(handle, t); in scmi_clock_config_set()
290 scmi_xfer_put(handle, t); in scmi_clock_config_set()
294 static int scmi_clock_enable(const struct scmi_handle *handle, u32 clk_id) in scmi_clock_enable() argument
296 return scmi_clock_config_set(handle, clk_id, CLOCK_ENABLE); in scmi_clock_enable()
299 static int scmi_clock_disable(const struct scmi_handle *handle, u32 clk_id) in scmi_clock_disable() argument
301 return scmi_clock_config_set(handle, clk_id, 0); in scmi_clock_disable()
304 static int scmi_clock_count_get(const struct scmi_handle *handle) in scmi_clock_count_get() argument
306 struct clock_info *ci = handle->clk_priv; in scmi_clock_count_get()
312 scmi_clock_info_get(const struct scmi_handle *handle, u32 clk_id) in scmi_clock_info_get() argument
314 struct clock_info *ci = handle->clk_priv; in scmi_clock_info_get()
332 static int scmi_clock_protocol_init(struct scmi_handle *handle) in scmi_clock_protocol_init() argument
338 scmi_version_get(handle, SCMI_PROTOCOL_CLOCK, &version); in scmi_clock_protocol_init()
340 dev_dbg(handle->dev, "Clock Version %d.%d\n", in scmi_clock_protocol_init()
343 cinfo = devm_kzalloc(handle->dev, sizeof(*cinfo), GFP_KERNEL); in scmi_clock_protocol_init()
347 scmi_clock_protocol_attributes_get(handle, cinfo); in scmi_clock_protocol_init()
349 cinfo->clk = devm_kcalloc(handle->dev, cinfo->num_clocks, in scmi_clock_protocol_init()
357 ret = scmi_clock_attributes_get(handle, clkid, clk); in scmi_clock_protocol_init()
359 scmi_clock_describe_rates_get(handle, clkid, clk); in scmi_clock_protocol_init()
363 handle->clk_ops = &clk_ops; in scmi_clock_protocol_init()
364 handle->clk_priv = cinfo; in scmi_clock_protocol_init()