diff options
author | Ram Chandrasekar <rkumbako@codeaurora.org> | 2018-09-14 16:15:42 -0600 |
---|---|---|
committer | Ram Chandrasekar <rkumbako@codeaurora.org> | 2018-09-19 09:27:54 -0600 |
commit | b28736a7d7b1c06fc4123e969e89863a57517ba0 (patch) | |
tree | 0acbeef32c4d63865f72a65e815b35c8d7eb4ac3 | |
parent | 3cd560ff0b230d8054460c5a77db3d0ef49f4632 (diff) | |
download | thermal-b28736a7d7b1c06fc4123e969e89863a57517ba0.tar.gz |
thermal-hal: Add sensor config for msmnile
Add temperature sensor config for CPU, GPU, battery and skin for
msmnile. These sensors will be used to fetch the temperature using
thermal HAL.
Change-Id: Ic8bf4f205e7366ba4fccbdad39ed7ce769f64704
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
-rw-r--r-- | thermal_common.h | 1 | ||||
-rw-r--r-- | thermal_target.c | 56 |
2 files changed, 57 insertions, 0 deletions
diff --git a/thermal_common.h b/thermal_common.h index 5a07804..d67661a 100644 --- a/thermal_common.h +++ b/thermal_common.h @@ -38,6 +38,7 @@ enum therm_msm_id { THERM_QCS_605, THERM_SDM_632, THERM_SDM_439, + THERM_MSMNILE, }; struct target_therm_cfg { diff --git a/thermal_target.c b/thermal_target.c index 493fe83..cce237e 100644 --- a/thermal_target.c +++ b/thermal_target.c @@ -65,6 +65,58 @@ static struct therm_msm_soc_type msm_soc_table[] = { {THERM_SDM_439, 354}, {THERM_SDM_439, 363}, {THERM_SDM_439, 364}, + {THERM_MSMNILE, 339}, + {THERM_MSMNILE, 362}, + {THERM_MSMNILE, 367}, +}; + +static char *cpu_sensors_msmnile[] = +{ + "cpu-0-0-usr", + "cpu-0-1-usr", + "cpu-0-2-usr", + "cpu-0-3-usr", + "cpu-1-0-usr", + "cpu-1-1-usr", + "cpu-1-2-usr", + "cpu-1-3-usr", +}; + +static char *misc_sensors_msmnile[] = +{ + "gpuss-0-usr", + "battery", + "xo-therm" +}; + +static struct target_therm_cfg sensor_cfg_msmnile[] = { + { + .type = DEVICE_TEMPERATURE_CPU, + .sensor_list = cpu_sensors_msmnile, + .sens_cnt = ARRAY_SIZE(cpu_sensors_msmnile), + .mult = 0.001, + }, + { + .type = DEVICE_TEMPERATURE_GPU, + .sensor_list = &misc_sensors_msmnile[0], + .sens_cnt = 1, + .mult = 0.001, + .label = "GPU", + }, + { + .type = DEVICE_TEMPERATURE_BATTERY, + .sensor_list = &misc_sensors_msmnile[1], + .sens_cnt = 1, + .mult = 0.001, + .label = "battery", + }, + { + .type = DEVICE_TEMPERATURE_SKIN, + .sensor_list = &misc_sensors_msmnile[2], + .sens_cnt = 1, + .mult = 0.001, + .label = "skin", + } }; static char *cpu_sensors_660[] = @@ -430,6 +482,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_MSMNILE: + cfg = sensor_cfg_msmnile; + num_cfg = ARRAY_SIZE(sensor_cfg_msmnile); + break; default: cfg = NULL; num_cfg = 0; |