1/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto3";
18
19package devices.shusky;
20
21message ThermalConfig {
22  repeated Sensor sensors = 1 [ json_name = "Sensors" ];
23  repeated CoolingDevice coolingdevices = 2 [ json_name = "CoolingDevices" ];
24  repeated PowerRails powerrails = 3 [ json_name = "PowerRails" ];
25  Stats stats = 4 [ json_name = "Stats" ];
26}
27
28message Sensor {
29  string name = 1 [ json_name = "Name" ];
30  string type = 2 [ json_name = "Type" ];
31  repeated float hotthreshold = 3 [ json_name = "HotThreshold" ];
32  repeated float hothysteresis = 4 [ json_name = "HotHysteresis" ];
33  string temppath = 5 [ json_name = "TempPath" ];
34  float multiplier = 6 [ json_name = "Multiplier" ];
35  int32 pollingdelay = 7 [ json_name = "PollingDelay" ];
36  int32 passivedelay = 8 [ json_name = "PassiveDelay" ];
37  bool hidden = 9 [ json_name = "Hidden" ];
38  bool virtualsensor = 10 [ json_name = "VirtualSensor" ];
39  repeated string triggersensor = 11 [ json_name = "TriggerSensor" ];
40  string formula = 12 [ json_name = "Formula" ];
41  repeated string combination = 13 [ json_name = "Combination" ];
42  repeated float Coefficient = 14 [ json_name = "Coefficient" ];
43  bool sendpowerhint = 15 [ json_name = "SendPowerHint" ];
44  bool sendcallback = 16 [ json_name = "SendCallback" ];
45  PIDInfo pidinfo = 17 [ json_name = "PIDInfo" ];
46  repeated ExcludedPowerInfo excludedpowerinfo = 18
47      [ json_name = "ExcludedPowerInfo" ];
48  repeated BindedCdevInfo bindedcdevinfos = 19 [ json_name = "BindedCdevInfo" ];
49  repeated string combinationtype = 20 [ json_name = "CombinationType" ];
50  string version = 21 [ json_name = "Version" ];
51  int32 offset = 22 [ json_name = "Offset" ];
52  repeated Profile profile = 23 [ json_name = "Profile" ];
53  float vrthreshold = 24 [ json_name = "VrThreshold" ];
54  bool monitor = 25 [ json_name = "Monitor" ];
55}
56
57message Profile {
58  string mode = 1 [ json_name = "Mode" ];
59  repeated BindedCdevInfo bindedcdevinfo = 2 [ json_name = "BindedCdevInfo" ];
60}
61
62message ExcludedPowerInfo {
63  string powerrail = 1 [ json_name = "PowerRail" ];
64  repeated float powerweight = 2 [ json_name = "PowerWeight" ];
65}
66
67message BindedCdevInfo {
68  string cdevrequest = 1 [ json_name = "CdevRequest" ];
69  repeated float cdevweightforpid = 2 [ json_name = "CdevWeightForPID" ];
70  int32 maxreleasestep = 3 [ json_name = "MaxReleaseStep" ];
71  int32 maxthrottlestep = 4 [ json_name = "MaxThrottleStep" ];
72  repeated int32 cdevceiling = 5 [ json_name = "CdevCeiling" ];
73  repeated int32 limitinfo = 6 [ json_name = "LimitInfo" ];
74  string bindedpowerrail = 7 [ json_name = "BindedPowerRail" ];
75  bool disabled = 8 [ json_name = "Disabled" ];
76}
77
78message PIDInfo {
79  repeated float k_po = 1 [ json_name = "K_Po" ];
80  repeated float k_pu = 2 [ json_name = "K_Pu" ];
81  repeated float k_i = 3 [ json_name = "K_I" ];
82  repeated float k_d = 4 [ json_name = "K_D" ];
83  repeated float i_max = 5 [ json_name = "I_Max" ];
84  repeated float s_power = 6 [ json_name = "S_Power" ];
85  repeated float minallocpower = 7 [ json_name = "MinAllocPower" ];
86  repeated float maxallocpower = 8 [ json_name = "MaxAllocPower" ];
87  repeated float i_cutoff = 9 [ json_name = "I_Cutoff" ];
88  int32 i_default = 10 [ json_name = "I_Default" ];
89}
90
91message CoolingDevice {
92  string name = 1 [ json_name = "Name" ];
93  string type = 2 [ json_name = "Type" ];
94  string writepath = 3 [ json_name = "WritePath" ];
95  repeated int32 state2power = 4 [ json_name = "State2Power" ];
96}
97
98message PowerRails {
99  string name = 1 [ json_name = "Name" ];
100  int32 powersampledelay = 2 [ json_name = "PowerSampleDelay" ];
101  int32 powersamplecount = 3 [ json_name = "PowerSampleCount" ];
102  bool virtualrails = 4 [ json_name = "VirtualRails" ];
103  string formula = 5 [ json_name = "Formula" ];
104  repeated string combination = 6 [ json_name = "Combination" ];
105  repeated float coefficient = 7 [ json_name = "Coefficient" ];
106}
107
108message Stats {
109  SensorStats sensorstats = 1 [ json_name = "Sensors" ];
110  CoolingDeviceStats coolingdevicestats = 2 [ json_name = "CoolingDevices" ];
111}
112
113message SensorStats {
114  repeated string recordwithdefaultthreshold = 1
115      [ json_name = "RecordWithDefaultThreshold" ];
116  repeated SensorStat recordwiththreshold = 2
117      [ json_name = "RecordWithThreshold" ];
118  Abnormality abnormality = 3 [ json_name = "Abnormality" ];
119}
120
121message CoolingDeviceStats {
122  RecordVotePerSensor recordvotepersensor = 1
123      [ json_name = "RecordVotePerSensor" ];
124}
125
126message RecordVotePerSensor {
127  bool defaultthresholdenableall = 1
128      [ json_name = "DefaultThresholdEnableAll" ];
129}
130
131message SensorStat {
132  string name = 1 [ json_name = "Name" ];
133  repeated int32 thresholds = 2 [ json_name = "Thresholds" ];
134}
135
136message Abnormality {
137  Outlier outlier = 1 [ json_name = "Outlier" ];
138  Stuck stuck = 2 [ json_name = "Stuck" ];
139}
140
141message Outlier { repeated Config configs = 1 [ json_name = "Configs" ]; }
142
143message Stuck { repeated Config configs = 1 [ json_name = "Configs" ]; }
144
145message Config {
146  repeated string monitor = 1 [ json_name = "Monitor" ];
147  TempStuck tempstuck = 2 [ json_name = "TempStuck" ];
148  repeated float temprange = 3 [ json_name = "TempRange" ];
149}
150
151message TempStuck {
152  int32 minpollingcount = 1 [ json_name = "MinPollingCount" ];
153  int32 minstuckduration = 2 [ json_name = "MinStuckDuration" ];
154}
155