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

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

Version: ~ [ linux-5.5-rc1 ] ~ [ linux-5.4.2 ] ~ [ linux-5.3.15 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.88 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.158 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.206 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.206 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.78 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * SCPI Message Protocol driver header
  3  *
  4  * Copyright (C) 2014 ARM Ltd.
  5  *
  6  * This program is free software; you can redistribute it and/or modify it
  7  * under the terms and conditions of the GNU General Public License,
  8  * version 2, as published by the Free Software Foundation.
  9  *
 10  * This program is distributed in the hope it will be useful, but WITHOUT
 11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 13  * more details.
 14  *
 15  * You should have received a copy of the GNU General Public License along with
 16  * this program. If not, see <http://www.gnu.org/licenses/>.
 17  */
 18 #include <linux/types.h>
 19 
 20 struct scpi_opp {
 21         u32 freq;
 22         u32 m_volt;
 23 } __packed;
 24 
 25 struct scpi_dvfs_info {
 26         unsigned int count;
 27         unsigned int latency; /* in nanoseconds */
 28         struct scpi_opp *opps;
 29 };
 30 
 31 enum scpi_sensor_class {
 32         TEMPERATURE,
 33         VOLTAGE,
 34         CURRENT,
 35         POWER,
 36         ENERGY,
 37 };
 38 
 39 struct scpi_sensor_info {
 40         u16 sensor_id;
 41         u8 class;
 42         u8 trigger_type;
 43         char name[20];
 44 } __packed;
 45 
 46 /**
 47  * struct scpi_ops - represents the various operations provided
 48  *      by SCP through SCPI message protocol
 49  * @get_version: returns the major and minor revision on the SCPI
 50  *      message protocol
 51  * @clk_get_range: gets clock range limit(min - max in Hz)
 52  * @clk_get_val: gets clock value(in Hz)
 53  * @clk_set_val: sets the clock value, setting to 0 will disable the
 54  *      clock (if supported)
 55  * @dvfs_get_idx: gets the Operating Point of the given power domain.
 56  *      OPP is an index to the list return by @dvfs_get_info
 57  * @dvfs_set_idx: sets the Operating Point of the given power domain.
 58  *      OPP is an index to the list return by @dvfs_get_info
 59  * @dvfs_get_info: returns the DVFS capabilities of the given power
 60  *      domain. It includes the OPP list and the latency information
 61  */
 62 struct scpi_ops {
 63         u32 (*get_version)(void);
 64         int (*clk_get_range)(u16, unsigned long *, unsigned long *);
 65         unsigned long (*clk_get_val)(u16);
 66         int (*clk_set_val)(u16, unsigned long);
 67         int (*dvfs_get_idx)(u8);
 68         int (*dvfs_set_idx)(u8, u8);
 69         struct scpi_dvfs_info *(*dvfs_get_info)(u8);
 70         int (*sensor_get_capability)(u16 *sensors);
 71         int (*sensor_get_info)(u16 sensor_id, struct scpi_sensor_info *);
 72         int (*sensor_get_value)(u16, u64 *);
 73 };
 74 
 75 #if IS_REACHABLE(CONFIG_ARM_SCPI_PROTOCOL)
 76 struct scpi_ops *get_scpi_ops(void);
 77 #else
 78 static inline struct scpi_ops *get_scpi_ops(void) { return NULL; }
 79 #endif
 80 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp