thermal: thermal table update

1. Update raven virtual sensor formula
2. Add power link settings for charging throttling reference
3. Support cdev_ceiling and cdev_weight for each severity

Bug: 192281595
Bug: 182970733
Bug: 183559513
Bug: 190809187
Bug: 184582287

Test: verified by emul temp
Change-Id: I4d51f60cb970e0f9d82273243cbd3aed16f8997b
diff --git a/thermal_info_config_oriole.json b/thermal_info_config_oriole.json
index adac93d..c32e199 100644
--- a/thermal_info_config_oriole.json
+++ b/thermal_info_config_oriole.json
@@ -297,47 +297,48 @@
             "BindedCdevInfo": [
                 {
                     "CdevRequest": "thermal-cpufreq-0",
-                    "CdevWeightForPID":0.9,
-                    "CdevCeilingForPID":6,
+                    "CdevWeightForPID": [0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9],
+                    "CdevCeiling": [6, 6, 6, 7, 8, 10, 10],
                     "LimitInfo": [0, 0, 0, 7, 8, 10, 10],
+                    "BindedPowerRail": "S4M_VDD_CPUCL0",
                     "PowerThreshold": [200, 200, 200, 200, 50, 0, 0],
-                    "PowerSampleDelay":14000,
-                    "PowerSampleCount":5,
                     "ReleaseLogic": "DECREASE"
                 },
                 {
                     "CdevRequest": "thermal-cpufreq-1",
-                    "CdevWeightForPID":1.1,
-                    "CdevCeilingForPID":7,
+                    "CdevWeightForPID": [1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1],
+                    "CdevCeiling": [7, 7, 7, 8, 9, 11, 11],
                     "LimitInfo": [0, 0, 0, 8, 9, 11, 11],
+                    "BindedPowerRail": "S3M_VDD_CPUCL1",
                     "PowerThreshold": [200, 200, 200, 200, 50, 0, 0],
-                    "PowerSampleDelay":14000,
-                    "PowerSampleCount":5,
                     "ReleaseLogic": "DECREASE"
                 },
                 {
                     "CdevRequest": "thermal-cpufreq-2",
-                    "CdevWeightForPID":2.9,
-                    "CdevCeilingForPID":12,
+                    "CdevWeightForPID": [2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9],
+                    "CdevCeiling": [12, 12, 12, 13, 14, 16, 16],
                     "LimitInfo": [0, 0, 0, 13, 14, 16, 16],
+                    "BindedPowerRail": "S2M_VDD_CPUCL2",
                     "PowerThreshold": [200, 200, 200, 200, 50, 0, 0],
-                    "PowerSampleDelay":14000,
-                    "PowerSampleCount":5,
                     "ReleaseLogic": "DECREASE"
                 },
                 {
                     "CdevRequest": "thermal-gpufreq-0",
-                    "CdevWeightForPID":3.3,
-                    "CdevCeilingForPID":7,
+                    "CdevWeightForPID": [3.3, 3.3, 3.3, 3.3, 3.3, 3.3, 3.3],
+                    "CdevCeiling": [7, 7, 7, 8, 10, 11, 11],
                     "LimitInfo": [0, 0, 0, 8, 10, 11, 11],
+                    "BindedPowerRail": "S2S_VDD_G3D",
                     "PowerThreshold": [200, 200, 200, 200, 50, 0, 0],
-                    "PowerSampleDelay":14000,
-                    "PowerSampleCount":5,
                     "ReleaseLogic": "DECREASE"
                 },
                 {
                     "CdevRequest": "fcc",
-                    "LimitInfo": [0, 2, 3, 5, 5, 5, 5]
+                    "LimitInfo": [0, 2, 3, 4, 4, 4, 4],
+                    "BindedPowerRail": "POWER_FOR_CHARGING_THROTTLING",
+                    "PowerThreshold": [500, 500, 500, 500, 0, 0, 0],
+                    "CdevFloorWithPowerLink": [0, 0, 1, 2, 4 ,4 ,4],
+                    "ReleaseLogic": "RELEASE_TO_FLOOR",
+                    "ThrottlingWithPowerLink":true
                 },
                 {
                     "CdevRequest": "dc_icl",
@@ -345,7 +346,12 @@
                 },
                 {
                     "CdevRequest": "wlc_fcc",
-                    "LimitInfo": [0, 1, 2, 4, 4, 4, 4]
+                    "LimitInfo": [0, 1, 1, 4, 4, 4, 4],
+                    "BindedPowerRail": "POWER_FOR_CHARGING_THROTTLING",
+                    "PowerThreshold": [500, 500, 500, 500, 0, 0, 0],
+                    "CdevFloorWithPowerLink": [0, 0, 0, 1, 4 ,4 ,4],
+                    "ReleaseLogic": "RELEASE_TO_FLOOR",
+                    "ThrottlingWithPowerLink":true
                 }
             ]
         },
