halapi: power: Add support of thermal operation for PASS_RESOURCE_NONSTANDARD_ID 54/262154/3 accepted/tizen/unified/20210809.061405 submit/tizen/20210809.032652 submit/tizen/20210813.013856
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 2 Aug 2021 05:15:57 +0000 (14:15 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 4 Aug 2021 01:07:28 +0000 (10:07 +0900)
The non-standard h/w resource doesn't depend on the any specific linux
kernel subsystem. But, any h/w resources are able to be affected from
temperature. So that add support of thermal operation
for PASS_RESOURCE_NONSTANDARD_ID to control the over-temperature
with the proper behaviors.

Change-Id: I1fb20b5ee10aa876a95fde899bdcfdd537c7633c
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
include/hal-power-interface.h
src/hal-api-power.c

index f40670b6460fd9772c357d6757f8935219815fa7..b3cef4f423ec0c2e757d5594370d038f6022b3d8 100644 (file)
@@ -142,6 +142,8 @@ struct pass_resource_battery {
 /*
  * Define the resource structure for nonstandard H/W.
  *
+ * @tmu                : function lists for the TMU (Thermal Management Unit).
+ *
  * Following function is Deprecated. (Not recommended for use)
  * @set_pmqos_data : function to bypass the scenario data to HAL.
  *
@@ -151,6 +153,8 @@ struct pass_resource_battery {
  * according to PMQoS scenario or other cases.
  */
 struct pass_resource_nonstandard {
+       struct pass_resource_tmu_ops tmu;
+
        /*
         * NOTE: It is not propper method. But PASS must need to keep
         * the backwards compatibility, set the PMQoS's data from
index 1248a1d4763c0577283ae46e2b114dd48bfc2b60..18e631f9a9e830fa03cd5dca688d10645c62df0e 100644 (file)
@@ -110,6 +110,10 @@ static struct pass_resource_tmu_ops *get_tmu(hal_backend_power_funcs *funcs,
                if (funcs && funcs->battery)
                        tmu = &(funcs->battery->tmu);
                break;
+       case PASS_RESOURCE_NONSTANDARD_ID:
+               if (funcs && funcs->nonstandard)
+                       tmu = &(funcs->nonstandard->tmu);
+               break;
        }
 
        return tmu;