~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/scpi_protocol.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * SCPI Message Protocol driver header
  4  *
  5  * Copyright (C) 2014 ARM Ltd.
  6  */
  7 
  8 #ifndef _LINUX_SCPI_PROTOCOL_H
  9 #define _LINUX_SCPI_PROTOCOL_H
 10 
 11 #include <linux/types.h>
 12 
 13 struct scpi_opp {
 14         u32 freq;
 15         u32 m_volt;
 16 } __packed;
 17 
 18 struct scpi_dvfs_info {
 19         unsigned int count;
 20         unsigned int latency; /* in nanoseconds */
 21         struct scpi_opp *opps;
 22 };
 23 
 24 enum scpi_sensor_class {
 25         TEMPERATURE,
 26         VOLTAGE,
 27         CURRENT,
 28         POWER,
 29         ENERGY,
 30 };
 31 
 32 struct scpi_sensor_info {
 33         u16 sensor_id;
 34         u8 class;
 35         u8 trigger_type;
 36         char name[20];
 37 } __packed;
 38 
 39 /**
 40  * struct scpi_ops - represents the various operations provided
 41  *      by SCP through SCPI message protocol
 42  * @get_version: returns the major and minor revision on the SCPI
 43  *      message protocol
 44  * @clk_get_range: gets clock range limit(min - max in Hz)
 45  * @clk_get_val: gets clock value(in Hz)
 46  * @clk_set_val: sets the clock value, setting to 0 will disable the
 47  *      clock (if supported)
 48  * @dvfs_get_idx: gets the Operating Point of the given power domain.
 49  *      OPP is an index to the list return by @dvfs_get_info
 50  * @dvfs_set_idx: sets the Operating Point of the given power domain.
 51  *      OPP is an index to the list return by @dvfs_get_info
 52  * @dvfs_get_info: returns the DVFS capabilities of the given power
 53  *      domain. It includes the OPP list and the latency information
 54  * @device_domain_id: gets the scpi domain id for a given device
 55  * @get_transition_latency: gets the DVFS transition latency for a given device
 56  * @add_opps_to_device: adds all the OPPs for a given device
 57  * @sensor_get_capability: get the list of capabilities for the sensors
 58  * @sensor_get_info: get the information of the specified sensor
 59  * @sensor_get_value: gets the current value of the sensor
 60  * @device_get_power_state: gets the power state of a power domain
 61  * @device_set_power_state: sets the power state of a power domain
 62  */
 63 struct scpi_ops {
 64         u32 (*get_version)(void);
 65         int (*clk_get_range)(u16, unsigned long *, unsigned long *);
 66         unsigned long (*clk_get_val)(u16);
 67         int (*clk_set_val)(u16, unsigned long);
 68         int (*dvfs_get_idx)(u8);
 69         int (*dvfs_set_idx)(u8, u8);
 70         struct scpi_dvfs_info *(*dvfs_get_info)(u8);
 71         int (*device_domain_id)(struct device *);
 72         int (*get_transition_latency)(struct device *);
 73         int (*add_opps_to_device)(struct device *);
 74         int (*sensor_get_capability)(u16 *sensors);
 75         int (*sensor_get_info)(u16 sensor_id, struct scpi_sensor_info *);
 76         int (*sensor_get_value)(u16, u64 *);
 77         int (*device_get_power_state)(u16);
 78         int (*device_set_power_state)(u16, u8);
 79 };
 80 
 81 #if IS_REACHABLE(CONFIG_ARM_SCPI_PROTOCOL)
 82 struct scpi_ops *get_scpi_ops(void);
 83 #else
 84 static inline struct scpi_ops *get_scpi_ops(void) { return NULL; }
 85 #endif
 86 
 87 #endif /* _LINUX_SCPI_PROTOCOL_H */
 88 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php