summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>2018-12-06 15:51:47 +0530
committerManaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>2018-12-06 15:51:47 +0530
commit05e42503b44e368f8fed5e3c8ddc8769e546d34b (patch)
tree2ed8457b9d1f22bedb1d0797b0092c1cedf5d224
parent7aa64e93a94250200207c12310861ec81b451d19 (diff)
downloadthermal-05e42503b44e368f8fed5e3c8ddc8769e546d34b.tar.gz
thermal-hal: Add sensor config for sdmmagpie
Add temperature sensor config for CPU, GPU, battery and skin for sdmmagpie. These sensors will be used by thermal HAL. Change-Id: Iae52d547747c0dab87c62205b68882953bac1577
-rw-r--r--thermal_common.h1
-rw-r--r--thermal_target.c53
2 files changed, 54 insertions, 0 deletions
diff --git a/thermal_common.h b/thermal_common.h
index 8ffbc5c..021924a 100644
--- a/thermal_common.h
+++ b/thermal_common.h
@@ -40,6 +40,7 @@ enum therm_msm_id {
THERM_SDM_439,
THERM_MSMNILE,
THERM_TALOS,
+ THERM_SDMMAGPIE,
};
struct target_therm_cfg {
diff --git a/thermal_target.c b/thermal_target.c
index bf3f0a5..7908013 100644
--- a/thermal_target.c
+++ b/thermal_target.c
@@ -70,6 +70,7 @@ static struct therm_msm_soc_type msm_soc_table[] = {
{THERM_MSMNILE, 362},
{THERM_MSMNILE, 367},
{THERM_TALOS, 355},
+ {THERM_SDMMAGPIE, 365},
};
static char *cpu_sensors_talos[] =
@@ -121,6 +122,54 @@ static struct target_therm_cfg sensor_cfg_talos[] = {
}
};
+static char *cpu_sensors_sdmmagpie[] =
+{
+ "cpu-0-0-usr",
+ "cpu-0-1-usr",
+ "cpu-0-2-usr",
+ "cpu-0-3-usr",
+ "cpu-0-4-usr",
+ "cpu-0-5-usr",
+ "cpu-1-0-usr",
+ "cpu-1-2-usr",
+};
+
+static char *misc_sensors_sdmmagpie[] =
+{
+ "gpuss-0-usr",
+ "battery",
+ "xo-therm-adc"
+};
+
+static struct target_therm_cfg sensor_cfg_sdmmagpie[] = {
+ {
+ .type = DEVICE_TEMPERATURE_CPU,
+ .sensor_list = cpu_sensors_sdmmagpie,
+ .sens_cnt = ARRAY_SIZE(cpu_sensors_sdmmagpie),
+ .mult = 0.001,
+ },
+ {
+ .type = DEVICE_TEMPERATURE_GPU,
+ .sensor_list = &misc_sensors_sdmmagpie[0],
+ .sens_cnt = 1,
+ .mult = 0.001,
+ .label = "GPU",
+ },
+ {
+ .type = DEVICE_TEMPERATURE_BATTERY,
+ .sensor_list = &misc_sensors_sdmmagpie[1],
+ .sens_cnt = 1,
+ .mult = 0.001,
+ .label = "battery",
+ },
+ {
+ .type = DEVICE_TEMPERATURE_SKIN,
+ .sensor_list = &misc_sensors_sdmmagpie[2],
+ .sens_cnt = 1,
+ .mult = 0.001,
+ .label = "skin",
+ }
+};
static char *cpu_sensors_msmnile[] =
{
@@ -542,6 +591,10 @@ ssize_t get_temperatures(thermal_module_t *module, temperature_t *list, size_t s
cfg = sensor_cfg_talos;
num_cfg = ARRAY_SIZE(sensor_cfg_talos);
break;
+ case THERM_SDMMAGPIE:
+ cfg = sensor_cfg_sdmmagpie;
+ num_cfg = ARRAY_SIZE(sensor_cfg_sdmmagpie);
+ break;
default:
cfg = NULL;
num_cfg = 0;