From a625d46913978a2b9f0aee5571b4910aba732992 Mon Sep 17 00:00:00 2001 From: Manaf Meethalavalappu Pallikunhi Date: Thu, 6 Dec 2018 16:13:50 +0530 Subject: thermal-hal: Add sensor config for MSM8917/QM215 Add temperature sensor config for CPU, GPU, battery and skin for MSM8917/QM215. These sensors will be used by thermal HAL. Change-Id: I94453a845cd77ee99c0455327987ade6e889da29 --- thermal_common.h | 1 + thermal_target.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/thermal_common.h b/thermal_common.h index 021924a..c76952e 100644 --- a/thermal_common.h +++ b/thermal_common.h @@ -41,6 +41,7 @@ enum therm_msm_id { THERM_MSMNILE, THERM_TALOS, THERM_SDMMAGPIE, + THERM_MSM_8917, }; struct target_therm_cfg { diff --git a/thermal_target.c b/thermal_target.c index 7908013..96d4921 100644 --- a/thermal_target.c +++ b/thermal_target.c @@ -71,6 +71,11 @@ static struct therm_msm_soc_type msm_soc_table[] = { {THERM_MSMNILE, 367}, {THERM_TALOS, 355}, {THERM_SDMMAGPIE, 365}, + {THERM_MSM_8917, 303}, + {THERM_MSM_8917, 307}, + {THERM_MSM_8917, 308}, + {THERM_MSM_8917, 309}, + {THERM_MSM_8917, 386}, // This SOC ID is for QM215 }; static char *cpu_sensors_talos[] = @@ -508,6 +513,51 @@ static struct target_therm_cfg sensor_cfg_439[] = { } }; +static char *cpu_sensors_8917[] = +{ + "apc1-cpu0-usr", + "apc1-cpu1-usr", + "apc1-cpu2-usr", + "apc1-cpu3-usr", +}; + +static char *misc_sensors_8917[] = +{ + "gpu0-usr", + "battery", + "xo-therm-adc" +}; + +static struct target_therm_cfg sensor_cfg_8917[] = { + { + .type = DEVICE_TEMPERATURE_CPU, + .sensor_list = cpu_sensors_8917, + .sens_cnt = ARRAY_SIZE(cpu_sensors_8917), + .mult = 0.001, + }, + { + .type = DEVICE_TEMPERATURE_GPU, + .sensor_list = &misc_sensors_8917[0], + .sens_cnt = 1, + .mult = 0.001, + .label = "GPU", + }, + { + .type = DEVICE_TEMPERATURE_BATTERY, + .sensor_list = &misc_sensors_8917[1], + .sens_cnt = 1, + .mult = 0.001, + .label = "battery", + }, + { + .type = DEVICE_TEMPERATURE_SKIN, + .sensor_list = &misc_sensors_8917[2], + .sens_cnt = 1, + .mult = 0.001, + .label = "skin", + } +}; + static int get_soc_info(char *buf) { int ret = 0; @@ -583,6 +633,10 @@ ssize_t get_temperatures(thermal_module_t *module, temperature_t *list, size_t s cfg = sensor_cfg_439; num_cfg = ARRAY_SIZE(sensor_cfg_439); break; + case THERM_MSM_8917: + cfg = sensor_cfg_8917; + num_cfg = ARRAY_SIZE(sensor_cfg_8917); + break; case THERM_MSMNILE: cfg = sensor_cfg_msmnile; num_cfg = ARRAY_SIZE(sensor_cfg_msmnile); -- cgit v1.2.3