mirror of
https://github.com/PixelExperience-Devices/device_xiaomi_sm6250-common.git
synced 2025-07-01 15:29:53 +09:00
sm6250-common: Import Pixel thermal HAL
* From hardware/google/pixel at 728fb99bbb910be05711421310efa6827aaaa4fa. Change-Id: I763b4dbef65084cfee337065b2c5ab465f69bca8
This commit is contained in:
60
thermal/utils/config_parser.h
Normal file
60
thermal/utils/config_parser.h
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (C) 2018 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef THERMAL_UTILS_CONFIG_PARSER_H__
|
||||
#define THERMAL_UTILS_CONFIG_PARSER_H__
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include <android/hardware/thermal/2.0/IThermal.h>
|
||||
|
||||
namespace android {
|
||||
namespace hardware {
|
||||
namespace thermal {
|
||||
namespace V2_0 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::hidl_enum_range;
|
||||
using ::android::hardware::thermal::V2_0::CoolingType;
|
||||
using TemperatureType_2_0 = ::android::hardware::thermal::V2_0::TemperatureType;
|
||||
using ::android::hardware::thermal::V2_0::ThrottlingSeverity;
|
||||
constexpr size_t kThrottlingSeverityCount = std::distance(
|
||||
hidl_enum_range<ThrottlingSeverity>().begin(), hidl_enum_range<ThrottlingSeverity>().end());
|
||||
using ThrottlingArray = std::array<float, static_cast<size_t>(kThrottlingSeverityCount)>;
|
||||
|
||||
struct SensorInfo {
|
||||
TemperatureType_2_0 type;
|
||||
ThrottlingArray hot_thresholds;
|
||||
ThrottlingArray cold_thresholds;
|
||||
ThrottlingArray hot_hysteresis;
|
||||
ThrottlingArray cold_hysteresis;
|
||||
float vr_threshold;
|
||||
float multiplier;
|
||||
bool is_monitor;
|
||||
bool send_powerhint;
|
||||
};
|
||||
|
||||
std::map<std::string, SensorInfo> ParseSensorInfo(std::string_view config_path);
|
||||
std::map<std::string, CoolingType> ParseCoolingDevice(std::string_view config_path);
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_0
|
||||
} // namespace thermal
|
||||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
#endif // THERMAL_UTILS_CONFIG_PARSER_H__
|
Reference in New Issue
Block a user