thermal-hal: add support for severity in HAL config for throttling threshold

Add support to selectively configure thermal HAL severity for
throttling threshold for any HAL config.

Change-Id: Ia502bfffaa9fb3db3f5c3c61e65acb1b1c83d509
Signed-off-by: Priyansh Jain <quic_priyjain@quicinc.com>
diff --git a/thermalCommon.cpp b/thermalCommon.cpp
index 1bbe2cf..d1e18e7 100644
--- a/thermalCommon.cpp
+++ b/thermalCommon.cpp
@@ -30,7 +30,7 @@
 
 /* Changes from Qualcomm Innovation Center are provided under the following license:
 
-Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
 SPDX-License-Identifier: BSD-3-Clause-Clear */
 
 #include <cstdio>
@@ -266,16 +266,17 @@
 	sensor.lastThrottleStatus = sensor.t.throttlingStatus =
 		ThrottlingSeverity::NONE;
 	sensor.thresh.type = sensor.t.type = cfg.type;
+	sensor.throt_severity = cfg.throt_severity;
 	for (idx = 0; idx <= (size_t)ThrottlingSeverity::SHUTDOWN; idx++) {
 		sensor.thresh.hotThrottlingThresholds.push_back(UNKNOWN_TEMPERATURE);
 		sensor.thresh.coldThrottlingThresholds.push_back(UNKNOWN_TEMPERATURE);
 	}
 
 	if (cfg.throt_thresh != 0 && cfg.positive_thresh_ramp)
-		sensor.thresh.hotThrottlingThresholds[(size_t)ThrottlingSeverity::SEVERE] =
+		sensor.thresh.hotThrottlingThresholds[(size_t)sensor.throt_severity] =
 			cfg.throt_thresh / (float)sensor.mulFactor;
 	else if (cfg.throt_thresh != 0 && !cfg.positive_thresh_ramp)
-		sensor.thresh.coldThrottlingThresholds[(size_t)ThrottlingSeverity::SEVERE] =
+		sensor.thresh.coldThrottlingThresholds[(size_t)sensor.throt_severity] =
 			cfg.throt_thresh / (float)sensor.mulFactor;
 
 	if (cfg.shutdwn_thresh != 0 && cfg.positive_thresh_ramp)