Lines Matching refs:ph

179 static int scmi_perf_attributes_get(const struct scmi_protocol_handle *ph,  in scmi_perf_attributes_get()  argument
186 ret = ph->xops->xfer_get_init(ph, PROTOCOL_ATTRIBUTES, 0, in scmi_perf_attributes_get()
193 ret = ph->xops->do_xfer(ph, t); in scmi_perf_attributes_get()
204 ph->xops->xfer_put(ph, t); in scmi_perf_attributes_get()
209 scmi_perf_domain_attributes_get(const struct scmi_protocol_handle *ph, in scmi_perf_domain_attributes_get() argument
216 ret = ph->xops->xfer_get_init(ph, PERF_DOMAIN_ATTRIBUTES, in scmi_perf_domain_attributes_get()
224 ret = ph->xops->do_xfer(ph, t); in scmi_perf_domain_attributes_get()
248 ph->xops->xfer_put(ph, t); in scmi_perf_domain_attributes_get()
260 scmi_perf_describe_levels_get(const struct scmi_protocol_handle *ph, u32 domain, in scmi_perf_describe_levels_get() argument
271 ret = ph->xops->xfer_get_init(ph, PERF_DESCRIBE_LEVELS, in scmi_perf_describe_levels_get()
284 ret = ph->xops->do_xfer(ph, t); in scmi_perf_describe_levels_get()
291 dev_err(ph->dev, "No. of OPPs exceeded MAX_OPPS"); in scmi_perf_describe_levels_get()
302 dev_dbg(ph->dev, "Level %d Power %d Latency %dus\n", in scmi_perf_describe_levels_get()
308 ph->xops->reset_rx_to_maxsz(ph, t); in scmi_perf_describe_levels_get()
316 ph->xops->xfer_put(ph, t); in scmi_perf_describe_levels_get()
356 static int scmi_perf_mb_limits_set(const struct scmi_protocol_handle *ph, in scmi_perf_mb_limits_set() argument
363 ret = ph->xops->xfer_get_init(ph, PERF_LIMITS_SET, in scmi_perf_mb_limits_set()
373 ret = ph->xops->do_xfer(ph, t); in scmi_perf_mb_limits_set()
375 ph->xops->xfer_put(ph, t); in scmi_perf_mb_limits_set()
379 static int scmi_perf_limits_set(const struct scmi_protocol_handle *ph, in scmi_perf_limits_set() argument
382 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_perf_limits_set()
392 return scmi_perf_mb_limits_set(ph, domain, max_perf, min_perf); in scmi_perf_limits_set()
395 static int scmi_perf_mb_limits_get(const struct scmi_protocol_handle *ph, in scmi_perf_mb_limits_get() argument
402 ret = ph->xops->xfer_get_init(ph, PERF_LIMITS_GET, in scmi_perf_mb_limits_get()
409 ret = ph->xops->do_xfer(ph, t); in scmi_perf_mb_limits_get()
417 ph->xops->xfer_put(ph, t); in scmi_perf_mb_limits_get()
421 static int scmi_perf_limits_get(const struct scmi_protocol_handle *ph, in scmi_perf_limits_get() argument
424 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_perf_limits_get()
433 return scmi_perf_mb_limits_get(ph, domain, max_perf, min_perf); in scmi_perf_limits_get()
436 static int scmi_perf_mb_level_set(const struct scmi_protocol_handle *ph, in scmi_perf_mb_level_set() argument
443 ret = ph->xops->xfer_get_init(ph, PERF_LEVEL_SET, sizeof(*lvl), 0, &t); in scmi_perf_mb_level_set()
452 ret = ph->xops->do_xfer(ph, t); in scmi_perf_mb_level_set()
454 ph->xops->xfer_put(ph, t); in scmi_perf_mb_level_set()
458 static int scmi_perf_level_set(const struct scmi_protocol_handle *ph, in scmi_perf_level_set() argument
461 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_perf_level_set()
470 return scmi_perf_mb_level_set(ph, domain, level, poll); in scmi_perf_level_set()
473 static int scmi_perf_mb_level_get(const struct scmi_protocol_handle *ph, in scmi_perf_mb_level_get() argument
479 ret = ph->xops->xfer_get_init(ph, PERF_LEVEL_GET, in scmi_perf_mb_level_get()
487 ret = ph->xops->do_xfer(ph, t); in scmi_perf_mb_level_get()
491 ph->xops->xfer_put(ph, t); in scmi_perf_mb_level_get()
495 static int scmi_perf_level_get(const struct scmi_protocol_handle *ph, in scmi_perf_level_get() argument
498 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_perf_level_get()
506 return scmi_perf_mb_level_get(ph, domain, level, poll); in scmi_perf_level_get()
509 static int scmi_perf_level_limits_notify(const struct scmi_protocol_handle *ph, in scmi_perf_level_limits_notify() argument
517 ret = ph->xops->xfer_get_init(ph, message_id, sizeof(*notify), 0, &t); in scmi_perf_level_limits_notify()
525 ret = ph->xops->do_xfer(ph, t); in scmi_perf_level_limits_notify()
527 ph->xops->xfer_put(ph, t); in scmi_perf_level_limits_notify()
541 scmi_perf_domain_desc_fc(const struct scmi_protocol_handle *ph, u32 domain, in scmi_perf_domain_desc_fc() argument
558 ret = ph->xops->xfer_get_init(ph, PERF_DESCRIBE_FASTCHANNEL, in scmi_perf_domain_desc_fc()
567 ret = ph->xops->do_xfer(ph, t); in scmi_perf_domain_desc_fc()
579 addr = devm_ioremap(ph->dev, phys_addr, size); in scmi_perf_domain_desc_fc()
585 db = devm_kzalloc(ph->dev, sizeof(*db), GFP_KERNEL); in scmi_perf_domain_desc_fc()
592 addr = devm_ioremap(ph->dev, phys_addr, size); in scmi_perf_domain_desc_fc()
605 ph->xops->xfer_put(ph, t); in scmi_perf_domain_desc_fc()
608 static void scmi_perf_domain_init_fc(const struct scmi_protocol_handle *ph, in scmi_perf_domain_init_fc() argument
613 fc = devm_kzalloc(ph->dev, sizeof(*fc), GFP_KERNEL); in scmi_perf_domain_init_fc()
617 scmi_perf_domain_desc_fc(ph, domain, PERF_LEVEL_SET, in scmi_perf_domain_init_fc()
619 scmi_perf_domain_desc_fc(ph, domain, PERF_LEVEL_GET, in scmi_perf_domain_init_fc()
621 scmi_perf_domain_desc_fc(ph, domain, PERF_LIMITS_SET, in scmi_perf_domain_init_fc()
623 scmi_perf_domain_desc_fc(ph, domain, PERF_LIMITS_GET, in scmi_perf_domain_init_fc()
640 static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph, in scmi_dvfs_device_opps_add() argument
647 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_dvfs_device_opps_add()
673 scmi_dvfs_transition_latency_get(const struct scmi_protocol_handle *ph, in scmi_dvfs_transition_latency_get() argument
677 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_dvfs_transition_latency_get()
688 static int scmi_dvfs_freq_set(const struct scmi_protocol_handle *ph, u32 domain, in scmi_dvfs_freq_set() argument
691 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_dvfs_freq_set()
694 return scmi_perf_level_set(ph, domain, freq / dom->mult_factor, poll); in scmi_dvfs_freq_set()
697 static int scmi_dvfs_freq_get(const struct scmi_protocol_handle *ph, u32 domain, in scmi_dvfs_freq_get() argument
702 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_dvfs_freq_get()
705 ret = scmi_perf_level_get(ph, domain, &level, poll); in scmi_dvfs_freq_get()
712 static int scmi_dvfs_est_power_get(const struct scmi_protocol_handle *ph, in scmi_dvfs_est_power_get() argument
716 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_dvfs_est_power_get()
740 static bool scmi_fast_switch_possible(const struct scmi_protocol_handle *ph, in scmi_fast_switch_possible() argument
744 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_fast_switch_possible()
751 static bool scmi_power_scale_mw_get(const struct scmi_protocol_handle *ph) in scmi_power_scale_mw_get() argument
753 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_power_scale_mw_get()
773 static int scmi_perf_set_notify_enabled(const struct scmi_protocol_handle *ph, in scmi_perf_set_notify_enabled() argument
782 ret = scmi_perf_level_limits_notify(ph, src_id, cmd_id, enable); in scmi_perf_set_notify_enabled()
790 static void *scmi_perf_fill_custom_report(const struct scmi_protocol_handle *ph, in scmi_perf_fill_custom_report() argument
838 static int scmi_perf_get_num_sources(const struct scmi_protocol_handle *ph) in scmi_perf_get_num_sources() argument
840 struct scmi_perf_info *pi = ph->get_priv(ph); in scmi_perf_get_num_sources()
874 static int scmi_perf_protocol_init(const struct scmi_protocol_handle *ph) in scmi_perf_protocol_init() argument
880 ph->xops->version_get(ph, &version); in scmi_perf_protocol_init()
882 dev_dbg(ph->dev, "Performance Version %d.%d\n", in scmi_perf_protocol_init()
885 pinfo = devm_kzalloc(ph->dev, sizeof(*pinfo), GFP_KERNEL); in scmi_perf_protocol_init()
889 scmi_perf_attributes_get(ph, pinfo); in scmi_perf_protocol_init()
891 pinfo->dom_info = devm_kcalloc(ph->dev, pinfo->num_domains, in scmi_perf_protocol_init()
899 scmi_perf_domain_attributes_get(ph, domain, dom); in scmi_perf_protocol_init()
900 scmi_perf_describe_levels_get(ph, domain, dom); in scmi_perf_protocol_init()
903 scmi_perf_domain_init_fc(ph, domain, &dom->fc_info); in scmi_perf_protocol_init()
908 return ph->set_priv(ph, pinfo); in scmi_perf_protocol_init()