#include <linux/module.h>
#include <linux/limits.h>
#include <linux/sort.h>
#include "protocols.h"
#include "notify.h"
#define SCMI_PROTOCOL_SUPPORTED_VERSION …
enum scmi_clock_protocol_cmd { … };
#define CLOCK_STATE_CONTROL_ALLOWED …
#define CLOCK_PARENT_CONTROL_ALLOWED …
#define CLOCK_RATE_CONTROL_ALLOWED …
enum clk_state { … };
struct scmi_msg_resp_clock_protocol_attributes { … };
struct scmi_msg_resp_clock_attributes { … };
struct scmi_msg_clock_possible_parents { … };
struct scmi_msg_resp_clock_possible_parents { … };
struct scmi_msg_clock_set_parent { … };
struct scmi_msg_clock_config_set { … };
struct scmi_msg_clock_config_set_v2 { … };
struct scmi_msg_clock_config_get { … };
struct scmi_msg_resp_clock_config_get { … };
struct scmi_msg_clock_describe_rates { … };
struct scmi_msg_resp_clock_describe_rates { … };
struct scmi_clock_set_rate { … };
struct scmi_msg_resp_set_rate_complete { … };
struct scmi_msg_clock_rate_notify { … };
struct scmi_clock_rate_notify_payld { … };
struct clock_info { … };
static enum scmi_clock_protocol_cmd evt_2_cmd[] = …;
static inline struct scmi_clock_info *
scmi_clock_domain_lookup(struct clock_info *ci, u32 clk_id)
{ … }
static int
scmi_clock_protocol_attributes_get(const struct scmi_protocol_handle *ph,
struct clock_info *ci)
{ … }
struct scmi_clk_ipriv { … };
static void iter_clk_possible_parents_prepare_message(void *message, unsigned int desc_index,
const void *priv)
{ … }
static int iter_clk_possible_parents_update_state(struct scmi_iterator_state *st,
const void *response, void *priv)
{ … }
static int iter_clk_possible_parents_process_response(const struct scmi_protocol_handle *ph,
const void *response,
struct scmi_iterator_state *st,
void *priv)
{ … }
static int scmi_clock_possible_parents(const struct scmi_protocol_handle *ph, u32 clk_id,
struct scmi_clock_info *clk)
{ … }
static int
scmi_clock_get_permissions(const struct scmi_protocol_handle *ph, u32 clk_id,
struct scmi_clock_info *clk)
{ … }
static int scmi_clock_attributes_get(const struct scmi_protocol_handle *ph,
u32 clk_id, struct clock_info *cinfo,
u32 version)
{ … }
static int rate_cmp_func(const void *_r1, const void *_r2)
{ … }
static void iter_clk_describe_prepare_message(void *message,
const unsigned int desc_index,
const void *priv)
{ … }
static int
iter_clk_describe_update_state(struct scmi_iterator_state *st,
const void *response, void *priv)
{ … }
static int
iter_clk_describe_process_response(const struct scmi_protocol_handle *ph,
const void *response,
struct scmi_iterator_state *st, void *priv)
{ … }
static int
scmi_clock_describe_rates_get(const struct scmi_protocol_handle *ph, u32 clk_id,
struct scmi_clock_info *clk)
{ … }
static int
scmi_clock_rate_get(const struct scmi_protocol_handle *ph,
u32 clk_id, u64 *value)
{ … }
static int scmi_clock_rate_set(const struct scmi_protocol_handle *ph,
u32 clk_id, u64 rate)
{ … }
static int
scmi_clock_config_set(const struct scmi_protocol_handle *ph, u32 clk_id,
enum clk_state state,
enum scmi_clock_oem_config __unused0, u32 __unused1,
bool atomic)
{ … }
static int
scmi_clock_set_parent(const struct scmi_protocol_handle *ph, u32 clk_id,
u32 parent_id)
{ … }
static int
scmi_clock_get_parent(const struct scmi_protocol_handle *ph, u32 clk_id,
u32 *parent_id)
{ … }
static int
scmi_clock_config_set_v2(const struct scmi_protocol_handle *ph, u32 clk_id,
enum clk_state state,
enum scmi_clock_oem_config oem_type, u32 oem_val,
bool atomic)
{ … }
static int scmi_clock_enable(const struct scmi_protocol_handle *ph, u32 clk_id,
bool atomic)
{ … }
static int scmi_clock_disable(const struct scmi_protocol_handle *ph, u32 clk_id,
bool atomic)
{ … }
static int
scmi_clock_config_get_v2(const struct scmi_protocol_handle *ph, u32 clk_id,
enum scmi_clock_oem_config oem_type, u32 *attributes,
bool *enabled, u32 *oem_val, bool atomic)
{ … }
static int
scmi_clock_config_get(const struct scmi_protocol_handle *ph, u32 clk_id,
enum scmi_clock_oem_config oem_type, u32 *attributes,
bool *enabled, u32 *oem_val, bool atomic)
{ … }
static int scmi_clock_state_get(const struct scmi_protocol_handle *ph,
u32 clk_id, bool *enabled, bool atomic)
{ … }
static int scmi_clock_config_oem_set(const struct scmi_protocol_handle *ph,
u32 clk_id,
enum scmi_clock_oem_config oem_type,
u32 oem_val, bool atomic)
{ … }
static int scmi_clock_config_oem_get(const struct scmi_protocol_handle *ph,
u32 clk_id,
enum scmi_clock_oem_config oem_type,
u32 *oem_val, u32 *attributes, bool atomic)
{ … }
static int scmi_clock_count_get(const struct scmi_protocol_handle *ph)
{ … }
static const struct scmi_clock_info *
scmi_clock_info_get(const struct scmi_protocol_handle *ph, u32 clk_id)
{ … }
static const struct scmi_clk_proto_ops clk_proto_ops = …;
static bool scmi_clk_notify_supported(const struct scmi_protocol_handle *ph,
u8 evt_id, u32 src_id)
{ … }
static int scmi_clk_rate_notify(const struct scmi_protocol_handle *ph,
u32 clk_id, int message_id, bool enable)
{ … }
static int scmi_clk_set_notify_enabled(const struct scmi_protocol_handle *ph,
u8 evt_id, u32 src_id, bool enable)
{ … }
static void *scmi_clk_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_clk_get_num_sources(const struct scmi_protocol_handle *ph)
{ … }
static const struct scmi_event clk_events[] = …;
static const struct scmi_event_ops clk_event_ops = …;
static const struct scmi_protocol_events clk_protocol_events = …;
static int scmi_clock_protocol_init(const struct scmi_protocol_handle *ph)
{ … }
static const struct scmi_protocol scmi_clock = …;
DEFINE_SCMI_PROTOCOL_REGISTER_UNREGISTER(clock, scmi_clock)