#define pr_fmt(fmt) …
#include <linux/bitfield.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/scmi_protocol.h>
#include <trace/events/scmi.h>
#include "protocols.h"
#include "notify.h"
#define SCMI_PROTOCOL_SUPPORTED_VERSION …
enum scmi_powercap_protocol_cmd { … };
enum { … };
struct scmi_msg_resp_powercap_domain_attributes { … };
struct scmi_msg_powercap_set_cap_or_pai { … };
struct scmi_msg_resp_powercap_cap_set_complete { … };
struct scmi_msg_resp_powercap_meas_get { … };
struct scmi_msg_powercap_notify_cap { … };
struct scmi_msg_powercap_notify_thresh { … };
struct scmi_powercap_cap_changed_notify_payld { … };
struct scmi_powercap_meas_changed_notify_payld { … };
struct scmi_powercap_state { … };
struct powercap_info { … };
static enum scmi_powercap_protocol_cmd evt_2_cmd[] = …;
static int scmi_powercap_notify(const struct scmi_protocol_handle *ph,
u32 domain, int message_id, bool enable);
static int
scmi_powercap_attributes_get(const struct scmi_protocol_handle *ph,
struct powercap_info *pi)
{ … }
static inline int
scmi_powercap_validate(unsigned int min_val, unsigned int max_val,
unsigned int step_val, bool configurable)
{ … }
static int
scmi_powercap_domain_attributes_get(const struct scmi_protocol_handle *ph,
struct powercap_info *pinfo, u32 domain)
{ … }
static int scmi_powercap_num_domains_get(const struct scmi_protocol_handle *ph)
{ … }
static const struct scmi_powercap_info *
scmi_powercap_dom_info_get(const struct scmi_protocol_handle *ph, u32 domain_id)
{ … }
static int scmi_powercap_xfer_cap_get(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 *power_cap)
{ … }
static int __scmi_powercap_cap_get(const struct scmi_protocol_handle *ph,
const struct scmi_powercap_info *dom,
u32 *power_cap)
{ … }
static int scmi_powercap_cap_get(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 *power_cap)
{ … }
static int scmi_powercap_xfer_cap_set(const struct scmi_protocol_handle *ph,
const struct scmi_powercap_info *pc,
u32 power_cap, bool ignore_dresp)
{ … }
static int __scmi_powercap_cap_set(const struct scmi_protocol_handle *ph,
struct powercap_info *pi, u32 domain_id,
u32 power_cap, bool ignore_dresp)
{ … }
static int scmi_powercap_cap_set(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 power_cap,
bool ignore_dresp)
{ … }
static int scmi_powercap_xfer_pai_get(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 *pai)
{ … }
static int scmi_powercap_pai_get(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 *pai)
{ … }
static int scmi_powercap_xfer_pai_set(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 pai)
{ … }
static int scmi_powercap_pai_set(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 pai)
{ … }
static int scmi_powercap_measurements_get(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 *average_power,
u32 *pai)
{ … }
static int
scmi_powercap_measurements_threshold_get(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 *power_thresh_low,
u32 *power_thresh_high)
{ … }
static int
scmi_powercap_measurements_threshold_set(const struct scmi_protocol_handle *ph,
u32 domain_id, u32 power_thresh_low,
u32 power_thresh_high)
{ … }
static int scmi_powercap_cap_enable_set(const struct scmi_protocol_handle *ph,
u32 domain_id, bool enable)
{ … }
static int scmi_powercap_cap_enable_get(const struct scmi_protocol_handle *ph,
u32 domain_id, bool *enable)
{ … }
static const struct scmi_powercap_proto_ops powercap_proto_ops = …;
static void scmi_powercap_domain_init_fc(const struct scmi_protocol_handle *ph,
u32 domain, struct scmi_fc_info **p_fc)
{ … }
static int scmi_powercap_notify(const struct scmi_protocol_handle *ph,
u32 domain, int message_id, bool enable)
{ … }
static bool
scmi_powercap_notify_supported(const struct scmi_protocol_handle *ph,
u8 evt_id, u32 src_id)
{ … }
static int
scmi_powercap_set_notify_enabled(const struct scmi_protocol_handle *ph,
u8 evt_id, u32 src_id, bool enable)
{ … }
static void *
scmi_powercap_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_powercap_get_num_sources(const struct scmi_protocol_handle *ph)
{ … }
static const struct scmi_event powercap_events[] = …;
static const struct scmi_event_ops powercap_event_ops = …;
static const struct scmi_protocol_events powercap_protocol_events = …;
static int
scmi_powercap_protocol_init(const struct scmi_protocol_handle *ph)
{ … }
static const struct scmi_protocol scmi_powercap = …;
DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(powercap, scmi_powercap)