Remove unused set_pmqos_data() and not-supported PASS_RESOURCE_NONSTANDARD_ID 32/315732/1
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 28 Nov 2024 08:12:04 +0000 (17:12 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Wed, 4 Dec 2024 08:56:38 +0000 (17:56 +0900)
Remove unused set_pmqos_data() and not-supported PASS_RESOURCE_NONSTANDARD_ID
because it doesn't need to be used anymore.

Change-Id: I447b067b6255060e15f42de0746959bebe655e56
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
include/hal-power-interface-1.h
include/hal-power.h
packaging/hal-api-power.spec
src/hal-api-power.c
tests/unittest/test-hal-api-power.cc

index 5f3a295f0cb83ef2316e168fbe12df5a5bc703ee..a7d286a7298a3da440bfa010e6125b6c73f131ca 100644 (file)
@@ -161,41 +161,12 @@ struct pass_resource_battery {
        struct pass_resource_battery_ops battery;
 };
 
-/*
- * Define the resource structure for nonstandard H/W.
- *
- * @tmu                : function lists for the TMU (Thermal Management Unit).
- * @battery    : function lists for the battery charging.
- *
- * Following function is Deprecated. (Not recommended for use)
- * @set_pmqos_data : function to bypass the scenario data to HAL.
- *
- * This structure indicates the nonstandard H/W which doesn't have
- * the official supported framework (e.g., cpufreq, devfreq and so on)
- * in Linux Kernel. But, the specific device might be controlled
- * according to PMQoS scenario or other cases.
- */
-struct pass_resource_nonstandard {
-       struct pass_resource_tmu_ops tmu;
-       struct pass_resource_battery_ops battery;
-
-       /*
-        * NOTE: It is not proper method. But PASS must need to keep
-        * the backwards compatibility, set the PMQoS's data from
-        * platform to hal. So, It is not recommended to use it.
-        *
-        * This function will be removed after finding the proper method.
-        */
-       int (*set_pmqos_data)(char *res_name, void *data);
-};
-
 typedef struct _hal_backend_power_funcs {
        struct pass_resource_cpu *cpu;
        struct pass_resource_bus *bus;
        struct pass_resource_gpu *gpu;
        struct pass_resource_memory *memory;
        struct pass_resource_battery *battery;
-       struct pass_resource_nonstandard *nonstandard;
 } hal_backend_power_funcs;
 
 /**
index 4a90fab1cc0289bb04cbf882b0c64c4f73130255..d8bf83ad25f34d9a4e967382e8d2218cff545f82 100644 (file)
@@ -35,7 +35,6 @@ extern "C" {
 #define PASS_RESOURCE_PROCESS_GROUP_ID 9
 #define PASS_RESOURCE_DISK_ID          10
 #define PASS_RESOURCE_NETWORK_ID       11
-#define PASS_RESOURCE_NONSTANDARD_ID   99
 
 #define PASS_RESOURCE_CPU_NAME         "cpu"
 #define PASS_RESOURCE_BUS_NAME         "bus"
@@ -48,7 +47,6 @@ extern "C" {
 #define PASS_RESOURCE_PROCESS_GROUP_NAME "process_group"
 #define PASS_RESOURCE_DISK_NAME                "disk"
 #define PASS_RESOURCE_NETWORK_NAME     "network"
-#define PASS_RESOURCE_NONSTANDARD_NAME "nonstandard"
 
 int hal_power_get_backend(unsigned int res_type);
 int hal_power_put_backend(void);
@@ -129,18 +127,6 @@ int hal_power_battery_get_charging_current(unsigned int device_type, char *res_n
 int hal_power_memory_get_fault_around_bytes(unsigned int res_type, char *res_name);
 int hal_power_memory_set_fault_around_bytes(unsigned int res_type, char *res_name, int fault_around_bytes);
 
-/**
- * Miscellaneous Operation for CPU/BUS/GPU H/W
- */
-/*
- * NOTE: It is deprecated method. But PASS must need to keep
- * the backwards compatibility, set the PMQoS's data from
- * platform to hal. So, It is not recommended to use it.
- *
- * This function will be removed after finding the proper method.
- */
-int hal_power_misc_set_pmqos_data(unsigned int res_type, char *res_name, void *data);
-
 #ifdef __cplusplus
 }
 #endif
