Cherry-pick fixes for b/22956075 from 'gs201-release'
gxp: Fix thermal driver issue when pass in low val
Bug: 229560757
gxp: Add extra DVFS level for thermal throttling
Bug: 229008441
Signed-off-by: John Scheible <johnscheible@google.com>
Change-Id: Ib007c3c21acd63793f0adbe354f96e17e0534ade
diff --git a/gxp-thermal.c b/gxp-thermal.c
index 71cb67e..d6d867a 100644
--- a/gxp-thermal.c
+++ b/gxp-thermal.c
@@ -26,19 +26,18 @@
#include "gxp-thermal.h"
#include "gxp-lpm.h"
-#define MAX_NUM_GXP_STATES 10
-#define OF_DATA_NUM_MAX (MAX_NUM_GXP_STATES * 2)
-
/*
* Value comes from internal measurement
- * https://docs.google.com/spreadsheets
- * /d/1owRNFlm9EH-7IsycHXBnctyzGAd5j-VyLQOZ1ysFb7c
+ * b/229623553
*/
-static struct gxp_state_pwr state_pwr_map[MAX_NUM_GXP_STATES] = {
- {1055000, 180},
- {750000, 72},
- {373000, 21},
- {178000, 10},
+static struct gxp_state_pwr state_pwr_map[] = {
+ {1155000, 78},
+ {975000, 58},
+ {750000, 40},
+ {560000, 27},
+ {373000, 20},
+ {268000, 16},
+ {178000, 13},
};
static int gxp_get_max_state(struct thermal_cooling_device *cdev,
@@ -82,7 +81,9 @@
if (cooling_state != thermal->cooling_state) {
#ifdef CONFIG_GXP_CLOUDRIPPER
ret = exynos_acpm_set_policy(AUR_DVFS_DOMAIN,
- pwr_state < AUR_UUD ? AUR_UUD : pwr_state);
+ pwr_state < aur_power_state2rate[AUR_UUD] ?
+ aur_power_state2rate[AUR_UUD] :
+ pwr_state);
#endif
if (ret) {
dev_err(dev,