@@ -747,29 +753,25 @@
             "Name":"thermal-cpufreq-0",
             "Type":"CPU",
             "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-0/user_vote",
-            "State2Power":["428", "368", "320", "244", "220", "184", "156", "116", "80", "56", "24"],
-            "PowerRail":"S4M_VDD_CPUCL0"
+            "State2Power":["428", "368", "320", "244", "220", "184", "156", "116", "80", "56", "24"]
         },
         {
             "Name":"thermal-cpufreq-1",
             "Type":"CPU",
             "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-1/user_vote",
-            "State2Power":["904", "740", "594", "476", "374", "314", "236", "192", "156", "126", "90", "58"],
-            "PowerRail":"S3M_VDD_CPUCL1"
+            "State2Power":["904", "740", "594", "476", "374", "314", "236", "192", "156", "126", "90", "58"]
         },
         {
             "Name":"thermal-cpufreq-2",
             "Type":"CPU",
             "WritePath":"/dev/thermal/cdev-by-name/thermal-cpufreq-2/user_vote",
-            "State2Power":["4406", "3874", "3500", "3052", "2704", "2334", "2176", "1864", "1492", "1362", "1116", "908", "756", "594", "478", "388", "178"],
-            "PowerRail":"S2M_VDD_CPUCL2"
+            "State2Power":["4406", "3874", "3500", "3052", "2704", "2334", "2176", "1864", "1492", "1362", "1116", "908", "756", "594", "478", "388", "178"]
         },
         {
             "Name":"thermal-gpufreq-0",
             "Type":"GPU",
             "WritePath":"/dev/thermal/cdev-by-name/thermal-gpufreq-0/user_vote",
-            "State2Power":["4599", "3727", "3259", "2378", "2044", "1813", "1449", "1223", "1007", "804", "633", "452"],
-            "PowerRail":"S2S_VDD_G3D"
+            "State2Power":["4599", "3727", "3259", "2378", "2044", "1813", "1449", "1223", "1007", "804", "633", "452"]
         },
         {
             "Name":"fcc",
@@ -783,5 +785,67 @@
             "Name":"wlc_fcc",
             "Type":"BATTERY"
         }
