Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)

Bug: 166295507
Merged-In: I84ebef54432ccd94172f01d5c20984fec0e6a480
Change-Id: I76c7b62b7500c6af1fcfca614958c0993d921528
diff --git a/thermal_common.h b/thermal_common.h
index 0d00d5b..e05ca5e 100644
--- a/thermal_common.h
+++ b/thermal_common.h
@@ -45,6 +45,8 @@
     THERM_TRINKET,
     THERM_KONA,
     THERM_LITO,
+    THERM_ATOLL,
+    THERM_BENGAL,
 };
 
 struct target_therm_cfg {
diff --git a/thermal_target.c b/thermal_target.c
index 7d3efc2..155c3c3 100644
--- a/thermal_target.c
+++ b/thermal_target.c
@@ -67,6 +67,7 @@
     {THERM_SDM_439, 363},
     {THERM_SDM_439, 364},
     {THERM_MSMNILE, 339},
+    {THERM_MSMNILE, 361},
     {THERM_MSMNILE, 362},
     {THERM_MSMNILE, 367},
     {THERM_KONA, 356},
@@ -77,8 +78,11 @@
     {THERM_MSM_8917, 308},
     {THERM_MSM_8917, 309},
     {THERM_MSM_8917, 386}, // This SOC ID is for QM215
+    {THERM_MSM_8917, 436}, // This SOC ID is for QCM2150
     {THERM_TRINKET,  394},
     {THERM_LITO,  400},
+    {THERM_ATOLL,  407},
+    {THERM_BENGAL,  417},
 };
 
 static char *cpu_sensors_talos[] =
@@ -265,6 +269,55 @@
     }
 };
 
+static char *cpu_sensors_bengal[] =
+{
+    "cpuss-2-usr",
+    "cpuss-2-usr",
+    "cpuss-2-usr",
+    "cpuss-2-usr",
+    "cpu-1-0-usr",
+    "cpu-1-1-usr",
+    "cpu-1-2-usr",
+    "cpu-1-3-usr",
+};
+
+static char *misc_sensors_bengal[] =
+{
+    "gpu-usr",
+    "battery",
+    "xo-therm-usr"
+};
+
+static struct target_therm_cfg sensor_cfg_bengal[] = {
+    {
+        .type = DEVICE_TEMPERATURE_CPU,
+        .sensor_list = cpu_sensors_bengal,
+        .sens_cnt = ARRAY_SIZE(cpu_sensors_bengal),
+        .mult = 0.001,
+    },
+    {
+        .type = DEVICE_TEMPERATURE_GPU,
+        .sensor_list = &misc_sensors_bengal[0],
+        .sens_cnt = 1,
+        .mult = 0.001,
+        .label = "GPU",
+    },
+    {
+        .type = DEVICE_TEMPERATURE_BATTERY,
+        .sensor_list = &misc_sensors_bengal[1],
+        .sens_cnt = 1,
+        .mult = 0.001,
+        .label = "battery",
+    },
+    {
+        .type = DEVICE_TEMPERATURE_SKIN,
+        .sensor_list = &misc_sensors_bengal[2],
+        .sens_cnt = 1,
+        .mult = 0.001,
+        .label = "skin",
+    }
+};
+
 static char *cpu_sensors_msmnile[] =
 {
     "cpu-0-0-usr",
@@ -314,6 +367,36 @@
     }
 };
 
+static struct target_therm_cfg sensor_cfg_kona[] = {
+    {
+        .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_lito[0],
+        .sens_cnt = 1,
+        .mult = 0.001,
+        .label = "GPU",
+    },
+    {
+        .type = DEVICE_TEMPERATURE_BATTERY,
+        .sensor_list = &misc_sensors_lito[1],
+        .sens_cnt = 1,
+        .mult = 0.001,
+        .label = "battery",
+    },
+    {
+        .type = DEVICE_TEMPERATURE_SKIN,
+        .sensor_list = &misc_sensors_lito[2],
+        .sens_cnt = 1,
+        .mult = 0.001,
+        .label = "skin",
+    }
+};
+
 static char *cpu_sensors_660[] =
 {
     "tsens_tz_sensor1",
@@ -727,10 +810,13 @@
                 num_cfg = ARRAY_SIZE(sensor_cfg_8917);
                 break;
             case THERM_MSMNILE:
-            case THERM_KONA:
                 cfg = sensor_cfg_msmnile;
                 num_cfg = ARRAY_SIZE(sensor_cfg_msmnile);
                 break;
+            case THERM_KONA:
+		cfg = sensor_cfg_kona;
+		num_cfg = ARRAY_SIZE(sensor_cfg_kona);
+		break;
             case THERM_TALOS:
                 cfg = sensor_cfg_talos;
                 num_cfg = ARRAY_SIZE(sensor_cfg_talos);
@@ -743,7 +829,12 @@
                 cfg = sensor_cfg_trinket;
                 num_cfg = ARRAY_SIZE(sensor_cfg_trinket);
                 break;
+            case THERM_BENGAL:
+                cfg = sensor_cfg_bengal;
+                num_cfg = ARRAY_SIZE(sensor_cfg_bengal);
+                break;
             case THERM_LITO:
+            case THERM_ATOLL:
                 cfg = sensor_cfg_lito;
                 num_cfg = ARRAY_SIZE(sensor_cfg_lito);
                 break;