xref: /aosp_15_r20/hardware/interfaces/thermal/1.0/IThermal.hal (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
1*4d7e907cSAndroid Build Coastguard Worker/*
2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2016 The Android Open Source Project
3*4d7e907cSAndroid Build Coastguard Worker *
4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*4d7e907cSAndroid Build Coastguard Worker *
8*4d7e907cSAndroid Build Coastguard Worker *      http://www.apache.org/licenses/LICENSE-2.0
9*4d7e907cSAndroid Build Coastguard Worker *
10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License.
15*4d7e907cSAndroid Build Coastguard Worker */
16*4d7e907cSAndroid Build Coastguard Worker
17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected];
18*4d7e907cSAndroid Build Coastguard Worker
19*4d7e907cSAndroid Build Coastguard Workerinterface IThermal {
20*4d7e907cSAndroid Build Coastguard Worker
21*4d7e907cSAndroid Build Coastguard Worker    /**
22*4d7e907cSAndroid Build Coastguard Worker     * Retrieves temperatures in Celsius.
23*4d7e907cSAndroid Build Coastguard Worker     *
24*4d7e907cSAndroid Build Coastguard Worker     * @return status Status of the operation. If status code is FAILURE,
25*4d7e907cSAndroid Build Coastguard Worker     *         the status.debugMessage must be populated with the human-readable
26*4d7e907cSAndroid Build Coastguard Worker     *         error message.
27*4d7e907cSAndroid Build Coastguard Worker     * @return temperatures If status code is SUCCESS, it's filled with the
28*4d7e907cSAndroid Build Coastguard Worker     *         current temperatures. The order of temperatures of built-in
29*4d7e907cSAndroid Build Coastguard Worker     *         devices (such as CPUs, GPUs and etc.) in the list must be kept
30*4d7e907cSAndroid Build Coastguard Worker     *         the same regardless the number of calls to this method even if
31*4d7e907cSAndroid Build Coastguard Worker     *         they go offline, if these devices exist on boot. The method
32*4d7e907cSAndroid Build Coastguard Worker     *         always returns and never removes such temperatures.
33*4d7e907cSAndroid Build Coastguard Worker     *
34*4d7e907cSAndroid Build Coastguard Worker     */
35*4d7e907cSAndroid Build Coastguard Worker    @callflow(next={"*"})
36*4d7e907cSAndroid Build Coastguard Worker    @entry
37*4d7e907cSAndroid Build Coastguard Worker    @exit
38*4d7e907cSAndroid Build Coastguard Worker    getTemperatures()
39*4d7e907cSAndroid Build Coastguard Worker        generates (ThermalStatus status, vec<Temperature> temperatures);
40*4d7e907cSAndroid Build Coastguard Worker
41*4d7e907cSAndroid Build Coastguard Worker    /**
42*4d7e907cSAndroid Build Coastguard Worker     * Retrieves CPU usage information of each core: active and total times
43*4d7e907cSAndroid Build Coastguard Worker     * in ms since first boot.
44*4d7e907cSAndroid Build Coastguard Worker     *
45*4d7e907cSAndroid Build Coastguard Worker     * @return status Status of the operation. If status code is FAILURE,
46*4d7e907cSAndroid Build Coastguard Worker     *         the status.debugMessage must be populated with the human-readable
47*4d7e907cSAndroid Build Coastguard Worker     *         error message.
48*4d7e907cSAndroid Build Coastguard Worker     * @return cpuUsages If status code is SUCCESS, it's filled with the current
49*4d7e907cSAndroid Build Coastguard Worker     *         CPU usages. The order and number of CPUs in the list must be kept
50*4d7e907cSAndroid Build Coastguard Worker     *         the same regardless the number of calls to this method.
51*4d7e907cSAndroid Build Coastguard Worker     *
52*4d7e907cSAndroid Build Coastguard Worker     */
53*4d7e907cSAndroid Build Coastguard Worker    @callflow(next={"*"})
54*4d7e907cSAndroid Build Coastguard Worker    @entry
55*4d7e907cSAndroid Build Coastguard Worker    @exit
56*4d7e907cSAndroid Build Coastguard Worker    getCpuUsages() generates (ThermalStatus status, vec<CpuUsage> cpuUsages);
57*4d7e907cSAndroid Build Coastguard Worker
58*4d7e907cSAndroid Build Coastguard Worker    /**
59*4d7e907cSAndroid Build Coastguard Worker     * Retrieves the cooling devices information.
60*4d7e907cSAndroid Build Coastguard Worker     *
61*4d7e907cSAndroid Build Coastguard Worker     * @return status Status of the operation. If status code is FAILURE,
62*4d7e907cSAndroid Build Coastguard Worker     *         the status.debugMessage must be populated with the human-readable
63*4d7e907cSAndroid Build Coastguard Worker     *         error message.
64*4d7e907cSAndroid Build Coastguard Worker     * @return devices If status code is SUCCESS, it's filled with the current
65*4d7e907cSAndroid Build Coastguard Worker     *         cooling device information. The order of built-in cooling
66*4d7e907cSAndroid Build Coastguard Worker     *         devices in the list must be kept the same regardless the number
67*4d7e907cSAndroid Build Coastguard Worker     *         of calls to this method even if they go offline, if these devices
68*4d7e907cSAndroid Build Coastguard Worker     *         exist on boot. The method always returns and never removes from
69*4d7e907cSAndroid Build Coastguard Worker     *         the list such cooling devices.
70*4d7e907cSAndroid Build Coastguard Worker     *
71*4d7e907cSAndroid Build Coastguard Worker     */
72*4d7e907cSAndroid Build Coastguard Worker    @callflow(next={"*"})
73*4d7e907cSAndroid Build Coastguard Worker    @entry
74*4d7e907cSAndroid Build Coastguard Worker    @exit
75*4d7e907cSAndroid Build Coastguard Worker    getCoolingDevices()
76*4d7e907cSAndroid Build Coastguard Worker        generates (ThermalStatus status, vec<CoolingDevice> devices);
77*4d7e907cSAndroid Build Coastguard Worker
78*4d7e907cSAndroid Build Coastguard Worker};
79