#define pr_fmt(fmt) …
#include <linux/bits.h>
#include <linux/hashtable.h>
#include <linux/io.h>
#include <linux/log2.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_opp.h>
#include <linux/scmi_protocol.h>
#include <linux/sort.h>
#include <linux/xarray.h>
#include <trace/events/scmi.h>
#include "protocols.h"
#include "notify.h"
#define SCMI_PROTOCOL_SUPPORTED_VERSION …
#define MAX_OPPS …
enum scmi_performance_protocol_cmd { … };
enum { … };
struct scmi_opp { … };
struct scmi_msg_resp_perf_attributes { … };
struct scmi_msg_resp_perf_domain_attributes { … };
struct scmi_msg_perf_describe_levels { … };
struct scmi_perf_set_limits { … };
struct scmi_perf_get_limits { … };
struct scmi_perf_set_level { … };
struct scmi_perf_notify_level_or_limits { … };
struct scmi_perf_limits_notify_payld { … };
struct scmi_perf_level_notify_payld { … };
struct scmi_msg_resp_perf_describe_levels { … };
struct scmi_msg_resp_perf_describe_levels_v4 { … };
struct perf_dom_info { … };
#define LOOKUP_BY_FREQ(__htp, __freq) …
struct scmi_perf_info { … };
static enum scmi_performance_protocol_cmd evt_2_cmd[] = …;
static int scmi_perf_attributes_get(const struct scmi_protocol_handle *ph,
struct scmi_perf_info *pi)
{ … }
static void scmi_perf_xa_destroy(void *data)
{ … }
static int
scmi_perf_domain_attributes_get(const struct scmi_protocol_handle *ph,
struct perf_dom_info *dom_info,
bool notify_lim_cmd, bool notify_lvl_cmd,
u32 version)
{ … }
static int opp_cmp_func(const void *opp1, const void *opp2)
{ … }
struct scmi_perf_ipriv { … };
static void iter_perf_levels_prepare_message(void *message,
unsigned int desc_index,
const void *priv)
{ … }
static int iter_perf_levels_update_state(struct scmi_iterator_state *st,
const void *response, void *priv)
{ … }
static inline void
process_response_opp(struct device *dev, struct perf_dom_info *dom,
struct scmi_opp *opp, unsigned int loop_idx,
const struct scmi_msg_resp_perf_describe_levels *r)
{ … }
static inline void
process_response_opp_v4(struct device *dev, struct perf_dom_info *dom,
struct scmi_opp *opp, unsigned int loop_idx,
const struct scmi_msg_resp_perf_describe_levels_v4 *r)
{ … }
static int
iter_perf_levels_process_response(const struct scmi_protocol_handle *ph,
const void *response,
struct scmi_iterator_state *st, void *priv)
{ … }
static int
scmi_perf_describe_levels_get(const struct scmi_protocol_handle *ph,
struct perf_dom_info *perf_dom, u32 version)
{ … }
static int scmi_perf_num_domains_get(const struct scmi_protocol_handle *ph)
{ … }
static inline struct perf_dom_info *
scmi_perf_domain_lookup(const struct scmi_protocol_handle *ph, u32 domain)
{ … }
static const struct scmi_perf_domain_info *
scmi_perf_info_get(const struct scmi_protocol_handle *ph, u32 domain)
{ … }
static int scmi_perf_msg_limits_set(const struct scmi_protocol_handle *ph,
u32 domain, u32 max_perf, u32 min_perf)
{ … }
static int __scmi_perf_limits_set(const struct scmi_protocol_handle *ph,
struct perf_dom_info *dom, u32 max_perf,
u32 min_perf)
{ … }
static int scmi_perf_limits_set(const struct scmi_protocol_handle *ph,
u32 domain, u32 max_perf, u32 min_perf)
{ … }
static int scmi_perf_msg_limits_get(const struct scmi_protocol_handle *ph,
u32 domain, u32 *max_perf, u32 *min_perf)
{ … }
static int __scmi_perf_limits_get(const struct scmi_protocol_handle *ph,
struct perf_dom_info *dom, u32 *max_perf,
u32 *min_perf)
{ … }
static int scmi_perf_limits_get(const struct scmi_protocol_handle *ph,
u32 domain, u32 *max_perf, u32 *min_perf)
{ … }
static int scmi_perf_msg_level_set(const struct scmi_protocol_handle *ph,
u32 domain, u32 level, bool poll)
{ … }
static int __scmi_perf_level_set(const struct scmi_protocol_handle *ph,
struct perf_dom_info *dom, u32 level,
bool poll)
{ … }
static int scmi_perf_level_set(const struct scmi_protocol_handle *ph,
u32 domain, u32 level, bool poll)
{ … }
static int scmi_perf_msg_level_get(const struct scmi_protocol_handle *ph,
u32 domain, u32 *level, bool poll)
{ … }
static int __scmi_perf_level_get(const struct scmi_protocol_handle *ph,
struct perf_dom_info *dom, u32 *level,
bool poll)
{ … }
static int scmi_perf_level_get(const struct scmi_protocol_handle *ph,
u32 domain, u32 *level, bool poll)
{ … }
static int scmi_perf_level_limits_notify(const struct scmi_protocol_handle *ph,
u32 domain, int message_id,
bool enable)
{ … }
static void scmi_perf_domain_init_fc(const struct scmi_protocol_handle *ph,
struct perf_dom_info *dom)
{ … }
static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
struct device *dev, u32 domain)
{ … }
static int
scmi_dvfs_transition_latency_get(const struct scmi_protocol_handle *ph,
u32 domain)
{ … }
static int
scmi_dvfs_rate_limit_get(const struct scmi_protocol_handle *ph,
u32 domain, u32 *rate_limit)
{ … }
static int scmi_dvfs_freq_set(const struct scmi_protocol_handle *ph, u32 domain,
unsigned long freq, bool poll)
{ … }
static int scmi_dvfs_freq_get(const struct scmi_protocol_handle *ph, u32 domain,
unsigned long *freq, bool poll)
{ … }
static int scmi_dvfs_est_power_get(const struct scmi_protocol_handle *ph,
u32 domain, unsigned long *freq,
unsigned long *power)
{ … }
static bool scmi_fast_switch_possible(const struct scmi_protocol_handle *ph,
u32 domain)
{ … }
static int scmi_fast_switch_rate_limit(const struct scmi_protocol_handle *ph,
u32 domain, u32 *rate_limit)
{ … }
static enum scmi_power_scale
scmi_power_scale_get(const struct scmi_protocol_handle *ph)
{ … }
static const struct scmi_perf_proto_ops perf_proto_ops = …;
static bool scmi_perf_notify_supported(const struct scmi_protocol_handle *ph,
u8 evt_id, u32 src_id)
{ … }
static int scmi_perf_set_notify_enabled(const struct scmi_protocol_handle *ph,
u8 evt_id, u32 src_id, bool enable)
{ … }
static int
scmi_perf_xlate_opp_to_freq(struct perf_dom_info *dom,
unsigned int index, unsigned long *freq)
{ … }
static void *scmi_perf_fill_custom_report(const struct scmi_protocol_handle *ph,
u8 evt_id, ktime_t timestamp,
const void *payld, size_t payld_sz,
void *report, u32 *src_id)
{ … }
static int scmi_perf_get_num_sources(const struct scmi_protocol_handle *ph)
{ … }
static const struct scmi_event perf_events[] = …;
static const struct scmi_event_ops perf_event_ops = …;
static const struct scmi_protocol_events perf_protocol_events = …;
static int scmi_perf_protocol_init(const struct scmi_protocol_handle *ph)
{ … }
static const struct scmi_protocol scmi_perf = …;
DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(perf, scmi_perf)