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. |
Darren Hsu | 529b618 | 2023-03-14 14:31:43 +0800 | [diff] [blame] | 31 | * powerEntities - list of power entity pairs (name to power entity, path to frequency table) |
Darren Hsu | 5f32222 | 2023-03-13 11:11:55 +0800 | [diff] [blame] | 32 | */ |
| 33 | AdaptiveDvfsStateResidencyDataProvider( |
| 34 | std::string path, |
| 35 | uint64_t clockRate, |
Darren Hsu | 529b618 | 2023-03-14 14:31:43 +0800 | [diff] [blame] | 36 | std::vector<std::pair<std::string, std::string>> powerEntities); |
Darren Hsu | 5f32222 | 2023-03-13 11:11:55 +0800 | [diff] [blame] | 37 | ~AdaptiveDvfsStateResidencyDataProvider() = default; |
| 38 | |
| 39 | /* |
| 40 | * See IStateResidencyDataProvider::getStateResidencies |
| 41 | */ |
| 42 | bool getStateResidencies( |
| 43 | std::unordered_map<std::string, std::vector<StateResidency>> *residencies) override; |
| 44 | |
| 45 | /* |
| 46 | * See IStateResidencyDataProvider::getInfo |
| 47 | */ |
| 48 | std::unordered_map<std::string, std::vector<State>> getInfo() override; |
| 49 | }; |
| 50 | |
| 51 | } // namespace stats |
| 52 | } // namespace power |
| 53 | } // namespace hardware |
| 54 | } // namespace android |
| 55 | } // namespace aidl |