Lines Matching full:handle
74 static int scmi_clock_protocol_attributes_get(const struct scmi_handle *handle, in scmi_clock_protocol_attributes_get() argument
81 ret = scmi_xfer_get_init(handle, PROTOCOL_ATTRIBUTES, in scmi_clock_protocol_attributes_get()
88 ret = scmi_do_xfer(handle, t); in scmi_clock_protocol_attributes_get()
94 scmi_xfer_put(handle, t); in scmi_clock_protocol_attributes_get()
98 static int scmi_clock_attributes_get(const struct scmi_handle *handle, in scmi_clock_attributes_get() argument
105 ret = scmi_xfer_get_init(handle, CLOCK_ATTRIBUTES, SCMI_PROTOCOL_CLOCK, in scmi_clock_attributes_get()
113 ret = scmi_do_xfer(handle, t); in scmi_clock_attributes_get()
119 scmi_xfer_put(handle, t); in scmi_clock_attributes_get()
124 scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id, in scmi_clock_describe_rates_get() argument
136 ret = scmi_xfer_get_init(handle, CLOCK_DESCRIBE_RATES, in scmi_clock_describe_rates_get()
149 ret = scmi_do_xfer(handle, t); in scmi_clock_describe_rates_get()
159 dev_err(handle->dev, "No. of rates > MAX_NUM_RATES"); in scmi_clock_describe_rates_get()
167 dev_dbg(handle->dev, "Min %llu Max %llu Step %llu Hz\n", in scmi_clock_describe_rates_get()
176 dev_dbg(handle->dev, "Rate %llu Hz\n", *rate); in scmi_clock_describe_rates_get()
192 scmi_xfer_put(handle, t); in scmi_clock_describe_rates_get()
197 scmi_clock_rate_get(const struct scmi_handle *handle, u32 clk_id, u64 *value) in scmi_clock_rate_get() argument
202 ret = scmi_xfer_get_init(handle, CLOCK_RATE_GET, SCMI_PROTOCOL_CLOCK, in scmi_clock_rate_get()
209 ret = scmi_do_xfer(handle, t); in scmi_clock_rate_get()
213 scmi_xfer_put(handle, t); in scmi_clock_rate_get()
217 static int scmi_clock_rate_set(const struct scmi_handle *handle, u32 clk_id, in scmi_clock_rate_set() argument
224 struct clock_info *ci = handle->clk_priv; in scmi_clock_rate_set()
226 ret = scmi_xfer_get_init(handle, CLOCK_RATE_SET, SCMI_PROTOCOL_CLOCK, in scmi_clock_rate_set()
242 ret = scmi_do_xfer_with_response(handle, t); in scmi_clock_rate_set()
244 ret = scmi_do_xfer(handle, t); in scmi_clock_rate_set()
249 scmi_xfer_put(handle, t); in scmi_clock_rate_set()
254 scmi_clock_config_set(const struct scmi_handle *handle, u32 clk_id, u32 config) in scmi_clock_config_set() argument
260 ret = scmi_xfer_get_init(handle, CLOCK_CONFIG_SET, SCMI_PROTOCOL_CLOCK, in scmi_clock_config_set()
269 ret = scmi_do_xfer(handle, t); in scmi_clock_config_set()
271 scmi_xfer_put(handle, t); in scmi_clock_config_set()
275 static int scmi_clock_enable(const struct scmi_handle *handle, u32 clk_id) in scmi_clock_enable() argument
277 return scmi_clock_config_set(handle, clk_id, CLOCK_ENABLE); in scmi_clock_enable()
280 static int scmi_clock_disable(const struct scmi_handle *handle, u32 clk_id) in scmi_clock_disable() argument
282 return scmi_clock_config_set(handle, clk_id, 0); in scmi_clock_disable()
285 static int scmi_clock_count_get(const struct scmi_handle *handle) in scmi_clock_count_get() argument
287 struct clock_info *ci = handle->clk_priv; in scmi_clock_count_get()
293 scmi_clock_info_get(const struct scmi_handle *handle, u32 clk_id) in scmi_clock_info_get() argument
295 struct clock_info *ci = handle->clk_priv; in scmi_clock_info_get()
313 static int scmi_clock_protocol_init(struct scmi_handle *handle) in scmi_clock_protocol_init() argument
319 scmi_version_get(handle, SCMI_PROTOCOL_CLOCK, &version); in scmi_clock_protocol_init()
321 dev_dbg(handle->dev, "Clock Version %d.%d\n", in scmi_clock_protocol_init()
324 cinfo = devm_kzalloc(handle->dev, sizeof(*cinfo), GFP_KERNEL); in scmi_clock_protocol_init()
328 scmi_clock_protocol_attributes_get(handle, cinfo); in scmi_clock_protocol_init()
330 cinfo->clk = devm_kcalloc(handle->dev, cinfo->num_clocks, in scmi_clock_protocol_init()
338 ret = scmi_clock_attributes_get(handle, clkid, clk); in scmi_clock_protocol_init()
340 scmi_clock_describe_rates_get(handle, clkid, clk); in scmi_clock_protocol_init()
343 handle->clk_ops = &clk_ops; in scmi_clock_protocol_init()
344 handle->clk_priv = cinfo; in scmi_clock_protocol_init()