Darren Hsu | 5f32222 | 2023-03-13 11:11:55 +0800 | [diff] [blame^] | 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 | #pragma once |
| 17 | |
| 18 | #include "DvfsStateResidencyDataProvider.h" |
| 19 | |
| 20 | namespace aidl { |
| 21 | namespace android { |
| 22 | namespace hardware { |
| 23 | namespace power { |
| 24 | namespace stats { |
| 25 | |
| 26 | class AdaptiveDvfsStateResidencyDataProvider : public DvfsStateResidencyDataProvider { |
| 27 | public: |
| 28 | /* |
| 29 | * path - path to dvfs sysfs node. |
| 30 | * clockRate - clock rate in KHz. |
| 31 | * powerEntityName - power entity name to parse. |
| 32 | * freqPath - path to frequency table. |
| 33 | */ |
| 34 | AdaptiveDvfsStateResidencyDataProvider( |
| 35 | std::string path, |
| 36 | uint64_t clockRate, |
| 37 | std::string powerEntityName, |
| 38 | std::string freqPath); |
| 39 | ~AdaptiveDvfsStateResidencyDataProvider() = default; |
| 40 | |
| 41 | /* |
| 42 | * See IStateResidencyDataProvider::getStateResidencies |
| 43 | */ |
| 44 | bool getStateResidencies( |
| 45 | std::unordered_map<std::string, std::vector<StateResidency>> *residencies) override; |
| 46 | |
| 47 | /* |
| 48 | * See IStateResidencyDataProvider::getInfo |
| 49 | */ |
| 50 | std::unordered_map<std::string, std::vector<State>> getInfo() override; |
| 51 | }; |
| 52 | |
| 53 | } // namespace stats |
| 54 | } // namespace power |
| 55 | } // namespace hardware |
| 56 | } // namespace android |
| 57 | } // namespace aidl |