• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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 
17 #pragma once
18 
19 #include <fcntl.h>
20 #include <unistd.h>
21 
22 #include <cstdint>
23 #include <mutex>
24 
25 namespace aidl {
26 namespace google {
27 namespace hardware {
28 namespace power {
29 namespace impl {
30 namespace pixel {
31 
32 class TaskRampupMultNode {
33   public:
getInstance()34     static std::shared_ptr<TaskRampupMultNode> getInstance() {
35         static std::shared_ptr<TaskRampupMultNode> instance(new TaskRampupMultNode());
36         return instance;
37     }
38 
39     bool updateTaskRampupMult(int32_t tid, int32_t val);
40     bool isValid() const;
41 
42     ~TaskRampupMultNode();
43 
44   private:
45     // singleton
46     TaskRampupMultNode();
47     TaskRampupMultNode(TaskRampupMultNode const &) = delete;
48     TaskRampupMultNode &operator=(TaskRampupMultNode const &) = delete;
49 
50     std::mutex mMutex;
51     int mTaskRampupFd = -1;
52 };
53 
54 }  // namespace pixel
55 }  // namespace impl
56 }  // namespace power
57 }  // namespace hardware
58 }  // namespace google
59 }  // namespace aidl
60