index ec274fd66c8d56dc92d592224e999a7c5081bfc2..9c58b1ddaf09f08a494426fd801a12d1610e50d9 100644 (file)
@@ -5,7 +5,7 @@
 ### main package #########
 Name:       %{name}
 Summary:    %{name} interface
-Version:    0.0.1
+Version:    0.0.2
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
index 11b207cb7b1185fe0137a51e32d8c9139f98455e..68b52343d304591b4e276b0acf117174b681107e 100644 (file)
@@ -59,10 +59,6 @@ static int is_supported_from_backend(hal_backend_power_funcs *funcs, int res_typ
                if (funcs && funcs->battery)
                        return 1;
                break;
-       case PASS_RESOURCE_NONSTANDARD_ID:
-               if (funcs && funcs->nonstandard)
-                       return 1;
-               break;
        case PASS_RESOURCE_PROCESS_ID:
        case PASS_RESOURCE_DISPLAY_ID:
        case PASS_RESOURCE_SYSTEM_ID:
@@ -133,10 +129,6 @@ static int get_tmu(hal_backend_power_funcs *funcs, int res_type, char *res_name,
                if (funcs && funcs->battery)
                        *tmu = &(funcs->battery->tmu);
                break;
-       case PASS_RESOURCE_NONSTANDARD_ID:
-               if (funcs && funcs->nonstandard)
-                       *tmu = &(funcs->nonstandard->tmu);
-               break;
        default:
                return -EPERM;
        }
@@ -177,10 +169,6 @@ static int get_charging(hal_backend_power_funcs *funcs, int res_type, char *res_
                if (funcs && funcs->battery)
                        *charging = &(funcs->battery->battery);
                break;
-       case PASS_RESOURCE_NONSTANDARD_ID:
-               if (funcs && funcs->nonstandard)
-                       *charging = &(funcs->nonstandard->battery);
-               break;
        default:
                return -EPERM;
        }
@@ -227,12 +215,6 @@ static int init_backend(void **data, void *user_data)
                goto err_memory;
        }
 
-       power_funcs->nonstandard = calloc(1, sizeof(struct pass_resource_nonstandard));
-       if (!power_funcs->nonstandard) {
-               ret = -ENOMEM;
-               goto err_battery;
-       }
-
        *data = (void *)power_funcs;
 
        return 0;
@@ -267,7 +249,6 @@ static int exit_backend(void *data, void *user_data)
        free(funcs->gpu);
        free(funcs->memory);
        free(funcs->battery);
-       free(funcs->nonstandard);
 
        free(funcs);
 
@@ -849,38 +830,3 @@ EXPORT int hal_power_memory_set_fault_around_bytes(unsigned int res_type,
 
        return exec_func_with_int(memory->set_fault_around_bytes, res_name, fault_around_bytes);
 }
-
-/**
- * Miscellaneous Operation for CPU/BUS/GPU H/W
- */
-/*
- * NOTE: It is not propper method. But PASS must need to keep
- * the backwards compatibility, set the PMQoS's data from
- * platform to hal. So, It is not recommended to use it.
- *
- * This function will be removed after finding the proper method.
- */
-EXPORT int hal_power_misc_set_pmqos_data(unsigned int res_type,
-                                               char *res_name, void *data)
-{
-       struct pass_resource_nonstandard *nonstandard = NULL;
-
-       if (!g_power_funcs)
-               return -ENOTSUP;
-
-       if (!res_name || !data)
-               return -EINVAL;
-
-       switch (res_type) {
-       case PASS_RESOURCE_NONSTANDARD_ID:
-               nonstandard = g_power_funcs->nonstandard;
-               break;
-       default:
-               return -EPERM;
-       }
-
-       if (!nonstandard->set_pmqos_data)
-               return -ENOTSUP;
-
-       return nonstandard->set_pmqos_data(res_name, data);
-}
index a28af6219dc4063f82b187bd33a2d5c1dc557007..b38b6a5ffae4e685348a697835df6908558734a1 100644 (file)
@@ -209,14 +209,6 @@ TEST(HalApiPowerTest, hal_power_get_backend_with_memory_id) {
        EXPECT_TRUE(ret == 0);
 }
 
