1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * SCMI Message Protocol driver header
5 * Copyright (C) 2018-2021 ARM Ltd.
8 #ifndef _LINUX_SCMI_PROTOCOL_H
9 #define _LINUX_SCMI_PROTOCOL_H
11 #include <linux/bitfield.h>
12 #include <linux/device.h>
13 #include <linux/notifier.h>
14 #include <linux/types.h>
16 #define SCMI_MAX_STR_SIZE 16
17 #define SCMI_MAX_NUM_RATES 16
20 * struct scmi_revision_info - version information structure
22 * @major_ver: Major ABI version. Change here implies risk of backward
23 * compatibility break.
24 * @minor_ver: Minor ABI version. Change here implies new feature addition,
25 * or compatible change in ABI.
26 * @num_protocols: Number of protocols that are implemented, excluding the
28 * @num_agents: Number of agents in the system.
29 * @impl_ver: A vendor-specific implementation version.
30 * @vendor_id: A vendor identifier(Null terminated ASCII string)
31 * @sub_vendor_id: A sub-vendor identifier(Null terminated ASCII string)
33 struct scmi_revision_info {
39 char vendor_id[SCMI_MAX_STR_SIZE];
40 char sub_vendor_id[SCMI_MAX_STR_SIZE];
43 struct scmi_clock_info {
44 char name[SCMI_MAX_STR_SIZE];
49 u64 rates[SCMI_MAX_NUM_RATES];
61 struct scmi_protocol_handle;
64 * struct scmi_clk_proto_ops - represents the various operations provided
65 * by SCMI Clock Protocol
67 * @count_get: get the count of clocks provided by SCMI
68 * @info_get: get the information of the specified clock
69 * @rate_get: request the current clock rate of a clock
70 * @rate_set: set the clock rate of a clock
71 * @enable: enables the specified clock
72 * @disable: disables the specified clock
74 struct scmi_clk_proto_ops {
75 int (*count_get)(const struct scmi_protocol_handle *ph);
77 const struct scmi_clock_info *(*info_get)
78 (const struct scmi_protocol_handle *ph, u32 clk_id);
79 int (*rate_get)(const struct scmi_protocol_handle *ph, u32 clk_id,
81 int (*rate_set)(const struct scmi_protocol_handle *ph, u32 clk_id,
83 int (*enable)(const struct scmi_protocol_handle *ph, u32 clk_id);
84 int (*disable)(const struct scmi_protocol_handle *ph, u32 clk_id);
88 int (*count_get)(const struct scmi_handle *hamdle);
90 const struct scmi_clock_info *(*info_get)
91 (const struct scmi_handle *handle, u32 clk_id);
92 int (*rate_get)(const struct scmi_handle *handle, u32 clk_id,
94 int (*rate_set)(const struct scmi_handle *handle, u32 clk_id,
96 int (*enable)(const struct scmi_handle *handle, u32 clk_id);
97 int (*disable)(const struct scmi_handle *handle, u32 clk_id);
101 * struct scmi_perf_proto_ops - represents the various operations provided
102 * by SCMI Performance Protocol
104 * @limits_set: sets limits on the performance level of a domain
105 * @limits_get: gets limits on the performance level of a domain
106 * @level_set: sets the performance level of a domain
107 * @level_get: gets the performance level of a domain
108 * @device_domain_id: gets the scmi domain id for a given device
109 * @transition_latency_get: gets the DVFS transition latency for a given device
110 * @device_opps_add: adds all the OPPs for a given device
111 * @freq_set: sets the frequency for a given device using sustained frequency
112 * to sustained performance level mapping
113 * @freq_get: gets the frequency for a given device using sustained frequency
114 * to sustained performance level mapping
115 * @est_power_get: gets the estimated power cost for a given performance domain
116 * at a given frequency
118 struct scmi_perf_proto_ops {
119 int (*limits_set)(const struct scmi_protocol_handle *ph, u32 domain,
120 u32 max_perf, u32 min_perf);
121 int (*limits_get)(const struct scmi_protocol_handle *ph, u32 domain,
122 u32 *max_perf, u32 *min_perf);
123 int (*level_set)(const struct scmi_protocol_handle *ph, u32 domain,
124 u32 level, bool poll);
125 int (*level_get)(const struct scmi_protocol_handle *ph, u32 domain,
126 u32 *level, bool poll);
127 int (*device_domain_id)(struct device *dev);
128 int (*transition_latency_get)(const struct scmi_protocol_handle *ph,
130 int (*device_opps_add)(const struct scmi_protocol_handle *ph,
132 int (*freq_set)(const struct scmi_protocol_handle *ph, u32 domain,
133 unsigned long rate, bool poll);
134 int (*freq_get)(const struct scmi_protocol_handle *ph, u32 domain,
135 unsigned long *rate, bool poll);
136 int (*est_power_get)(const struct scmi_protocol_handle *ph, u32 domain,
137 unsigned long *rate, unsigned long *power);
138 bool (*fast_switch_possible)(const struct scmi_protocol_handle *ph,
140 bool (*power_scale_mw_get)(const struct scmi_protocol_handle *ph);
144 * struct scmi_power_proto_ops - represents the various operations provided
145 * by SCMI Power Protocol
147 * @num_domains_get: get the count of power domains provided by SCMI
148 * @name_get: gets the name of a power domain
149 * @state_set: sets the power state of a power domain
150 * @state_get: gets the power state of a power domain
152 struct scmi_power_proto_ops {
153 int (*num_domains_get)(const struct scmi_protocol_handle *ph);
154 char *(*name_get)(const struct scmi_protocol_handle *ph, u32 domain);
155 #define SCMI_POWER_STATE_TYPE_SHIFT 30
156 #define SCMI_POWER_STATE_ID_MASK (BIT(28) - 1)
157 #define SCMI_POWER_STATE_PARAM(type, id) \
158 ((((type) & BIT(0)) << SCMI_POWER_STATE_TYPE_SHIFT) | \
159 ((id) & SCMI_POWER_STATE_ID_MASK))
160 #define SCMI_POWER_STATE_GENERIC_ON SCMI_POWER_STATE_PARAM(0, 0)
161 #define SCMI_POWER_STATE_GENERIC_OFF SCMI_POWER_STATE_PARAM(1, 0)
162 int (*state_set)(const struct scmi_protocol_handle *ph, u32 domain,
164 int (*state_get)(const struct scmi_protocol_handle *ph, u32 domain,
169 * scmi_sensor_reading - represent a timestamped read
171 * Used by @reading_get_timestamped method.
173 * @value: The signed value sensor read.
174 * @timestamp: An unsigned timestamp for the sensor read, as provided by
175 * SCMI platform. Set to zero when not available.
177 struct scmi_sensor_reading {
179 unsigned long long timestamp;
183 * scmi_range_attrs - specifies a sensor or axis values' range
184 * @min_range: The minimum value which can be represented by the sensor/axis.
185 * @max_range: The maximum value which can be represented by the sensor/axis.
187 struct scmi_range_attrs {
193 * scmi_sensor_axis_info - describes one sensor axes
195 * @type: Axes type. Chosen amongst one of @enum scmi_sensor_class.
196 * @scale: Power-of-10 multiplier applied to the axis unit.
197 * @name: NULL-terminated string representing axes name as advertised by
199 * @extended_attrs: Flag to indicate the presence of additional extended
200 * attributes for this axes.
201 * @resolution: Extended attribute representing the resolution of the axes.
202 * Set to 0 if not reported by this axes.
203 * @exponent: Extended attribute representing the power-of-10 multiplier that
204 * is applied to the resolution field. Set to 0 if not reported by
206 * @attrs: Extended attributes representing minimum and maximum values
207 * measurable by this axes. Set to 0 if not reported by this sensor.
209 struct scmi_sensor_axis_info {
213 char name[SCMI_MAX_STR_SIZE];
215 unsigned int resolution;
217 struct scmi_range_attrs attrs;
221 * scmi_sensor_intervals_info - describes number and type of available update
223 * @segmented: Flag for segmented intervals' representation. When True there
224 * will be exactly 3 intervals in @desc, with each entry
225 * representing a member of a segment in this order:
226 * {lowest update interval, highest update interval, step size}
227 * @count: Number of intervals described in @desc.
228 * @desc: Array of @count interval descriptor bitmask represented as detailed in
229 * the SCMI specification: it can be accessed using the accompanying
231 * @prealloc_pool: A minimal preallocated pool of desc entries used to avoid
232 * lesser-than-64-bytes dynamic allocation for small @count
235 struct scmi_sensor_intervals_info {
238 #define SCMI_SENS_INTVL_SEGMENT_LOW 0
239 #define SCMI_SENS_INTVL_SEGMENT_HIGH 1
240 #define SCMI_SENS_INTVL_SEGMENT_STEP 2
242 #define SCMI_SENS_INTVL_GET_SECS(x) FIELD_GET(GENMASK(20, 5), (x))
243 #define SCMI_SENS_INTVL_GET_EXP(x) \
245 int __signed_exp = FIELD_GET(GENMASK(4, 0), (x)); \
247 if (__signed_exp & BIT(4)) \
248 __signed_exp |= GENMASK(31, 5); \
251 #define SCMI_MAX_PREALLOC_POOL 16
252 unsigned int prealloc_pool[SCMI_MAX_PREALLOC_POOL];
256 * struct scmi_sensor_info - represents information related to one of the
259 * @type: Sensor type. Chosen amongst one of @enum scmi_sensor_class.
260 * @scale: Power-of-10 multiplier applied to the sensor unit.
261 * @num_trip_points: Number of maximum configurable trip points.
262 * @async: Flag for asynchronous read support.
263 * @update: Flag for continuouos update notification support.
264 * @timestamped: Flag for timestamped read support.
265 * @tstamp_scale: Power-of-10 multiplier applied to the sensor timestamps to
266 * represent it in seconds.
267 * @num_axis: Number of supported axis if any. Reported as 0 for scalar sensors.
268 * @axis: Pointer to an array of @num_axis descriptors.
269 * @intervals: Descriptor of available update intervals.
270 * @sensor_config: A bitmask reporting the current sensor configuration as
271 * detailed in the SCMI specification: it can accessed and
272 * modified through the accompanying macros.
273 * @name: NULL-terminated string representing sensor name as advertised by
275 * @extended_scalar_attrs: Flag to indicate the presence of additional extended
276 * attributes for this sensor.
277 * @sensor_power: Extended attribute representing the average power
278 * consumed by the sensor in microwatts (uW) when it is active.
279 * Reported here only for scalar sensors.
280 * Set to 0 if not reported by this sensor.
281 * @resolution: Extended attribute representing the resolution of the sensor.
282 * Reported here only for scalar sensors.
283 * Set to 0 if not reported by this sensor.
284 * @exponent: Extended attribute representing the power-of-10 multiplier that is
285 * applied to the resolution field.
286 * Reported here only for scalar sensors.
287 * Set to 0 if not reported by this sensor.
288 * @scalar_attrs: Extended attributes representing minimum and maximum
289 * measurable values by this sensor.
290 * Reported here only for scalar sensors.
291 * Set to 0 if not reported by this sensor.
293 struct scmi_sensor_info {
297 unsigned int num_trip_points;
302 unsigned int num_axis;
303 struct scmi_sensor_axis_info *axis;
304 struct scmi_sensor_intervals_info intervals;
305 unsigned int sensor_config;
306 #define SCMI_SENS_CFG_UPDATE_SECS_MASK GENMASK(31, 16)
307 #define SCMI_SENS_CFG_GET_UPDATE_SECS(x) \
308 FIELD_GET(SCMI_SENS_CFG_UPDATE_SECS_MASK, (x))
310 #define SCMI_SENS_CFG_UPDATE_EXP_MASK GENMASK(15, 11)
311 #define SCMI_SENS_CFG_GET_UPDATE_EXP(x) \
314 FIELD_GET(SCMI_SENS_CFG_UPDATE_EXP_MASK, (x)); \
316 if (__signed_exp & BIT(4)) \
317 __signed_exp |= GENMASK(31, 5); \
321 #define SCMI_SENS_CFG_ROUND_MASK GENMASK(10, 9)
322 #define SCMI_SENS_CFG_ROUND_AUTO 2
323 #define SCMI_SENS_CFG_ROUND_UP 1
324 #define SCMI_SENS_CFG_ROUND_DOWN 0
326 #define SCMI_SENS_CFG_TSTAMP_ENABLED_MASK BIT(1)
327 #define SCMI_SENS_CFG_TSTAMP_ENABLE 1
328 #define SCMI_SENS_CFG_TSTAMP_DISABLE 0
329 #define SCMI_SENS_CFG_IS_TSTAMP_ENABLED(x) \
330 FIELD_GET(SCMI_SENS_CFG_TSTAMP_ENABLED_MASK, (x))
332 #define SCMI_SENS_CFG_SENSOR_ENABLED_MASK BIT(0)
333 #define SCMI_SENS_CFG_SENSOR_ENABLE 1
334 #define SCMI_SENS_CFG_SENSOR_DISABLE 0
335 char name[SCMI_MAX_STR_SIZE];
336 #define SCMI_SENS_CFG_IS_ENABLED(x) FIELD_GET(BIT(0), (x))
337 bool extended_scalar_attrs;
338 unsigned int sensor_power;
339 unsigned int resolution;
341 struct scmi_range_attrs scalar_attrs;
345 * Partial list from Distributed Management Task Force (DMTF) specification:
346 * DSP0249 (Platform Level Data Model specification)
348 enum scmi_sensor_class {
418 NEWTON_METERS = 0x45,
429 CORRECTED_ERRS = 0x50,
430 UNCORRECTABLE_ERRS = 0x51,
438 METERS_SEC_SQUARED = 0x59,
440 CUBIC_METERS_SEC = 0x5B,
442 RADIANS_SEC_SQUARED = 0x5D,
447 * struct scmi_sensor_ops - represents the various operations provided
448 * by SCMI Sensor Protocol
450 * @count_get: get the count of sensors provided by SCMI
451 * @info_get: get the information of the specified sensor
452 * @trip_point_config: selects and configures a trip-point of interest
453 * @reading_get: gets the current value of the sensor
454 * @reading_get_timestamped: gets the current value and timestamp, when
455 * available, of the sensor. (as of v3.0 spec)
456 * Supports multi-axis sensors for sensors which
457 * supports it and if the @reading array size of
458 * @count entry equals the sensor num_axis
459 * @config_get: Get sensor current configuration
460 * @config_set: Set sensor current configuration
462 struct scmi_sensor_ops {
463 int (*count_get)(const struct scmi_handle *handle);
464 const struct scmi_sensor_info *(*info_get)
465 (const struct scmi_handle *handle, u32 sensor_id);
466 int (*trip_point_config)(const struct scmi_handle *handle,
467 u32 sensor_id, u8 trip_id, u64 trip_value);
468 int (*reading_get)(const struct scmi_handle *handle, u32 sensor_id,
470 int (*reading_get_timestamped)(const struct scmi_handle *handle,
471 u32 sensor_id, u8 count,
472 struct scmi_sensor_reading *readings);
473 int (*config_get)(const struct scmi_handle *handle,
474 u32 sensor_id, u32 *sensor_config);
475 int (*config_set)(const struct scmi_handle *handle,
476 u32 sensor_id, u32 sensor_config);
480 * struct scmi_reset_ops - represents the various operations provided
481 * by SCMI Reset Protocol
483 * @num_domains_get: get the count of reset domains provided by SCMI
484 * @name_get: gets the name of a reset domain
485 * @latency_get: gets the reset latency for the specified reset domain
486 * @reset: resets the specified reset domain
487 * @assert: explicitly assert reset signal of the specified reset domain
488 * @deassert: explicitly deassert reset signal of the specified reset domain
490 struct scmi_reset_ops {
491 int (*num_domains_get)(const struct scmi_handle *handle);
492 char *(*name_get)(const struct scmi_handle *handle, u32 domain);
493 int (*latency_get)(const struct scmi_handle *handle, u32 domain);
494 int (*reset)(const struct scmi_handle *handle, u32 domain);
495 int (*assert)(const struct scmi_handle *handle, u32 domain);
496 int (*deassert)(const struct scmi_handle *handle, u32 domain);
500 * struct scmi_voltage_info - describe one available SCMI Voltage Domain
502 * @id: the domain ID as advertised by the platform
503 * @segmented: defines the layout of the entries of array @levels_uv.
504 * - when True the entries are to be interpreted as triplets,
505 * each defining a segment representing a range of equally
506 * space voltages: <lowest_volts>, <highest_volt>, <step_uV>
507 * - when False the entries simply represent a single discrete
508 * supported voltage level
509 * @negative_volts_allowed: True if any of the entries of @levels_uv represent
510 * a negative voltage.
511 * @attributes: represents Voltage Domain advertised attributes
512 * @name: name assigned to the Voltage Domain by platform
513 * @num_levels: number of total entries in @levels_uv.
514 * @levels_uv: array of entries describing the available voltage levels for
517 struct scmi_voltage_info {
520 bool negative_volts_allowed;
521 unsigned int attributes;
522 char name[SCMI_MAX_STR_SIZE];
523 unsigned int num_levels;
524 #define SCMI_VOLTAGE_SEGMENT_LOW 0
525 #define SCMI_VOLTAGE_SEGMENT_HIGH 1
526 #define SCMI_VOLTAGE_SEGMENT_STEP 2
531 * struct scmi_voltage_ops - represents the various operations provided
532 * by SCMI Voltage Protocol
534 * @num_domains_get: get the count of voltage domains provided by SCMI
535 * @info_get: get the information of the specified domain
536 * @config_set: set the config for the specified domain
537 * @config_get: get the config of the specified domain
538 * @level_set: set the voltage level for the specified domain
539 * @level_get: get the voltage level of the specified domain
541 struct scmi_voltage_ops {
542 int (*num_domains_get)(const struct scmi_handle *handle);
543 const struct scmi_voltage_info __must_check *(*info_get)
544 (const struct scmi_handle *handle, u32 domain_id);
545 int (*config_set)(const struct scmi_handle *handle, u32 domain_id,
547 #define SCMI_VOLTAGE_ARCH_STATE_OFF 0x0
548 #define SCMI_VOLTAGE_ARCH_STATE_ON 0x7
549 int (*config_get)(const struct scmi_handle *handle, u32 domain_id,
551 int (*level_set)(const struct scmi_handle *handle, u32 domain_id,
552 u32 flags, s32 volt_uV);
553 int (*level_get)(const struct scmi_handle *handle, u32 domain_id,
558 * struct scmi_notify_ops - represents notifications' operations provided by
560 * @devm_event_notifier_register: Managed registration of a notifier_block for
561 * the requested event
562 * @devm_event_notifier_unregister: Managed unregistration of a notifier_block
563 * for the requested event
564 * @register_event_notifier: Register a notifier_block for the requested event
565 * @unregister_event_notifier: Unregister a notifier_block for the requested
568 * A user can register/unregister its own notifier_block against the wanted
569 * platform instance regarding the desired event identified by the
570 * tuple: (proto_id, evt_id, src_id) using the provided register/unregister
573 * @sdev: The scmi_device to use when calling the devres managed ops devm_
574 * @handle: The handle identifying the platform instance to use, when not
575 * calling the managed ops devm_
576 * @proto_id: The protocol ID as in SCMI Specification
577 * @evt_id: The message ID of the desired event as in SCMI Specification
578 * @src_id: A pointer to the desired source ID if different sources are
579 * possible for the protocol (like domain_id, sensor_id...etc)
581 * @src_id can be provided as NULL if it simply does NOT make sense for
582 * the protocol at hand, OR if the user is explicitly interested in
583 * receiving notifications from ANY existent source associated to the
584 * specified proto_id / evt_id.
586 * Received notifications are finally delivered to the registered users,
587 * invoking the callback provided with the notifier_block *nb as follows:
589 * int user_cb(nb, evt_id, report)
593 * @nb: The notifier block provided by the user
594 * @evt_id: The message ID of the delivered event
595 * @report: A custom struct describing the specific event delivered
597 struct scmi_notify_ops {
598 int (*devm_event_notifier_register)(struct scmi_device *sdev,
599 u8 proto_id, u8 evt_id,
601 struct notifier_block *nb);
602 int (*devm_event_notifier_unregister)(struct scmi_device *sdev,
603 u8 proto_id, u8 evt_id,
605 struct notifier_block *nb);
606 int (*register_event_notifier)(const struct scmi_handle *handle,
607 u8 proto_id, u8 evt_id,
609 struct notifier_block *nb);
610 int (*unregister_event_notifier)(const struct scmi_handle *handle,
611 u8 proto_id, u8 evt_id,
613 struct notifier_block *nb);
617 * struct scmi_handle - Handle returned to ARM SCMI clients for usage.
619 * @dev: pointer to the SCMI device
620 * @version: pointer to the structure containing SCMI version information
621 * @clk_ops: pointer to set of clock protocol operations
622 * @sensor_ops: pointer to set of sensor protocol operations
623 * @reset_ops: pointer to set of reset protocol operations
624 * @voltage_ops: pointer to set of voltage protocol operations
625 * @devm_protocol_get: devres managed method to acquire a protocol and get specific
626 * operations and a dedicated protocol handler
627 * @devm_protocol_put: devres managed method to release a protocol
628 * @notify_ops: pointer to set of notifications related operations
629 * @sensor_priv: pointer to private data structure specific to sensors
630 * protocol(for internal use only)
631 * @reset_priv: pointer to private data structure specific to reset
632 * protocol(for internal use only)
633 * @voltage_priv: pointer to private data structure specific to voltage
634 * protocol(for internal use only)
635 * @notify_priv: pointer to private data structure specific to notifications
636 * (for internal use only)
640 struct scmi_revision_info *version;
641 const struct scmi_clk_ops *clk_ops;
642 const struct scmi_sensor_ops *sensor_ops;
643 const struct scmi_reset_ops *reset_ops;
644 const struct scmi_voltage_ops *voltage_ops;
646 const void __must_check *
647 (*devm_protocol_get)(struct scmi_device *sdev, u8 proto,
648 struct scmi_protocol_handle **ph);
649 void (*devm_protocol_put)(struct scmi_device *sdev, u8 proto);
651 const struct scmi_notify_ops *notify_ops;
652 /* for protocol internal use */
660 enum scmi_std_protocol {
661 SCMI_PROTOCOL_BASE = 0x10,
662 SCMI_PROTOCOL_POWER = 0x11,
663 SCMI_PROTOCOL_SYSTEM = 0x12,
664 SCMI_PROTOCOL_PERF = 0x13,
665 SCMI_PROTOCOL_CLOCK = 0x14,
666 SCMI_PROTOCOL_SENSOR = 0x15,
667 SCMI_PROTOCOL_RESET = 0x16,
668 SCMI_PROTOCOL_VOLTAGE = 0x17,
671 enum scmi_system_events {
672 SCMI_SYSTEM_SHUTDOWN,
673 SCMI_SYSTEM_COLDRESET,
674 SCMI_SYSTEM_WARMRESET,
685 struct scmi_handle *handle;
688 #define to_scmi_dev(d) container_of(d, struct scmi_device, dev)
691 scmi_device_create(struct device_node *np, struct device *parent, int protocol,
693 void scmi_device_destroy(struct scmi_device *scmi_dev);
695 struct scmi_device_id {
702 int (*probe)(struct scmi_device *sdev);
703 void (*remove)(struct scmi_device *sdev);
704 const struct scmi_device_id *id_table;
706 struct device_driver driver;
709 #define to_scmi_driver(d) container_of(d, struct scmi_driver, driver)
711 #if IS_REACHABLE(CONFIG_ARM_SCMI_PROTOCOL)
712 int scmi_driver_register(struct scmi_driver *driver,
713 struct module *owner, const char *mod_name);
714 void scmi_driver_unregister(struct scmi_driver *driver);
717 scmi_driver_register(struct scmi_driver *driver, struct module *owner,
718 const char *mod_name)
723 static inline void scmi_driver_unregister(struct scmi_driver *driver) {}
724 #endif /* CONFIG_ARM_SCMI_PROTOCOL */
726 #define scmi_register(driver) \
727 scmi_driver_register(driver, THIS_MODULE, KBUILD_MODNAME)
728 #define scmi_unregister(driver) \
729 scmi_driver_unregister(driver)
732 * module_scmi_driver() - Helper macro for registering a scmi driver
733 * @__scmi_driver: scmi_driver structure
735 * Helper macro for scmi drivers to set up proper module init / exit
736 * functions. Replaces module_init() and module_exit() and keeps people from
737 * printing pointless things to the kernel log when their driver is loaded.
739 #define module_scmi_driver(__scmi_driver) \
740 module_driver(__scmi_driver, scmi_register, scmi_unregister)
742 struct scmi_protocol;
743 int scmi_protocol_register(const struct scmi_protocol *proto);
744 void scmi_protocol_unregister(const struct scmi_protocol *proto);
746 /* SCMI Notification API - Custom Event Reports */
747 enum scmi_notification_events {
748 SCMI_EVENT_POWER_STATE_CHANGED = 0x0,
749 SCMI_EVENT_PERFORMANCE_LIMITS_CHANGED = 0x0,
750 SCMI_EVENT_PERFORMANCE_LEVEL_CHANGED = 0x1,
751 SCMI_EVENT_SENSOR_TRIP_POINT_EVENT = 0x0,
752 SCMI_EVENT_SENSOR_UPDATE = 0x1,
753 SCMI_EVENT_RESET_ISSUED = 0x0,
754 SCMI_EVENT_BASE_ERROR_EVENT = 0x0,
755 SCMI_EVENT_SYSTEM_POWER_STATE_NOTIFIER = 0x0,
758 struct scmi_power_state_changed_report {
760 unsigned int agent_id;
761 unsigned int domain_id;
762 unsigned int power_state;
765 struct scmi_system_power_state_notifier_report {
767 unsigned int agent_id;
769 unsigned int system_state;
772 struct scmi_perf_limits_report {
774 unsigned int agent_id;
775 unsigned int domain_id;
776 unsigned int range_max;
777 unsigned int range_min;
780 struct scmi_perf_level_report {
782 unsigned int agent_id;
783 unsigned int domain_id;
784 unsigned int performance_level;
787 struct scmi_sensor_trip_point_report {
789 unsigned int agent_id;
790 unsigned int sensor_id;
791 unsigned int trip_point_desc;
794 struct scmi_sensor_update_report {
796 unsigned int agent_id;
797 unsigned int sensor_id;
798 unsigned int readings_count;
799 struct scmi_sensor_reading readings[];
802 struct scmi_reset_issued_report {
804 unsigned int agent_id;
805 unsigned int domain_id;
806 unsigned int reset_state;
809 struct scmi_base_error_report {
811 unsigned int agent_id;
813 unsigned int cmd_count;
814 unsigned long long reports[];
817 #endif /* _LINUX_SCMI_PROTOCOL_H */