[thermal] Pass information about thermal support through board file
Change-Id: Iefdfb4c5cf24ca9671c6e03d7842eaa13578d1f0
diff --git a/system/dev/board/vim/vim-thermal.c b/system/dev/board/vim/vim-thermal.c
index a0351d9..1cffae3 100644
--- a/system/dev/board/vim/vim-thermal.c
+++ b/system/dev/board/vim/vim-thermal.c
@@ -22,6 +22,9 @@
};
static aml_thermal_config_t aml_vim2_config = {
+ .active_cooling = true,
+ .passive_cooling = true,
+ .gpu_throttling = false,
.trip_point_count = 8,
.critical_temp = 81,
.trip_point_info = {
diff --git a/system/dev/lib/amlogic/include/soc/aml-common/aml-thermal.h b/system/dev/lib/amlogic/include/soc/aml-common/aml-thermal.h
index 1610b22..699a946 100644
--- a/system/dev/lib/amlogic/include/soc/aml-common/aml-thermal.h
+++ b/system/dev/lib/amlogic/include/soc/aml-common/aml-thermal.h
@@ -35,6 +35,10 @@
thermal_temperature_info_t trip_point_info[MAX_TRIP_POINTS];
uint32_t critical_temp;
+
+ bool active_cooling;
+ bool passive_cooling;
+ bool gpu_throttling;
} aml_thermal_config_t;
typedef struct {
diff --git a/system/dev/thermal/aml-thermal/aml-thermal.c b/system/dev/thermal/aml-thermal/aml-thermal.c
index e6eca0a..fc1589e 100644
--- a/system/dev/thermal/aml-thermal/aml-thermal.c
+++ b/system/dev/thermal/aml-thermal/aml-thermal.c
@@ -135,8 +135,9 @@
static void aml_thermal_get_device_info(aml_thermal_t* dev,
thermal_device_info_t* info) {
- info->active_cooling = true;
- info->passive_cooling = true;
+ info->active_cooling = dev->device->active_cooling;
+ info->passive_cooling = dev->device->passive_cooling;
+ info->gpu_throttling = dev->device->gpu_throttling;
info->num_trip_points = dev->device->trip_point_count;
memcpy(&info->trip_point_info, &dev->device->trip_point_info,
sizeof(dev->device->trip_point_info));
diff --git a/system/public/zircon/device/thermal.h b/system/public/zircon/device/thermal.h
index 1b5c6ee..568dd93 100644
--- a/system/public/zircon/device/thermal.h
+++ b/system/public/zircon/device/thermal.h
@@ -48,6 +48,9 @@
// passive cooling support
bool passive_cooling;
+ // gpu throttling support
+ bool gpu_throttling;
+
// number of trip points
uint32_t num_trip_points;