Lines Matching refs:ph

133 static int scmi_powercap_notify(const struct scmi_protocol_handle *ph,
137 scmi_powercap_attributes_get(const struct scmi_protocol_handle *ph, in scmi_powercap_attributes_get() argument
143 ret = ph->xops->xfer_get_init(ph, PROTOCOL_ATTRIBUTES, 0, in scmi_powercap_attributes_get()
148 ret = ph->xops->do_xfer(ph, t); in scmi_powercap_attributes_get()
156 ph->xops->xfer_put(ph, t); in scmi_powercap_attributes_get()
178 scmi_powercap_domain_attributes_get(const struct scmi_protocol_handle *ph, in scmi_powercap_domain_attributes_get() argument
187 ret = ph->xops->xfer_get_init(ph, POWERCAP_DOMAIN_ATTRIBUTES, in scmi_powercap_domain_attributes_get()
195 ret = ph->xops->do_xfer(ph, t); in scmi_powercap_domain_attributes_get()
229 dev_err(ph->dev, in scmi_powercap_domain_attributes_get()
243 dev_err(ph->dev, in scmi_powercap_domain_attributes_get()
257 dev_err(ph->dev, in scmi_powercap_domain_attributes_get()
265 ph->xops->xfer_put(ph, t); in scmi_powercap_domain_attributes_get()
272 ph->hops->extended_name_get(ph, POWERCAP_DOMAIN_NAME_GET, in scmi_powercap_domain_attributes_get()
279 static int scmi_powercap_num_domains_get(const struct scmi_protocol_handle *ph) in scmi_powercap_num_domains_get() argument
281 struct powercap_info *pi = ph->get_priv(ph); in scmi_powercap_num_domains_get()
287 scmi_powercap_dom_info_get(const struct scmi_protocol_handle *ph, u32 domain_id) in scmi_powercap_dom_info_get() argument
289 struct powercap_info *pi = ph->get_priv(ph); in scmi_powercap_dom_info_get()
297 static int scmi_powercap_xfer_cap_get(const struct scmi_protocol_handle *ph, in scmi_powercap_xfer_cap_get() argument
303 ret = ph->xops->xfer_get_init(ph, POWERCAP_CAP_GET, sizeof(u32), in scmi_powercap_xfer_cap_get()
309 ret = ph->xops->do_xfer(ph, t); in scmi_powercap_xfer_cap_get()
313 ph->xops->xfer_put(ph, t); in scmi_powercap_xfer_cap_get()
318 static int __scmi_powercap_cap_get(const struct scmi_protocol_handle *ph, in __scmi_powercap_cap_get() argument
329 return scmi_powercap_xfer_cap_get(ph, dom->id, power_cap); in __scmi_powercap_cap_get()
332 static int scmi_powercap_cap_get(const struct scmi_protocol_handle *ph, in scmi_powercap_cap_get() argument
340 dom = scmi_powercap_dom_info_get(ph, domain_id); in scmi_powercap_cap_get()
344 return __scmi_powercap_cap_get(ph, dom, power_cap); in scmi_powercap_cap_get()
347 static int scmi_powercap_xfer_cap_set(const struct scmi_protocol_handle *ph, in scmi_powercap_xfer_cap_set() argument
355 ret = ph->xops->xfer_get_init(ph, POWERCAP_CAP_SET, in scmi_powercap_xfer_cap_set()
368 ret = ph->xops->do_xfer(ph, t); in scmi_powercap_xfer_cap_set()
370 ret = ph->xops->do_xfer_with_response(ph, t); in scmi_powercap_xfer_cap_set()
376 dev_dbg(ph->dev, in scmi_powercap_xfer_cap_set()
385 ph->xops->xfer_put(ph, t); in scmi_powercap_xfer_cap_set()
389 static int __scmi_powercap_cap_set(const struct scmi_protocol_handle *ph, in __scmi_powercap_cap_set() argument
396 pc = scmi_powercap_dom_info_get(ph, domain_id); in __scmi_powercap_cap_set()
408 ph->hops->fastchannel_db_ring(fci->set_db); in __scmi_powercap_cap_set()
413 ret = scmi_powercap_xfer_cap_set(ph, pc, power_cap, in __scmi_powercap_cap_set()
424 static int scmi_powercap_cap_set(const struct scmi_protocol_handle *ph, in scmi_powercap_cap_set() argument
428 struct powercap_info *pi = ph->get_priv(ph); in scmi_powercap_cap_set()
444 return __scmi_powercap_cap_set(ph, pi, domain_id, in scmi_powercap_cap_set()
448 static int scmi_powercap_xfer_pai_get(const struct scmi_protocol_handle *ph, in scmi_powercap_xfer_pai_get() argument
454 ret = ph->xops->xfer_get_init(ph, POWERCAP_PAI_GET, sizeof(u32), in scmi_powercap_xfer_pai_get()
460 ret = ph->xops->do_xfer(ph, t); in scmi_powercap_xfer_pai_get()
464 ph->xops->xfer_put(ph, t); in scmi_powercap_xfer_pai_get()
469 static int scmi_powercap_pai_get(const struct scmi_protocol_handle *ph, in scmi_powercap_pai_get() argument
473 struct powercap_info *pi = ph->get_priv(ph); in scmi_powercap_pai_get()
486 return scmi_powercap_xfer_pai_get(ph, domain_id, pai); in scmi_powercap_pai_get()
489 static int scmi_powercap_xfer_pai_set(const struct scmi_protocol_handle *ph, in scmi_powercap_xfer_pai_set() argument
496 ret = ph->xops->xfer_get_init(ph, POWERCAP_PAI_SET, in scmi_powercap_xfer_pai_set()
506 ret = ph->xops->do_xfer(ph, t); in scmi_powercap_xfer_pai_set()
508 ph->xops->xfer_put(ph, t); in scmi_powercap_xfer_pai_set()
512 static int scmi_powercap_pai_set(const struct scmi_protocol_handle *ph, in scmi_powercap_pai_set() argument
517 pc = scmi_powercap_dom_info_get(ph, domain_id); in scmi_powercap_pai_set()
528 ph->hops->fastchannel_db_ring(fci->set_db); in scmi_powercap_pai_set()
532 return scmi_powercap_xfer_pai_set(ph, domain_id, pai); in scmi_powercap_pai_set()
535 static int scmi_powercap_measurements_get(const struct scmi_protocol_handle *ph, in scmi_powercap_measurements_get() argument
544 pc = scmi_powercap_dom_info_get(ph, domain_id); in scmi_powercap_measurements_get()
548 ret = ph->xops->xfer_get_init(ph, POWERCAP_MEASUREMENTS_GET, in scmi_powercap_measurements_get()
555 ret = ph->xops->do_xfer(ph, t); in scmi_powercap_measurements_get()
561 ph->xops->xfer_put(ph, t); in scmi_powercap_measurements_get()
566 scmi_powercap_measurements_threshold_get(const struct scmi_protocol_handle *ph, in scmi_powercap_measurements_threshold_get() argument
570 struct powercap_info *pi = ph->get_priv(ph); in scmi_powercap_measurements_threshold_get()
583 scmi_powercap_measurements_threshold_set(const struct scmi_protocol_handle *ph, in scmi_powercap_measurements_threshold_set() argument
588 struct powercap_info *pi = ph->get_priv(ph); in scmi_powercap_measurements_threshold_set()
605 ret = scmi_powercap_notify(ph, domain_id, in scmi_powercap_measurements_threshold_set()
612 static int scmi_powercap_cap_enable_set(const struct scmi_protocol_handle *ph, in scmi_powercap_cap_enable_set() argument
617 struct powercap_info *pi = ph->get_priv(ph); in scmi_powercap_cap_enable_set()
630 ret = __scmi_powercap_cap_set(ph, pi, domain_id, in scmi_powercap_cap_enable_set()
634 ret = __scmi_powercap_cap_set(ph, pi, domain_id, 0, true); in scmi_powercap_cap_enable_set()
645 ret = scmi_powercap_cap_get(ph, domain_id, &power_cap); in scmi_powercap_cap_enable_set()
652 static int scmi_powercap_cap_enable_get(const struct scmi_protocol_handle *ph, in scmi_powercap_cap_enable_get() argument
657 struct powercap_info *pi = ph->get_priv(ph); in scmi_powercap_cap_enable_get()
667 ret = scmi_powercap_cap_get(ph, domain_id, &power_cap); in scmi_powercap_cap_enable_get()
691 static void scmi_powercap_domain_init_fc(const struct scmi_protocol_handle *ph, in scmi_powercap_domain_init_fc() argument
696 fc = devm_kcalloc(ph->dev, POWERCAP_FC_MAX, sizeof(*fc), GFP_KERNEL); in scmi_powercap_domain_init_fc()
700 ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL, in scmi_powercap_domain_init_fc()
705 ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL, in scmi_powercap_domain_init_fc()
709 ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL, in scmi_powercap_domain_init_fc()
714 ph->hops->fastchannel_init(ph, POWERCAP_DESCRIBE_FASTCHANNEL, in scmi_powercap_domain_init_fc()
721 static int scmi_powercap_notify(const struct scmi_protocol_handle *ph, in scmi_powercap_notify() argument
732 ret = ph->xops->xfer_get_init(ph, message_id, in scmi_powercap_notify()
754 ret = scmi_powercap_measurements_threshold_get(ph, domain, in scmi_powercap_notify()
760 dev_err(ph->dev, in scmi_powercap_notify()
766 ret = ph->xops->xfer_get_init(ph, message_id, in scmi_powercap_notify()
782 ret = ph->xops->do_xfer(ph, t); in scmi_powercap_notify()
784 ph->xops->xfer_put(ph, t); in scmi_powercap_notify()
789 scmi_powercap_set_notify_enabled(const struct scmi_protocol_handle *ph, in scmi_powercap_set_notify_enabled() argument
793 struct powercap_info *pi = ph->get_priv(ph); in scmi_powercap_set_notify_enabled()
799 ret = scmi_powercap_notify(ph, src_id, cmd_id, enable); in scmi_powercap_set_notify_enabled()
827 scmi_powercap_fill_custom_report(const struct scmi_protocol_handle *ph, in scmi_powercap_fill_custom_report() argument
876 scmi_powercap_get_num_sources(const struct scmi_protocol_handle *ph) in scmi_powercap_get_num_sources() argument
878 struct powercap_info *pi = ph->get_priv(ph); in scmi_powercap_get_num_sources()
917 scmi_powercap_protocol_init(const struct scmi_protocol_handle *ph) in scmi_powercap_protocol_init() argument
923 ret = ph->xops->version_get(ph, &version); in scmi_powercap_protocol_init()
927 dev_dbg(ph->dev, "Powercap Version %d.%d\n", in scmi_powercap_protocol_init()
930 pinfo = devm_kzalloc(ph->dev, sizeof(*pinfo), GFP_KERNEL); in scmi_powercap_protocol_init()
934 ret = scmi_powercap_attributes_get(ph, pinfo); in scmi_powercap_protocol_init()
938 pinfo->powercaps = devm_kcalloc(ph->dev, pinfo->num_domains, in scmi_powercap_protocol_init()
944 pinfo->states = devm_kcalloc(ph->dev, pinfo->num_domains, in scmi_powercap_protocol_init()
956 ret = scmi_powercap_domain_attributes_get(ph, pinfo, domain); in scmi_powercap_protocol_init()
961 scmi_powercap_domain_init_fc(ph, domain, in scmi_powercap_protocol_init()
966 ret = __scmi_powercap_cap_get(ph, in scmi_powercap_protocol_init()
978 return ph->set_priv(ph, pinfo); in scmi_powercap_protocol_init()