Lines Matching refs:ph
79 scmi_clock_protocol_attributes_get(const struct scmi_protocol_handle *ph, in scmi_clock_protocol_attributes_get() argument
86 ret = ph->xops->xfer_get_init(ph, PROTOCOL_ATTRIBUTES, in scmi_clock_protocol_attributes_get()
93 ret = ph->xops->do_xfer(ph, t); in scmi_clock_protocol_attributes_get()
99 ph->xops->xfer_put(ph, t); in scmi_clock_protocol_attributes_get()
103 static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph, in scmi_clock_attributes_get() argument
110 ret = ph->xops->xfer_get_init(ph, CLOCK_ATTRIBUTES, in scmi_clock_attributes_get()
118 ret = ph->xops->do_xfer(ph, t); in scmi_clock_attributes_get()
124 ph->xops->xfer_put(ph, t); in scmi_clock_attributes_get()
141 scmi_clock_describe_rates_get(const struct scmi_protocol_handle *ph, u32 clk_id, in scmi_clock_describe_rates_get() argument
153 ret = ph->xops->xfer_get_init(ph, CLOCK_DESCRIBE_RATES, in scmi_clock_describe_rates_get()
166 ret = ph->xops->do_xfer(ph, t); in scmi_clock_describe_rates_get()
176 dev_err(ph->dev, "No. of rates > MAX_NUM_RATES"); in scmi_clock_describe_rates_get()
184 dev_dbg(ph->dev, "Min %llu Max %llu Step %llu Hz\n", in scmi_clock_describe_rates_get()
193 dev_dbg(ph->dev, "Rate %llu Hz\n", *rate); in scmi_clock_describe_rates_get()
198 ph->xops->reset_rx_to_maxsz(ph, t); in scmi_clock_describe_rates_get()
213 ph->xops->xfer_put(ph, t); in scmi_clock_describe_rates_get()
218 scmi_clock_rate_get(const struct scmi_protocol_handle *ph, in scmi_clock_rate_get() argument
224 ret = ph->xops->xfer_get_init(ph, CLOCK_RATE_GET, in scmi_clock_rate_get()
231 ret = ph->xops->do_xfer(ph, t); in scmi_clock_rate_get()
235 ph->xops->xfer_put(ph, t); in scmi_clock_rate_get()
239 static int scmi_clock_rate_set(const struct scmi_protocol_handle *ph, in scmi_clock_rate_set() argument
246 struct clock_info *ci = ph->get_priv(ph); in scmi_clock_rate_set()
248 ret = ph->xops->xfer_get_init(ph, CLOCK_RATE_SET, sizeof(*cfg), 0, &t); in scmi_clock_rate_set()
263 ret = ph->xops->do_xfer_with_response(ph, t); in scmi_clock_rate_set()
265 ret = ph->xops->do_xfer(ph, t); in scmi_clock_rate_set()
270 ph->xops->xfer_put(ph, t); in scmi_clock_rate_set()
275 scmi_clock_config_set(const struct scmi_protocol_handle *ph, u32 clk_id, in scmi_clock_config_set() argument
282 ret = ph->xops->xfer_get_init(ph, CLOCK_CONFIG_SET, in scmi_clock_config_set()
291 ret = ph->xops->do_xfer(ph, t); in scmi_clock_config_set()
293 ph->xops->xfer_put(ph, t); in scmi_clock_config_set()
297 static int scmi_clock_enable(const struct scmi_protocol_handle *ph, u32 clk_id) in scmi_clock_enable() argument
299 return scmi_clock_config_set(ph, clk_id, CLOCK_ENABLE); in scmi_clock_enable()
302 static int scmi_clock_disable(const struct scmi_protocol_handle *ph, u32 clk_id) in scmi_clock_disable() argument
304 return scmi_clock_config_set(ph, clk_id, 0); in scmi_clock_disable()
307 static int scmi_clock_count_get(const struct scmi_protocol_handle *ph) in scmi_clock_count_get() argument
309 struct clock_info *ci = ph->get_priv(ph); in scmi_clock_count_get()
315 scmi_clock_info_get(const struct scmi_protocol_handle *ph, u32 clk_id) in scmi_clock_info_get() argument
317 struct clock_info *ci = ph->get_priv(ph); in scmi_clock_info_get()
335 static int scmi_clock_protocol_init(const struct scmi_protocol_handle *ph) in scmi_clock_protocol_init() argument
341 ph->xops->version_get(ph, &version); in scmi_clock_protocol_init()
343 dev_dbg(ph->dev, "Clock Version %d.%d\n", in scmi_clock_protocol_init()
346 cinfo = devm_kzalloc(ph->dev, sizeof(*cinfo), GFP_KERNEL); in scmi_clock_protocol_init()
350 scmi_clock_protocol_attributes_get(ph, cinfo); in scmi_clock_protocol_init()
352 cinfo->clk = devm_kcalloc(ph->dev, cinfo->num_clocks, in scmi_clock_protocol_init()
360 ret = scmi_clock_attributes_get(ph, clkid, clk); in scmi_clock_protocol_init()
362 scmi_clock_describe_rates_get(ph, clkid, clk); in scmi_clock_protocol_init()
366 return ph->set_priv(ph, cinfo); in scmi_clock_protocol_init()