+    ],
+    "PowerRails":[
+        {
+            "Name":"PPVAR_VSYS_PWR_DISP"
+        },
+        {
+            "Name":"VSYS_PWR_MODEM"
+        },
+        {
+            "Name":"S2M_VDD_CPUCL2",
+            "PowerSampleDelay":14000,
+            "PowerSampleCount":5
+
+        },
+        {
+            "Name":"S3M_VDD_CPUCL1",
+            "PowerSampleDelay":14000,
+            "PowerSampleCount":5
+        },
+        {
+            "Name":"S4M_VDD_CPUCL0",
+            "PowerSampleDelay":14000,
+            "PowerSampleCount":5
+        },
+        {
+            "Name":"S5M_VDD_INT"
+        },
+        {
+            "Name":"S5M_VDD_MIF"
+        },
+        {
+            "Name":"S2S_VDD_G3D",
+            "PowerSampleDelay":14000,
+            "PowerSampleCount":5
+        },
+        {
+            "Name":"POWER_FOR_CHARGING_THROTTLING",
+            "VirtualRails":true,
+            "Formula":"WEIGHTED_AVG",
+            "Combination":[
+                "PPVAR_VSYS_PWR_DISP",
+                "VSYS_PWR_MODEM",
+                "S2M_VDD_CPUCL2",
+                "S3M_VDD_CPUCL1",
+                "S4M_VDD_CPUCL0",
+                "S5M_VDD_INT",
+                "S1M_VDD_MIF",
+                "S2S_VDD_G3D"
+            ],
+            "Coefficient":[
+                "1.0",
+                "1.0",
+                "1.0",
+                "1.0",
+                "1.0",
+                "1.0",
+                "1.0",
+                "1.0"
+            ],
+            "PowerSampleDelay":14000,
+            "PowerSampleCount":5
+        }
     ]
 }
diff --git a/thermal_info_config_raven.json b/thermal_info_config_raven.json
index bbeb7a5..5b250f6 100644
--- a/thermal_info_config_raven.json
+++ b/thermal_info_config_raven.json
@@ -225,10 +225,10 @@
                 "disp_therm"
             ],
             "Coefficient":[
-                "0.25",
-                "0.75"
+                "0.15",
+                "0.85"
             ],
-            "Offset":1000,
+            "Offset":2000,
             "HotThreshold":[
                 "NAN",
                 "NAN",
@@ -297,47 +297,48 @@
             "BindedCdevInfo": [
                 {
                     "CdevRequest": "thermal-cpufreq-0",
-                    "CdevWeightForPID":0.9,
-                    "CdevCeilingForPID":6,
+                    "CdevWeightForPID": [0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9],
+                    "CdevCeiling": [6, 6, 6, 7, 8, 10, 10],
                     "LimitInfo": [0, 0, 0, 7, 8, 10, 10],
+                    "BindedPowerRail": "S4M_VDD_CPUCL0",
                     "PowerThreshold": [200, 200, 200, 200, 50, 0, 0],
-                    "PowerSampleDelay":14000,
-                    "PowerSampleCount":5,
                     "ReleaseLogic": "DECREASE"
                 },
                 {
                     "CdevRequest": "thermal-cpufreq-1",
-                    "CdevWeightForPID":1.1,
-                    "CdevCeilingForPID":7,
+                    "CdevWeightForPID": [1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1],
+                    "CdevCeiling": [7, 7, 7, 8, 9, 11, 11],
                     "LimitInfo": [0, 0, 0, 8, 9, 11, 11],
+                    "BindedPowerRail": "S3M_VDD_CPUCL1",
                     "PowerThreshold": [200, 200, 200, 200, 50, 0, 0],
-                    "PowerSampleDelay":14000,
-                    "PowerSampleCount":5,
                     "ReleaseLogic": "DECREASE"
                 },
                 {
                     "CdevRequest": "thermal-cpufreq-2",
-                    "CdevWeightForPID":2.9,
-                    "CdevCeilingForPID":12,
+                    "CdevWeightForPID": [2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9],
+                    "CdevCeiling": [12, 12, 12, 13, 14, 16, 16],
                     "LimitInfo": [0, 0, 0, 13, 14, 16, 16],
+                    "BindedPowerRail": "S2M_VDD_CPUCL2",
                     "PowerThreshold": [200, 200, 200, 200, 50, 0, 0],
-                    "PowerSampleDelay":14000,
-                    "PowerSampleCount":5,
                     "ReleaseLogic": "DECREASE"
                 },
                 {
                     "CdevRequest": "thermal-gpufreq-0",
-                    "CdevWeightForPID":3.3,
-                    "CdevCeilingForPID":7,
+                    "CdevWeightForPID": [3.3, 3.3, 3.3, 3.3, 3.3, 3.3, 3.3],
+                    "CdevCeiling": [7, 7, 7, 8, 10, 11, 11],
                     "LimitInfo": [0, 0, 0, 8, 10, 11, 11],
+                    "BindedPowerRail": "S2S_VDD_G3D",
                     "PowerThreshold": [200, 200, 200, 200, 50, 0, 0],
-                    "PowerSampleDelay":14000,
-                    "PowerSampleCount":5,
                     "ReleaseLogic": "DECREASE"
                 },
                 {
                     "CdevRequest": "fcc",
-                    "LimitInfo": [0, 2, 3, 5, 5, 5, 5]
+                    "LimitInfo": [0, 2, 3, 4, 4, 4, 4],
+                    "BindedPowerRail": "POWER_FOR_CHARGING_THROTTLING",
+                    "PowerThreshold": [500, 500, 500, 500, 500, 0, 0],
+                    "CdevFloorWithPowerLink": [0, 0, 1, 2, 3 ,4 ,4],
+                    "ReleaseLogic": "RELEASE_TO_FLOOR",
+                    "ThrottlingWithPowerLink":true
                 },
                 {
                     "CdevRequest": "dc_icl",
@@ -345,7 +346,12 @@
                 },
                 {
                     "CdevRequest": "wlc_fcc",
-                    "LimitInfo": [0, 1, 2, 4, 4, 4, 4]
+                    "LimitInfo": [0, 1, 1, 2, 3, 3, 3],
+                    "BindedPowerRail": "POWER_FOR_CHARGING_THROTTLING",
+                    "PowerThreshold": [500, 500, 500, 500, 500, 0, 0],
+                    "CdevFloorWithPowerLink": [0, 0, 0, 1, 2 ,3 ,3],
+                    "ReleaseLogic": "RELEASE_TO_FLOOR",
+                    "ThrottlingWithPowerLink":true
                 }
             ]
         },