-TEST(HalApiPowerTest, hal_power_get_backend_with_nonstandard_id) {
-       int ret = hal_power_get_backend(PASS_RESOURCE_NONSTANDARD_ID);
-       EXPECT_TRUE(ret != 0);
-
-       ret = hal_power_put_backend();
-       EXPECT_TRUE(ret == 0);
-}
-
 TEST(HalApiPowerTest, hal_power_dvfs_get_curr_governor_valid) {
        int ret;
        char governor[MAX_BUFF];
@@ -259,8 +251,6 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_curr_governor_invalid) {
 
        ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_MEMORY_ID, res_name, governor);
        EXPECT_TRUE(ret == -EPERM);
-       ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_NONSTANDARD_ID, res_name, governor);
-       EXPECT_TRUE(ret == -EPERM);
 
        ret = test_end();
        EXPECT_TRUE(ret == 0);
@@ -304,8 +294,6 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_curr_freq_invalid) {
 
        ret = hal_power_dvfs_get_curr_freq(PASS_RESOURCE_MEMORY_ID, res_name);
        EXPECT_TRUE(ret == -EPERM);
-       ret = hal_power_dvfs_get_curr_freq(PASS_RESOURCE_NONSTANDARD_ID, res_name);
-       EXPECT_TRUE(ret == -EPERM);
 
        ret = test_end();
        EXPECT_TRUE(ret == 0);
@@ -349,8 +337,6 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_min_freq_invalid) {
 
        ret = hal_power_dvfs_get_min_freq(PASS_RESOURCE_MEMORY_ID, res_name);
        EXPECT_TRUE(ret == -EPERM);
-       ret = hal_power_dvfs_get_min_freq(PASS_RESOURCE_NONSTANDARD_ID, res_name);
-       EXPECT_TRUE(ret == -EPERM);
 
        ret = test_end();
        EXPECT_TRUE(ret == 0);
@@ -394,8 +380,6 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_max_freq_invalid) {
 
        ret = hal_power_dvfs_get_max_freq(PASS_RESOURCE_MEMORY_ID, res_name);
        EXPECT_TRUE(ret == -EPERM);
-       ret = hal_power_dvfs_get_max_freq(PASS_RESOURCE_NONSTANDARD_ID, res_name);
-       EXPECT_TRUE(ret == -EPERM);
 
        ret = test_end();
        EXPECT_TRUE(ret == 0);
@@ -447,8 +431,6 @@ TEST(HalApiPowerTest, hal_power_dvfs_set_min_freq_invalid) {
 
        ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_MEMORY_ID, res_name, 0);
        EXPECT_TRUE(ret != 0);
-       ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_NONSTANDARD_ID, res_name, 0);
-       EXPECT_TRUE(ret != 0);
 
        ret = test_end();
        EXPECT_TRUE(ret == 0);
@@ -500,8 +482,6 @@ TEST(HalApiPowerTest, hal_power_dvfs_set_max_freq_invalid) {
 
        ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_MEMORY_ID, res_name, 0);
        EXPECT_TRUE(ret != 0);
-       ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_NONSTANDARD_ID, res_name, 0);
-       EXPECT_TRUE(ret != 0);
 
        ret = test_end();
        EXPECT_TRUE(ret == 0);