0
     �_’I|¥‰ÓMjqØ‚¦ð¬÷ÄÃ      File not found.
  $   ˆÂÁ„e÷Àa–Ü4ý()¨‰P@Š	›ŒµpO)‹FÿÄ ?÷     /* SPDX-License-Identifier: GPL-2.0-only */
/*
 * SCMI Message Protocol driver header
 *
 * Copyright (C) 2018-2021 ARM Ltd.
 */

#ifndef _LINUX_SCMI_PROTOCOL_H
#define _LINUX_SCMI_PROTOCOL_H

#include <linux/bitfield.h>
#include <linux/device.h>
#include <linux/notifier.h>
#include <linux/types.h>

#define SCMI_MAX_STR_SIZE		64
#define SCMI_SHORT_NAME_MAX_SIZE	16
#define SCMI_MAX_NUM_RATES		16

/**
 * struct scmi_revision_info - version information structure
 *
 * @major_ver: Major ABI version. Change here implies risk of backward
 *	compatibility break.
 * @minor_ver: Minor ABI version. Change here implies new feature addition,
 *	or compatible change in ABI.
 * @num_protocols: Number of protocols that are implemented, excluding the
 *	base protocol.
 * @num_agents: Number of agents in the system.
 * @impl_ver: A vendor-specific implementation version.
 * @vendor_id: A vendor identifier(Null terminated ASCII string)
 * @sub_vendor_id: A sub-vendor identifier(Null terminated ASCII string)
 */
struct scmi_revision_info {
	u16 major_ver;
	u16 minor_ver;
	u8 num_protocols;
	u8 num_agents;
	u32 impl_ver;
	char vendor_id[SCMI_SHORT_NAME_MAX_SIZE];
	char sub_vendor_id[SCMI_SHORT_NAME_MAX_SIZE];
};

struct scmi_clock_info {
	char name[SCMI_MAX_STR_SIZE];
	unsigned int enable_latency;
	bool rate_discrete;
	bool rate_changed_notifications;
	bool rate_change_requested_notifications;
	bool state_ctrl_forbidden;
	bool rate_ctrl_forbidden;
	bool parent_ctrl_forbidden;
	bool extended_config;
	union {
		struct {
			int num_rates;
			u64 rates[SCMI_MAX_NUM_RATES];
		} list;
		struct {
			u64 min_rate;
			u64 max_rate;
			u64 step_size;
		} range;
	};
	int num_parents;
	u32 *parents;
};

enum scmi_power_scale {
	SCMI_POWER_BOGOWATTS,
	SCMI_POWER_MILLIWATTS,
	SCMI_POWER_MICROWATTS
};

struct scmi_handle;
struct scmi_device;
struct scmi_protocol_handle;

enum scmi_clock_oem_config {
	SCMI_CLOCK_CFG_DUTY_CYCLE = 0x1,
	SCMI_CLOCK_CFG_PHASE,
	SCMI_CLOCK_CFG_OEM_START = 0x80,
	SCMI_CLOCK_CFG_OEM_END = 0xFF,
};

/**
 * struct scmi_clk_proto_ops - represents the various operations provided
 *	by SCMI Clock Protocol
 *
 * @count_get: get the count of clocks provided by SCMI
 * @info_get: get the information of the specified clock
 * @rate_get: request the current clock rate of a clock
 * @rate_set: set the clock rate of a clock
 * @enable: enables the specified clock
 * @disable: disables the specified clock
 * @state_get: get the status of the specified clock
 * @config_oem_get: get the value of an OEM specific clock config
 * @config_oem_set: set the value of an OEM specific clock config
 * @parent_get: get the parent id of a clk
 * @parent_set: set the parent of a clock
 */
struct scmi_clk_proto_ops {
	int (*count_get)(const struct scmi_protocol_handle *ph);

	const struct scmi_clock_info __must_check *(*info_get)
		(const struct scmi_protocol_handle *ph, u32 clk_id);
	int (*rate_get)(const struct scmi_protocol_handle *ph, u32 clk_id,
			u64 *rate);
	int (*rate_set)(const struct scmi_protocol_handle *ph, u32 clk_id,
			u64 rate);
	int (*enable)(const struct scmi_protocol_handle *ph, u32 clk_id,
		      bool atomic);
	int (*disable)(const struct scmi_protocol_handle *ph, u32 clk_id,
		       bool atomic);
	int (*state_get)(const struct scmi_protocol_handle *ph, u32 clk_id,
			 bool *enabled, bool atomic);
	int (*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);
	int (*config_oem_set)(const struct scmi_protocol_handle *ph, u32 clk_id,
			      enum scmi_clock_oem_config oem_type,
			      u32 oem_val, bool atomic);
	int (*parent_get)(const struct scmi_protocol_handle *ph, u32 clk_id, u32 *parent_id);
	int (*parent_set)(const struct scmi_protocol_handle *ph, u32 clk_id, u32 parent_id);
};

struct scmi_perf_domain_info {
	char name[SCMI_MAX_STR_SIZE];
	bool set_perf;
};

/**
 * struct scmi_perf_proto_ops - represents the