@@ -783,5 +789,67 @@
             "Name":"wlc_fcc",
             "Type":"BATTERY"
         }
+    ],
+    "PowerRails":[
+        {
+            "Name":"PPVAR_VSYS_PWR_DISP"
+        },
+        {
+            "Name":"VSYS_PWR_MODEM"
+        },
+        {
+            "Name":"S2M_VDD_CPUCL2",
+            "PowerSampleDelay":14000,
+            "PowerSampleCount":5
+
+        },
+        {
+            "Name":"S3M_VDD_CPUCL1",
+            "PowerSampleDelay":14000,
+            "PowerSampleCount":5
+        },
+        {
+            "Name":"S4M_VDD_CPUCL0",
+            "PowerSampleDelay":14000,
+            "PowerSampleCount":5
+        },
+        {
+            "Name":"S5M_VDD_INT"
+        },
+        {
+            "Name":"S5M_VDD_MIF"
+        },
+        {
+            "Name":"S2S_VDD_G3D",
+            "PowerSampleDelay":14000,
+            "PowerSampleCount":5
+        },
+        {
+            "Name":"POWER_FOR_CHARGING_THROTTLING",
+            "VirtualRails":true,
+            "Formula":"WEIGHTED_AVG",
+            "Combination":[
+                "PPVAR_VSYS_PWR_DISP",
+                "VSYS_PWR_MODEM",
+                "S2M_VDD_CPUCL2",
+                "S3M_VDD_CPUCL1",
+                "S4M_VDD_CPUCL0",
+                "S5M_VDD_INT",
+                "S1M_VDD_MIF",
+                "S2S_VDD_G3D"
+            ],
+            "Coefficient":[
+                "1.0",
+                "1.0",
+                "1.0",
+                "1.0",
+                "1.0",
+                "1.0",
+                "1.0",
+                "1.0"
+            ],
+            "PowerSampleDelay":14000,
+            "PowerSampleCount":5
+        }
     ]
 }