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 <PowerStatsAidl.h>
19 
20 namespace aidl {
21 namespace android {
22 namespace hardware {
23 namespace power {
24 namespace stats {
25 
26 class TpuDvfsStateResidencyDataProvider : public PowerStats::IStateResidencyDataProvider {
27   public:
28     TpuDvfsStateResidencyDataProvider(
29             const std::string& path, std::vector<std::string> frequencies, uint64_t clockRate);
30     ~TpuDvfsStateResidencyDataProvider() = default;
31 
32     /*
33      * See IStateResidencyDataProvider::getStateResidencies
34      */
35     bool getStateResidencies(
36         std::unordered_map<std::string, std::vector<StateResidency>> *residencies) override;
37 
38     /*
39      * See IStateResidencyDataProvider::getInfo
40      */
41     std::unordered_map<std::string, std::vector<State>> getInfo() override;
42 
43   private:
44     const std::string mPath;
45     const std::vector<std::string> mFrequencies;
46     const uint64_t mClockRate;
47 };
48 
49 }  // namespace stats
50 }  // namespace power
51 }  // namespace hardware
52 }  // namespace android
53 }  // namespace aidl
54