1 // SPDX-License-Identifier: GPL-2.0
3 * System Control and Management Interface (SCMI) Performance Protocol
5 * Copyright (C) 2018-2022 ARM Ltd.
8 #define pr_fmt(fmt) "SCMI Notifications PERF - " fmt
10 #include <linux/bits.h>
13 #include <linux/module.h>
14 #include <linux/platform_device.h>
15 #include <linux/pm_opp.h>
16 #include <linux/scmi_protocol.h>
17 #include <linux/sort.h>
19 #include <trace/events/scmi.h>
21 #include "protocols.h"
26 enum scmi_performance_protocol_cmd {
27 PERF_DOMAIN_ATTRIBUTES = 0x3,
28 PERF_DESCRIBE_LEVELS = 0x4,
29 PERF_LIMITS_SET = 0x5,
30 PERF_LIMITS_GET = 0x6,
33 PERF_NOTIFY_LIMITS = 0x9,
34 PERF_NOTIFY_LEVEL = 0xa,
35 PERF_DESCRIBE_FASTCHANNEL = 0xb,
36 PERF_DOMAIN_NAME_GET = 0xc,
51 struct scmi_msg_resp_perf_attributes {
54 #define POWER_SCALE_IN_MILLIWATT(x) ((x) & BIT(0))
55 #define POWER_SCALE_IN_MICROWATT(x) ((x) & BIT(1))
56 __le32 stats_addr_low;
57 __le32 stats_addr_high;
61 struct scmi_msg_resp_perf_domain_attributes {
63 #define SUPPORTS_SET_LIMITS(x) ((x) & BIT(31))
64 #define SUPPORTS_SET_PERF_LVL(x) ((x) & BIT(30))
65 #define SUPPORTS_PERF_LIMIT_NOTIFY(x) ((x) & BIT(29))
66 #define SUPPORTS_PERF_LEVEL_NOTIFY(x) ((x) & BIT(28))
67 #define SUPPORTS_PERF_FASTCHANNELS(x) ((x) & BIT(27))
68 #define SUPPORTS_EXTENDED_NAMES(x) ((x) & BIT(26))
70 __le32 sustained_freq_khz;
71 __le32 sustained_perf_level;
72 u8 name[SCMI_SHORT_NAME_MAX_SIZE];
75 struct scmi_msg_perf_describe_levels {
80 struct scmi_perf_set_limits {
86 struct scmi_perf_get_limits {
91 struct scmi_perf_set_level {
96 struct scmi_perf_notify_level_or_limits {
101 struct scmi_perf_limits_notify_payld {
108 struct scmi_perf_level_notify_payld {
111 __le32 performance_level;
114 struct scmi_msg_resp_perf_describe_levels {
116 __le16 num_remaining;
120 __le16 transition_latency_us;
125 struct perf_dom_info {
128 bool perf_limit_notify;
129 bool perf_level_notify;
130 bool perf_fastchannels;
132 u32 sustained_freq_khz;
133 u32 sustained_perf_level;
135 char name[SCMI_MAX_STR_SIZE];
136 struct scmi_opp opp[MAX_OPPS];
137 struct scmi_fc_info *fc_info;
140 struct scmi_perf_info {
143 enum scmi_power_scale power_scale;
146 struct perf_dom_info *dom_info;
149 static enum scmi_performance_protocol_cmd evt_2_cmd[] = {
154 static int scmi_perf_attributes_get(const struct scmi_protocol_handle *ph,
155 struct scmi_perf_info *pi)
159 struct scmi_msg_resp_perf_attributes *attr;
161 ret = ph->xops->xfer_get_init(ph, PROTOCOL_ATTRIBUTES, 0,
168 ret = ph->xops->do_xfer(ph, t);
170 u16 flags = le16_to_cpu(attr->flags);
172 pi->num_domains = le16_to_cpu(attr->num_domains);
174 if (POWER_SCALE_IN_MILLIWATT(flags))
175 pi->power_scale = SCMI_POWER_MILLIWATTS;
176 if (PROTOCOL_REV_MAJOR(pi->version) >= 0x3)
177 if (POWER_SCALE_IN_MICROWATT(flags))
178 pi->power_scale = SCMI_POWER_MICROWATTS;
180 pi->stats_addr = le32_to_cpu(attr->stats_addr_low) |
181 (u64)le32_to_cpu(attr->stats_addr_high) << 32;
182 pi->stats_size = le32_to_cpu(attr->stats_size);
185 ph->xops->xfer_put(ph, t);
190 scmi_perf_domain_attributes_get(const struct scmi_protocol_handle *ph,
191 u32 domain, struct perf_dom_info *dom_info,
197 struct scmi_msg_resp_perf_domain_attributes *attr;
199 ret = ph->xops->xfer_get_init(ph, PERF_DOMAIN_ATTRIBUTES,
200 sizeof(domain), sizeof(*attr), &t);
204 put_unaligned_le32(domain, t->tx.buf);
207 ret = ph->xops->do_xfer(ph, t);
209 flags = le32_to_cpu(attr->flags);
211 dom_info->set_limits = SUPPORTS_SET_LIMITS(flags);
212 dom_info->set_perf = SUPPORTS_SET_PERF_LVL(flags);
213 dom_info->perf_limit_notify = SUPPORTS_PERF_LIMIT_NOTIFY(flags);
214 dom_info->perf_level_notify = SUPPORTS_PERF_LEVEL_NOTIFY(flags);
215 dom_info->perf_fastchannels = SUPPORTS_PERF_FASTCHANNELS(flags);
216 dom_info->sustained_freq_khz =
217 le32_to_cpu(attr->sustained_freq_khz);
218 dom_info->sustained_perf_level =
219 le32_to_cpu(attr->sustained_perf_level);
220 if (!dom_info->sustained_freq_khz ||
221 !dom_info->sustained_perf_level)
222 /* CPUFreq converts to kHz, hence default 1000 */
223 dom_info->mult_factor = 1000;
225 dom_info->mult_factor =
226 (dom_info->sustained_freq_khz * 1000) /
227 dom_info->sustained_perf_level;
228 strscpy(dom_info->name, attr->name, SCMI_SHORT_NAME_MAX_SIZE);
231 ph->xops->xfer_put(ph, t);
234 * If supported overwrite short name with the extended one;
235 * on error just carry on and use already provided short name.
237 if (!ret && PROTOCOL_REV_MAJOR(version) >= 0x3 &&
238 SUPPORTS_EXTENDED_NAMES(flags))
239 ph->hops->extended_name_get(ph, PERF_DOMAIN_NAME_GET, domain,
240 dom_info->name, SCMI_MAX_STR_SIZE);
245 static int opp_cmp_func(const void *opp1, const void *opp2)
247 const struct scmi_opp *t1 = opp1, *t2 = opp2;
249 return t1->perf - t2->perf;
252 struct scmi_perf_ipriv {
254 struct perf_dom_info *perf_dom;
257 static void iter_perf_levels_prepare_message(void *message,
258 unsigned int desc_index,
261 struct scmi_msg_perf_describe_levels *msg = message;
262 const struct scmi_perf_ipriv *p = priv;
264 msg->domain = cpu_to_le32(p->domain);
265 /* Set the number of OPPs to be skipped/already read */
266 msg->level_index = cpu_to_le32(desc_index);
269 static int iter_perf_levels_update_state(struct scmi_iterator_state *st,
270 const void *response, void *priv)
272 const struct scmi_msg_resp_perf_describe_levels *r = response;
274 st->num_returned = le16_to_cpu(r->num_returned);
275 st->num_remaining = le16_to_cpu(r->num_remaining);
281 iter_perf_levels_process_response(const struct scmi_protocol_handle *ph,
282 const void *response,
283 struct scmi_iterator_state *st, void *priv)
285 struct scmi_opp *opp;
286 const struct scmi_msg_resp_perf_describe_levels *r = response;
287 struct scmi_perf_ipriv *p = priv;
289 opp = &p->perf_dom->opp[st->desc_index + st->loop_idx];
290 opp->perf = le32_to_cpu(r->opp[st->loop_idx].perf_val);
291 opp->power = le32_to_cpu(r->opp[st->loop_idx].power);
292 opp->trans_latency_us =
293 le16_to_cpu(r->opp[st->loop_idx].transition_latency_us);
294 p->perf_dom->opp_count++;
296 dev_dbg(ph->dev, "Level %d Power %d Latency %dus\n",
297 opp->perf, opp->power, opp->trans_latency_us);
303 scmi_perf_describe_levels_get(const struct scmi_protocol_handle *ph, u32 domain,
304 struct perf_dom_info *perf_dom)
308 struct scmi_iterator_ops ops = {
309 .prepare_message = iter_perf_levels_prepare_message,
310 .update_state = iter_perf_levels_update_state,
311 .process_response = iter_perf_levels_process_response,
313 struct scmi_perf_ipriv ppriv = {
315 .perf_dom = perf_dom,
318 iter = ph->hops->iter_response_init(ph, &ops, MAX_OPPS,
319 PERF_DESCRIBE_LEVELS,
320 sizeof(struct scmi_msg_perf_describe_levels),
323 return PTR_ERR(iter);
325 ret = ph->hops->iter_response_run(iter);
329 if (perf_dom->opp_count)
330 sort(perf_dom->opp, perf_dom->opp_count,
331 sizeof(struct scmi_opp), opp_cmp_func, NULL);
336 static int scmi_perf_mb_limits_set(const struct scmi_protocol_handle *ph,
337 u32 domain, u32 max_perf, u32 min_perf)
341 struct scmi_perf_set_limits *limits;
343 ret = ph->xops->xfer_get_init(ph, PERF_LIMITS_SET,
344 sizeof(*limits), 0, &t);
349 limits->domain = cpu_to_le32(domain);
350 limits->max_level = cpu_to_le32(max_perf);
351 limits->min_level = cpu_to_le32(min_perf);
353 ret = ph->xops->do_xfer(ph, t);
355 ph->xops->xfer_put(ph, t);
359 static int scmi_perf_limits_set(const struct scmi_protocol_handle *ph,
360 u32 domain, u32 max_perf, u32 min_perf)
362 struct scmi_perf_info *pi = ph->get_priv(ph);
363 struct perf_dom_info *dom = pi->dom_info + domain;
365 if (PROTOCOL_REV_MAJOR(pi->version) >= 0x3 && !max_perf && !min_perf)
368 if (dom->fc_info && dom->fc_info[PERF_FC_LIMIT].set_addr) {
369 struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LIMIT];
371 trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LIMITS_SET,
372 domain, min_perf, max_perf);
373 iowrite32(max_perf, fci->set_addr);
374 iowrite32(min_perf, fci->set_addr + 4);
375 ph->hops->fastchannel_db_ring(fci->set_db);
379 return scmi_perf_mb_limits_set(ph, domain, max_perf, min_perf);
382 static int scmi_perf_mb_limits_get(const struct scmi_protocol_handle *ph,
383 u32 domain, u32 *max_perf, u32 *min_perf)
387 struct scmi_perf_get_limits *limits;
389 ret = ph->xops->xfer_get_init(ph, PERF_LIMITS_GET,
390 sizeof(__le32), 0, &t);
394 put_unaligned_le32(domain, t->tx.buf);
396 ret = ph->xops->do_xfer(ph, t);
400 *max_perf = le32_to_cpu(limits->max_level);
401 *min_perf = le32_to_cpu(limits->min_level);
404 ph->xops->xfer_put(ph, t);
408 static int scmi_perf_limits_get(const struct scmi_protocol_handle *ph,
409 u32 domain, u32 *max_perf, u32 *min_perf)
411 struct scmi_perf_info *pi = ph->get_priv(ph);
412 struct perf_dom_info *dom = pi->dom_info + domain;
414 if (dom->fc_info && dom->fc_info[PERF_FC_LIMIT].get_addr) {
415 struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LIMIT];
417 *max_perf = ioread32(fci->get_addr);
418 *min_perf = ioread32(fci->get_addr + 4);
419 trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LIMITS_GET,
420 domain, *min_perf, *max_perf);
424 return scmi_perf_mb_limits_get(ph, domain, max_perf, min_perf);
427 static int scmi_perf_mb_level_set(const struct scmi_protocol_handle *ph,
428 u32 domain, u32 level, bool poll)
432 struct scmi_perf_set_level *lvl;
434 ret = ph->xops->xfer_get_init(ph, PERF_LEVEL_SET, sizeof(*lvl), 0, &t);
438 t->hdr.poll_completion = poll;
440 lvl->domain = cpu_to_le32(domain);
441 lvl->level = cpu_to_le32(level);
443 ret = ph->xops->do_xfer(ph, t);
445 ph->xops->xfer_put(ph, t);
449 static int scmi_perf_level_set(const struct scmi_protocol_handle *ph,
450 u32 domain, u32 level, bool poll)
452 struct scmi_perf_info *pi = ph->get_priv(ph);
453 struct perf_dom_info *dom = pi->dom_info + domain;
455 if (dom->fc_info && dom->fc_info[PERF_FC_LEVEL].set_addr) {
456 struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LEVEL];
458 trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LEVEL_SET,
460 iowrite32(level, fci->set_addr);
461 ph->hops->fastchannel_db_ring(fci->set_db);
465 return scmi_perf_mb_level_set(ph, domain, level, poll);
468 static int scmi_perf_mb_level_get(const struct scmi_protocol_handle *ph,
469 u32 domain, u32 *level, bool poll)
474 ret = ph->xops->xfer_get_init(ph, PERF_LEVEL_GET,
475 sizeof(u32), sizeof(u32), &t);
479 t->hdr.poll_completion = poll;
480 put_unaligned_le32(domain, t->tx.buf);
482 ret = ph->xops->do_xfer(ph, t);
484 *level = get_unaligned_le32(t->rx.buf);
486 ph->xops->xfer_put(ph, t);
490 static int scmi_perf_level_get(const struct scmi_protocol_handle *ph,
491 u32 domain, u32 *level, bool poll)
493 struct scmi_perf_info *pi = ph->get_priv(ph);
494 struct perf_dom_info *dom = pi->dom_info + domain;
496 if (dom->fc_info && dom->fc_info[PERF_FC_LEVEL].get_addr) {
497 *level = ioread32(dom->fc_info[PERF_FC_LEVEL].get_addr);
498 trace_scmi_fc_call(SCMI_PROTOCOL_PERF, PERF_LEVEL_GET,
503 return scmi_perf_mb_level_get(ph, domain, level, poll);
506 static int scmi_perf_level_limits_notify(const struct scmi_protocol_handle *ph,
507 u32 domain, int message_id,
512 struct scmi_perf_notify_level_or_limits *notify;
514 ret = ph->xops->xfer_get_init(ph, message_id, sizeof(*notify), 0, &t);
519 notify->domain = cpu_to_le32(domain);
520 notify->notify_enable = enable ? cpu_to_le32(BIT(0)) : 0;
522 ret = ph->xops->do_xfer(ph, t);
524 ph->xops->xfer_put(ph, t);
528 static void scmi_perf_domain_init_fc(const struct scmi_protocol_handle *ph,
529 u32 domain, struct scmi_fc_info **p_fc)
531 struct scmi_fc_info *fc;
533 fc = devm_kcalloc(ph->dev, PERF_FC_MAX, sizeof(*fc), GFP_KERNEL);
537 ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
538 PERF_LEVEL_SET, 4, domain,
539 &fc[PERF_FC_LEVEL].set_addr,
540 &fc[PERF_FC_LEVEL].set_db);
542 ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
543 PERF_LEVEL_GET, 4, domain,
544 &fc[PERF_FC_LEVEL].get_addr, NULL);
546 ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
547 PERF_LIMITS_SET, 8, domain,
548 &fc[PERF_FC_LIMIT].set_addr,
549 &fc[PERF_FC_LIMIT].set_db);
551 ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
552 PERF_LIMITS_GET, 8, domain,
553 &fc[PERF_FC_LIMIT].get_addr, NULL);
558 /* Device specific ops */
559 static int scmi_dev_domain_id(struct device *dev)
561 struct of_phandle_args clkspec;
563 if (of_parse_phandle_with_args(dev->of_node, "clocks", "#clock-cells",
567 return clkspec.args[0];
570 static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
573 int idx, ret, domain;
575 struct scmi_opp *opp;
576 struct perf_dom_info *dom;
577 struct scmi_perf_info *pi = ph->get_priv(ph);
579 domain = scmi_dev_domain_id(dev);
583 dom = pi->dom_info + domain;
585 for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) {
586 freq = opp->perf * dom->mult_factor;
588 ret = dev_pm_opp_add(dev, freq, 0);
590 dev_warn(dev, "failed to add opp %luHz\n", freq);
593 freq = (--opp)->perf * dom->mult_factor;
594 dev_pm_opp_remove(dev, freq);
603 scmi_dvfs_transition_latency_get(const struct scmi_protocol_handle *ph,
606 struct perf_dom_info *dom;
607 struct scmi_perf_info *pi = ph->get_priv(ph);
608 int domain = scmi_dev_domain_id(dev);
613 dom = pi->dom_info + domain;
615 return dom->opp[dom->opp_count - 1].trans_latency_us * 1000;
618 static int scmi_dvfs_freq_set(const struct scmi_protocol_handle *ph, u32 domain,
619 unsigned long freq, bool poll)
621 struct scmi_perf_info *pi = ph->get_priv(ph);
622 struct perf_dom_info *dom = pi->dom_info + domain;
624 return scmi_perf_level_set(ph, domain, freq / dom->mult_factor, poll);
627 static int scmi_dvfs_freq_get(const struct scmi_protocol_handle *ph, u32 domain,
628 unsigned long *freq, bool poll)
632 struct scmi_perf_info *pi = ph->get_priv(ph);
633 struct perf_dom_info *dom = pi->dom_info + domain;
635 ret = scmi_perf_level_get(ph, domain, &level, poll);
637 *freq = level * dom->mult_factor;
642 static int scmi_dvfs_est_power_get(const struct scmi_protocol_handle *ph,
643 u32 domain, unsigned long *freq,
644 unsigned long *power)
646 struct scmi_perf_info *pi = ph->get_priv(ph);
647 struct perf_dom_info *dom;
648 unsigned long opp_freq;
649 int idx, ret = -EINVAL;
650 struct scmi_opp *opp;
652 dom = pi->dom_info + domain;
656 for (opp = dom->opp, idx = 0; idx < dom->opp_count; idx++, opp++) {
657 opp_freq = opp->perf * dom->mult_factor;
658 if (opp_freq < *freq)
670 static bool scmi_fast_switch_possible(const struct scmi_protocol_handle *ph,
673 struct perf_dom_info *dom;
674 struct scmi_perf_info *pi = ph->get_priv(ph);
676 dom = pi->dom_info + scmi_dev_domain_id(dev);
678 return dom->fc_info && dom->fc_info[PERF_FC_LEVEL].set_addr;
681 static enum scmi_power_scale
682 scmi_power_scale_get(const struct scmi_protocol_handle *ph)
684 struct scmi_perf_info *pi = ph->get_priv(ph);
686 return pi->power_scale;
689 static const struct scmi_perf_proto_ops perf_proto_ops = {
690 .limits_set = scmi_perf_limits_set,
691 .limits_get = scmi_perf_limits_get,
692 .level_set = scmi_perf_level_set,
693 .level_get = scmi_perf_level_get,
694 .device_domain_id = scmi_dev_domain_id,
695 .transition_latency_get = scmi_dvfs_transition_latency_get,
696 .device_opps_add = scmi_dvfs_device_opps_add,
697 .freq_set = scmi_dvfs_freq_set,
698 .freq_get = scmi_dvfs_freq_get,
699 .est_power_get = scmi_dvfs_est_power_get,
700 .fast_switch_possible = scmi_fast_switch_possible,
701 .power_scale_get = scmi_power_scale_get,
704 static int scmi_perf_set_notify_enabled(const struct scmi_protocol_handle *ph,
705 u8 evt_id, u32 src_id, bool enable)
709 if (evt_id >= ARRAY_SIZE(evt_2_cmd))
712 cmd_id = evt_2_cmd[evt_id];
713 ret = scmi_perf_level_limits_notify(ph, src_id, cmd_id, enable);
715 pr_debug("FAIL_ENABLED - evt[%X] dom[%d] - ret:%d\n",
716 evt_id, src_id, ret);
721 static void *scmi_perf_fill_custom_report(const struct scmi_protocol_handle *ph,
722 u8 evt_id, ktime_t timestamp,
723 const void *payld, size_t payld_sz,
724 void *report, u32 *src_id)
729 case SCMI_EVENT_PERFORMANCE_LIMITS_CHANGED:
731 const struct scmi_perf_limits_notify_payld *p = payld;
732 struct scmi_perf_limits_report *r = report;
734 if (sizeof(*p) != payld_sz)
737 r->timestamp = timestamp;
738 r->agent_id = le32_to_cpu(p->agent_id);
739 r->domain_id = le32_to_cpu(p->domain_id);
740 r->range_max = le32_to_cpu(p->range_max);
741 r->range_min = le32_to_cpu(p->range_min);
742 *src_id = r->domain_id;
746 case SCMI_EVENT_PERFORMANCE_LEVEL_CHANGED:
748 const struct scmi_perf_level_notify_payld *p = payld;
749 struct scmi_perf_level_report *r = report;
751 if (sizeof(*p) != payld_sz)
754 r->timestamp = timestamp;
755 r->agent_id = le32_to_cpu(p->agent_id);
756 r->domain_id = le32_to_cpu(p->domain_id);
757 r->performance_level = le32_to_cpu(p->performance_level);
758 *src_id = r->domain_id;
769 static int scmi_perf_get_num_sources(const struct scmi_protocol_handle *ph)
771 struct scmi_perf_info *pi = ph->get_priv(ph);
776 return pi->num_domains;
779 static const struct scmi_event perf_events[] = {
781 .id = SCMI_EVENT_PERFORMANCE_LIMITS_CHANGED,
782 .max_payld_sz = sizeof(struct scmi_perf_limits_notify_payld),
783 .max_report_sz = sizeof(struct scmi_perf_limits_report),
786 .id = SCMI_EVENT_PERFORMANCE_LEVEL_CHANGED,
787 .max_payld_sz = sizeof(struct scmi_perf_level_notify_payld),
788 .max_report_sz = sizeof(struct scmi_perf_level_report),
792 static const struct scmi_event_ops perf_event_ops = {
793 .get_num_sources = scmi_perf_get_num_sources,
794 .set_notify_enabled = scmi_perf_set_notify_enabled,
795 .fill_custom_report = scmi_perf_fill_custom_report,
798 static const struct scmi_protocol_events perf_protocol_events = {
799 .queue_sz = SCMI_PROTO_QUEUE_SZ,
800 .ops = &perf_event_ops,
802 .num_events = ARRAY_SIZE(perf_events),
805 static int scmi_perf_protocol_init(const struct scmi_protocol_handle *ph)
809 struct scmi_perf_info *pinfo;
811 ret = ph->xops->version_get(ph, &version);
815 dev_dbg(ph->dev, "Performance Version %d.%d\n",
816 PROTOCOL_REV_MAJOR(version), PROTOCOL_REV_MINOR(version));
818 pinfo = devm_kzalloc(ph->dev, sizeof(*pinfo), GFP_KERNEL);
822 ret = scmi_perf_attributes_get(ph, pinfo);
826 pinfo->dom_info = devm_kcalloc(ph->dev, pinfo->num_domains,
827 sizeof(*pinfo->dom_info), GFP_KERNEL);
828 if (!pinfo->dom_info)
831 for (domain = 0; domain < pinfo->num_domains; domain++) {
832 struct perf_dom_info *dom = pinfo->dom_info + domain;
834 scmi_perf_domain_attributes_get(ph, domain, dom, version);
835 scmi_perf_describe_levels_get(ph, domain, dom);
837 if (dom->perf_fastchannels)
838 scmi_perf_domain_init_fc(ph, domain, &dom->fc_info);
841 pinfo->version = version;
843 return ph->set_priv(ph, pinfo);
846 static const struct scmi_protocol scmi_perf = {
847 .id = SCMI_PROTOCOL_PERF,
848 .owner = THIS_MODULE,
849 .instance_init = &scmi_perf_protocol_init,
850 .ops = &perf_proto_ops,
851 .events = &perf_protocol_events,
854 DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(perf, scmi_perf)