From: Unsung Lee Date: Mon, 16 Dec 2024 10:07:28 +0000 (+0900) Subject: Replace prefix from 'pass' and 'PASS' to 'hal_power' and 'HAL_POWER' X-Git-Tag: accepted/tizen/unified/20250115.124148^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_unified;p=platform%2Fhal%2Fapi%2Fpower.git Replace prefix from 'pass' and 'PASS' to 'hal_power' and 'HAL_POWER' Replace prefix of struct name from 'pass' to 'hal_power' for consistency. In general, when naming a structure in hal API, use hal_ as a prefix. Previously, in hal API power, 'pass' was used as a prefix in the structure name instead of 'hal_power'. Similarly, replace prefix of macro name from 'PASS' to 'HAL_POWER' for consistency. Previously, in macros, 'PASS' was used instead of HAL_POWER as the prefix. Change-Id: Iaab468e49dde514f1243b74c7d7a80409a37ec74 Signed-off-by: Unsung Lee --- diff --git a/include/hal-power-interface-1.h b/include/hal-power-interface-1.h index 5752bc5..3666f3a 100644 --- a/include/hal-power-interface-1.h +++ b/include/hal-power-interface-1.h @@ -34,7 +34,7 @@ extern "C" { * @brief Structure for DVFS (Dynamic Volt. & Freq. Scaling) operations. * @since HAL_MODULE_POWER 1.0 */ -struct pass_resource_dvfs_ops { +struct hal_power_resource_dvfs_ops { int (*get_curr_governor)(char *res_name, char *governor); /**< Get the current governor */ int (*set_curr_governor)(char *res_name, char *governor); /**< Set the current governor */ @@ -54,14 +54,14 @@ struct pass_resource_dvfs_ops { int (*get_up_threshold)(char *res_name); /**< Get the up_threshold to support boosting */ int (*set_up_threshold)(char *res_name, int up_threshold); /**< Set the up_threshold to support boosting */ - int (*get_load_table)(char *name, void *pass_cpu_load_table); /**< Get the load_table of each resource to estimate the system load */ + int (*get_load_table)(char *name, void *hal_power_cpu_load_table); /**< Get the load_table of each resource to estimate the system load */ }; /** * @brief Structure for CPU hotplug operations. * @since HAL_MODULE_POWER 1.0 */ -struct pass_resource_hotplug_ops { +struct hal_power_resource_hotplug_ops { int (*get_online_state)(char *res_name, int cpu); /**< Get the online status of resource */ int (*set_online_state)(char *res_name, int cpu, int on); /**< Set the online status of resource */ int (*get_online_min_num) (char *res_name); /* Get the minimum number of online CPUs */ @@ -74,7 +74,7 @@ struct pass_resource_hotplug_ops { * @brief Structure for TMU (Thermal Management Unit) operations. * @since HAL_MODULE_POWER 1.0 */ -struct pass_resource_tmu_ops { +struct hal_power_resource_tmu_ops { int (*get_temp)(char *res_thermal_name); /**< Get the current temperature of resource */ int (*get_policy)(char *res_thermal_name, char *policy); /**< Get the policy of thermal management unit */ @@ -89,7 +89,7 @@ struct pass_resource_tmu_ops { * @brief Structure for battery operations. * @since HAL_MODULE_POWER 1.0 */ -struct pass_resource_battery_ops { +struct hal_power_resource_battery_ops { int (*set_charging_status)(char *res_name, int state); /**< Set the state of battery charging */ int (*get_charging_status)(char *res_name); /**< Get the state of battery charging */ @@ -101,19 +101,19 @@ struct pass_resource_battery_ops { * @brief Structure for CPU H/W. * @since HAL_MODULE_POWER 1.0 */ -struct pass_resource_cpu { - struct pass_resource_dvfs_ops dvfs; /**< Function lists for DVFS (Dynamic Volt. & Freq. Scaling) */ - struct pass_resource_tmu_ops tmu; /**< Function lists for function lists for the TMU (Thermal Management Unit) */ - struct pass_resource_hotplug_ops hotplug; /**< Function lists for the CPU on/off */ +struct hal_power_resource_cpu { + struct hal_power_resource_dvfs_ops dvfs; /**< Function lists for DVFS (Dynamic Volt. & Freq. Scaling) */ + struct hal_power_resource_tmu_ops tmu; /**< Function lists for function lists for the TMU (Thermal Management Unit) */ + struct hal_power_resource_hotplug_ops hotplug; /**< Function lists for the CPU on/off */ }; /** * @brief Structure for Memory Bus H/W. * @since HAL_MODULE_POWER 1.0 */ -struct pass_resource_bus { - struct pass_resource_dvfs_ops dvfs; /**< Function lists for DVFS (Dynamic Volt. & Freq. Scaling) */ - struct pass_resource_tmu_ops tmu; /**< Function lists for function lists for the TMU (Thermal Management Unit) */ +struct hal_power_resource_bus { + struct hal_power_resource_dvfs_ops dvfs; /**< Function lists for DVFS (Dynamic Volt. & Freq. Scaling) */ + struct hal_power_resource_tmu_ops tmu; /**< Function lists for function lists for the TMU (Thermal Management Unit) */ }; @@ -121,16 +121,16 @@ struct pass_resource_bus { * @brief Structure for GPU H/W. * @since HAL_MODULE_POWER 1.0 */ -struct pass_resource_gpu { - struct pass_resource_dvfs_ops dvfs; /**< Function lists for DVFS (Dynamic Volt. & Freq. Scaling) */ - struct pass_resource_tmu_ops tmu; /**< Function lists for function lists for the TMU (Thermal Management Unit) */ +struct hal_power_resource_gpu { + struct hal_power_resource_dvfs_ops dvfs; /**< Function lists for DVFS (Dynamic Volt. & Freq. Scaling) */ + struct hal_power_resource_tmu_ops tmu; /**< Function lists for function lists for the TMU (Thermal Management Unit) */ }; /** * @brief Structure for Memory H/W. * @since HAL_MODULE_POWER 1.0 */ -struct pass_resource_memory { +struct hal_power_resource_memory { int (*get_fault_around_bytes)(char *res_name); /**< Get the /sys/kernel/debug/fault_around_bytes */ int (*set_fault_around_bytes)(char *res_name, int fault_around_bytes); /**< Set the /sys/kernel/debug/fault_around_bytes */ }; @@ -139,9 +139,9 @@ struct pass_resource_memory { * @brief Structure for Battery H/W. * @since HAL_MODULE_POWER 1.0 */ -struct pass_resource_battery { - struct pass_resource_tmu_ops tmu; /**< Function lists for thermal management unit */ - struct pass_resource_battery_ops battery; /**< Function lists for battery */ +struct hal_power_resource_battery { + struct hal_power_resource_tmu_ops tmu; /**< Function lists for thermal management unit */ + struct hal_power_resource_battery_ops battery; /**< Function lists for battery */ }; /** @@ -149,11 +149,11 @@ struct pass_resource_battery { * @since HAL_MODULE_POWER 1.0 */ typedef struct _hal_backend_power_funcs { - struct pass_resource_cpu *cpu; /**< Function lists for CPU */ - struct pass_resource_bus *bus; /**< Function lists for bus */ - struct pass_resource_gpu *gpu; /**< Function lists for GPU */ - struct pass_resource_memory *memory; /**< Function lists for memory */ - struct pass_resource_battery *battery; /**< Function lists for battery */ + struct hal_power_resource_cpu *cpu; /**< Function lists for CPU */ + struct hal_power_resource_bus *bus; /**< Function lists for bus */ + struct hal_power_resource_gpu *gpu; /**< Function lists for GPU */ + struct hal_power_resource_memory *memory; /**< Function lists for memory */ + struct hal_power_resource_battery *battery; /**< Function lists for battery */ } hal_backend_power_funcs; /** diff --git a/include/hal-power.h b/include/hal-power.h index d8bf83a..bbbc12e 100644 --- a/include/hal-power.h +++ b/include/hal-power.h @@ -23,30 +23,30 @@ extern "C" { #endif -#define PASS_RESOURCE_UNKNOWN 0 -#define PASS_RESOURCE_CPU_ID 1 -#define PASS_RESOURCE_BUS_ID 2 -#define PASS_RESOURCE_GPU_ID 3 -#define PASS_RESOURCE_MEMORY_ID 4 -#define PASS_RESOURCE_BATTERY_ID 5 -#define PASS_RESOURCE_PROCESS_ID 6 -#define PASS_RESOURCE_DISPLAY_ID 7 -#define PASS_RESOURCE_SYSTEM_ID 8 -#define PASS_RESOURCE_PROCESS_GROUP_ID 9 -#define PASS_RESOURCE_DISK_ID 10 -#define PASS_RESOURCE_NETWORK_ID 11 - -#define PASS_RESOURCE_CPU_NAME "cpu" -#define PASS_RESOURCE_BUS_NAME "bus" -#define PASS_RESOURCE_GPU_NAME "gpu" -#define PASS_RESOURCE_MEMORY_NAME "memory" -#define PASS_RESOURCE_BATTERY_NAME "battery" -#define PASS_RESOURCE_PROCESS_NAME "process" -#define PASS_RESOURCE_DISPLAY_NAME "display" -#define PASS_RESOURCE_SYSTEM_NAME "system" -#define PASS_RESOURCE_PROCESS_GROUP_NAME "process_group" -#define PASS_RESOURCE_DISK_NAME "disk" -#define PASS_RESOURCE_NETWORK_NAME "network" +#define HAL_POWER_RESOURCE_UNKNOWN 0 +#define HAL_POWER_RESOURCE_CPU_ID 1 +#define HAL_POWER_RESOURCE_BUS_ID 2 +#define HAL_POWER_RESOURCE_GPU_ID 3 +#define HAL_POWER_RESOURCE_MEMORY_ID 4 +#define HAL_POWER_RESOURCE_BATTERY_ID 5 +#define HAL_POWER_RESOURCE_PROCESS_ID 6 +#define HAL_POWER_RESOURCE_DISPLAY_ID 7 +#define HAL_POWER_RESOURCE_SYSTEM_ID 8 +#define HAL_POWER_RESOURCE_PROCESS_GROUP_ID 9 +#define HAL_POWER_RESOURCE_DISK_ID 10 +#define HAL_POWER_RESOURCE_NETWORK_ID 11 + +#define HAL_POWER_RESOURCE_CPU_NAME "cpu" +#define HAL_POWER_RESOURCE_BUS_NAME "bus" +#define HAL_POWER_RESOURCE_GPU_NAME "gpu" +#define HAL_POWER_RESOURCE_MEMORY_NAME "memory" +#define HAL_POWER_RESOURCE_BATTERY_NAME "battery" +#define HAL_POWER_RESOURCE_PROCESS_NAME "process" +#define HAL_POWER_RESOURCE_DISPLAY_NAME "display" +#define HAL_POWER_RESOURCE_SYSTEM_NAME "system" +#define HAL_POWER_RESOURCE_PROCESS_GROUP_NAME "process_group" +#define HAL_POWER_RESOURCE_DISK_NAME "disk" +#define HAL_POWER_RESOURCE_NETWORK_NAME "network" int hal_power_get_backend(unsigned int res_type); int hal_power_put_backend(void); @@ -79,7 +79,7 @@ int hal_power_dvfs_get_up_threshold(unsigned int res_type, char *res_name); int hal_power_dvfs_set_up_threshold(unsigned int res_type, char *res_name, int up_threshold); /* Get the load_table of each resource to estimate the system load. */ -int hal_power_dvfs_get_load_table(unsigned int res_type, char *name, void *pass_cpu_load_table); +int hal_power_dvfs_get_load_table(unsigned int res_type, char *name, void *hal_power_cpu_load_table); /** * CPU Hotplug Operation for CPU H/W diff --git a/src/hal-api-power.c b/src/hal-api-power.c index 1a60b51..0aa9ff4 100644 --- a/src/hal-api-power.c +++ b/src/hal-api-power.c @@ -39,32 +39,32 @@ static unsigned int g_power_funcs_count = 0; static int is_supported_from_backend(hal_backend_power_funcs *funcs, int res_type) { switch (res_type) { - case PASS_RESOURCE_CPU_ID: + case HAL_POWER_RESOURCE_CPU_ID: if (funcs && funcs->cpu) return 1; break; - case PASS_RESOURCE_BUS_ID: + case HAL_POWER_RESOURCE_BUS_ID: if (funcs && funcs->bus) return 1; break; - case PASS_RESOURCE_GPU_ID: + case HAL_POWER_RESOURCE_GPU_ID: if (funcs && funcs->gpu) return 1; break; - case PASS_RESOURCE_MEMORY_ID: + case HAL_POWER_RESOURCE_MEMORY_ID: if (funcs && funcs->memory) return 1; break; - case PASS_RESOURCE_BATTERY_ID: + case HAL_POWER_RESOURCE_BATTERY_ID: if (funcs && funcs->battery) return 1; break; - case PASS_RESOURCE_PROCESS_ID: - case PASS_RESOURCE_DISPLAY_ID: - case PASS_RESOURCE_SYSTEM_ID: - case PASS_RESOURCE_PROCESS_GROUP_ID: - case PASS_RESOURCE_DISK_ID: - case PASS_RESOURCE_NETWORK_ID: + case HAL_POWER_RESOURCE_PROCESS_ID: + case HAL_POWER_RESOURCE_DISPLAY_ID: + case HAL_POWER_RESOURCE_SYSTEM_ID: + case HAL_POWER_RESOURCE_PROCESS_GROUP_ID: + case HAL_POWER_RESOURCE_DISK_ID: + case HAL_POWER_RESOURCE_NETWORK_ID: /* * These resource types have not yet needed any hal backend. * But, these resource types might need the resource @@ -77,7 +77,7 @@ static int is_supported_from_backend(hal_backend_power_funcs *funcs, int res_typ } static int get_dvfs(hal_backend_power_funcs *funcs, int res_type, char *res_name, - struct pass_resource_dvfs_ops **dvfs) + struct hal_power_resource_dvfs_ops **dvfs) { if (!funcs) return -ENOTSUP; @@ -85,15 +85,15 @@ static int get_dvfs(hal_backend_power_funcs *funcs, int res_type, char *res_name return -EINVAL; switch (res_type) { - case PASS_RESOURCE_CPU_ID: + case HAL_POWER_RESOURCE_CPU_ID: if (funcs && funcs->cpu) *dvfs = &(funcs->cpu->dvfs); break; - case PASS_RESOURCE_BUS_ID: + case HAL_POWER_RESOURCE_BUS_ID: if (funcs && funcs->bus) *dvfs = &(funcs->bus->dvfs); break; - case PASS_RESOURCE_GPU_ID: + case HAL_POWER_RESOURCE_GPU_ID: if (funcs && funcs->gpu) *dvfs = &(funcs->gpu->dvfs); break; @@ -105,7 +105,7 @@ static int get_dvfs(hal_backend_power_funcs *funcs, int res_type, char *res_name } static int get_tmu(hal_backend_power_funcs *funcs, int res_type, char *res_name, - struct pass_resource_tmu_ops **tmu) + struct hal_power_resource_tmu_ops **tmu) { if (!funcs) return -ENOTSUP; @@ -113,19 +113,19 @@ static int get_tmu(hal_backend_power_funcs *funcs, int res_type, char *res_name, return -EINVAL; switch (res_type) { - case PASS_RESOURCE_CPU_ID: + case HAL_POWER_RESOURCE_CPU_ID: if (funcs && funcs->cpu) *tmu = &(funcs->cpu->tmu); break; - case PASS_RESOURCE_BUS_ID: + case HAL_POWER_RESOURCE_BUS_ID: if (funcs && funcs->bus) *tmu = &(funcs->bus->tmu); break; - case PASS_RESOURCE_GPU_ID: + case HAL_POWER_RESOURCE_GPU_ID: if (funcs && funcs->gpu) *tmu = &(funcs->gpu->tmu); break; - case PASS_RESOURCE_BATTERY_ID: + case HAL_POWER_RESOURCE_BATTERY_ID: if (funcs && funcs->battery) *tmu = &(funcs->battery->tmu); break; @@ -137,7 +137,7 @@ static int get_tmu(hal_backend_power_funcs *funcs, int res_type, char *res_name, } static int get_hotplug(hal_backend_power_funcs *funcs, int res_type, char *res_name, - struct pass_resource_hotplug_ops **hotplug) + struct hal_power_resource_hotplug_ops **hotplug) { if (!funcs) return -ENOTSUP; @@ -145,7 +145,7 @@ static int get_hotplug(hal_backend_power_funcs *funcs, int res_type, char *res_n return -EINVAL; switch (res_type) { - case PASS_RESOURCE_CPU_ID: + case HAL_POWER_RESOURCE_CPU_ID: if (funcs && funcs->cpu) *hotplug = &(funcs->cpu->hotplug); break; @@ -157,7 +157,7 @@ static int get_hotplug(hal_backend_power_funcs *funcs, int res_type, char *res_n } static int get_charging(hal_backend_power_funcs *funcs, int res_type, char *res_name, - struct pass_resource_battery_ops **charging) + struct hal_power_resource_battery_ops **charging) { if (!funcs) return -ENOTSUP; @@ -165,7 +165,7 @@ static int get_charging(hal_backend_power_funcs *funcs, int res_type, char *res_ return -EINVAL; switch (res_type) { - case PASS_RESOURCE_BATTERY_ID: + case HAL_POWER_RESOURCE_BATTERY_ID: if (funcs && funcs->battery) *charging = &(funcs->battery->battery); break; @@ -185,31 +185,31 @@ static int init_backend(void **data, void *user_data) if (!power_funcs) return -ENOMEM; - power_funcs->cpu = calloc(1, sizeof(struct pass_resource_cpu)); + power_funcs->cpu = calloc(1, sizeof(struct hal_power_resource_cpu)); if (!power_funcs->cpu) { ret = -ENOMEM; goto err_funcs; } - power_funcs->bus = calloc(1, sizeof(struct pass_resource_bus)); + power_funcs->bus = calloc(1, sizeof(struct hal_power_resource_bus)); if (!power_funcs->bus) { ret = -ENOMEM; goto err_cpu; } - power_funcs->gpu = calloc(1, sizeof(struct pass_resource_gpu)); + power_funcs->gpu = calloc(1, sizeof(struct hal_power_resource_gpu)); if (!power_funcs->gpu) { ret = -ENOMEM; goto err_bus; } - power_funcs->memory = calloc(1, sizeof(struct pass_resource_memory)); + power_funcs->memory = calloc(1, sizeof(struct hal_power_resource_memory)); if (!power_funcs->memory) { ret = -ENOMEM; goto err_gpu; } - power_funcs->battery = calloc(1, sizeof(struct pass_resource_battery)); + power_funcs->battery = calloc(1, sizeof(struct hal_power_resource_battery)); if (!power_funcs->battery) { ret = -ENOMEM; goto err_memory; @@ -342,7 +342,7 @@ static inline int exec_func_with_int(int (*func)(char *res_name, int val), EXPORT int hal_power_dvfs_get_curr_governor(unsigned int res_type, char *res_name, char *governor) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; if (!governor) @@ -357,7 +357,7 @@ EXPORT int hal_power_dvfs_get_curr_governor(unsigned int res_type, EXPORT int hal_power_dvfs_set_curr_governor(unsigned int res_type, char *res_name, char *governor) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; if (!governor) @@ -372,7 +372,7 @@ EXPORT int hal_power_dvfs_set_curr_governor(unsigned int res_type, char *res_nam EXPORT int hal_power_dvfs_get_avail_governor(unsigned int res_type, char *res_name, char **avail_governor) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; ret = get_dvfs(g_power_funcs, res_type, res_name, &dvfs); @@ -388,7 +388,7 @@ EXPORT int hal_power_dvfs_get_avail_governor(unsigned int res_type, char *res_na /* Get the current frequency. */ EXPORT int hal_power_dvfs_get_curr_freq(unsigned int res_type, char *res_name) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; ret = get_dvfs(g_power_funcs, res_type, res_name, &dvfs); @@ -401,7 +401,7 @@ EXPORT int hal_power_dvfs_get_curr_freq(unsigned int res_type, char *res_name) /* Get and set the minimum frequency. */ EXPORT int hal_power_dvfs_get_min_freq(unsigned int res_type, char *res_name) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; ret = get_dvfs(g_power_funcs, res_type, res_name, &dvfs); @@ -413,7 +413,7 @@ EXPORT int hal_power_dvfs_get_min_freq(unsigned int res_type, char *res_name) EXPORT int hal_power_dvfs_set_min_freq(unsigned int res_type, char *res_name, int freq) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; if (freq < 0) @@ -429,7 +429,7 @@ EXPORT int hal_power_dvfs_set_min_freq(unsigned int res_type, char *res_name, in /* Get and set the maximum frequency. */ EXPORT int hal_power_dvfs_get_max_freq(unsigned int res_type, char *res_name) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; ret = get_dvfs(g_power_funcs, res_type, res_name, &dvfs); @@ -441,7 +441,7 @@ EXPORT int hal_power_dvfs_get_max_freq(unsigned int res_type, char *res_name) EXPORT int hal_power_dvfs_set_max_freq(unsigned int res_type, char *res_name, int freq) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; if (freq < 0) @@ -457,7 +457,7 @@ EXPORT int hal_power_dvfs_set_max_freq(unsigned int res_type, char *res_name, in /* Get the minimum/maximum frequency which can be set to resource. */ EXPORT int hal_power_dvfs_get_available_min_freq(unsigned int res_type, char *res_name) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; ret = get_dvfs(g_power_funcs, res_type, res_name, &dvfs); @@ -469,7 +469,7 @@ EXPORT int hal_power_dvfs_get_available_min_freq(unsigned int res_type, char *re EXPORT int hal_power_dvfs_get_available_max_freq(unsigned int res_type, char *res_name) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; ret = get_dvfs(g_power_funcs, res_type, res_name, &dvfs); @@ -482,7 +482,7 @@ EXPORT int hal_power_dvfs_get_available_max_freq(unsigned int res_type, char *re /* Get and set the up_threshold to support boosting. */ EXPORT int hal_power_dvfs_get_up_threshold(unsigned int res_type, char *res_name) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; ret = get_dvfs(g_power_funcs, res_type, res_name, &dvfs); @@ -494,7 +494,7 @@ EXPORT int hal_power_dvfs_get_up_threshold(unsigned int res_type, char *res_name EXPORT int hal_power_dvfs_set_up_threshold(unsigned int res_type, char *res_name, int up_threshold) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; if (up_threshold < 0) @@ -508,9 +508,9 @@ EXPORT int hal_power_dvfs_set_up_threshold(unsigned int res_type, char *res_name } /* Get the load_table of each resource to estimate the system load. */ -EXPORT int hal_power_dvfs_get_load_table(unsigned int res_type, char *res_name, void *pass_cpu_load_table) +EXPORT int hal_power_dvfs_get_load_table(unsigned int res_type, char *res_name, void *hal_power_cpu_load_table) { - struct pass_resource_dvfs_ops *dvfs; + struct hal_power_resource_dvfs_ops *dvfs; int ret; ret = get_dvfs(g_power_funcs, res_type, res_name, &dvfs); @@ -520,7 +520,7 @@ EXPORT int hal_power_dvfs_get_load_table(unsigned int res_type, char *res_name, if (!dvfs->get_load_table) return -ENOTSUP; - return dvfs->get_load_table(res_name, pass_cpu_load_table); + return dvfs->get_load_table(res_name, hal_power_cpu_load_table); } /** @@ -529,7 +529,7 @@ EXPORT int hal_power_dvfs_get_load_table(unsigned int res_type, char *res_name, /* Get and set the online status of resource. */ EXPORT int hal_power_hotplug_get_online_state(unsigned int res_type, char *res_name, int cpu) { - struct pass_resource_hotplug_ops *hotplug; + struct hal_power_resource_hotplug_ops *hotplug; int ret; if (cpu < 0) @@ -544,7 +544,7 @@ EXPORT int hal_power_hotplug_get_online_state(unsigned int res_type, char *res_n EXPORT int hal_power_hotplug_set_online_state(unsigned int res_type, char *res_name, int cpu, int on) { - struct pass_resource_hotplug_ops *hotplug; + struct hal_power_resource_hotplug_ops *hotplug; int ret; if (cpu < 0 || on < 0) @@ -563,7 +563,7 @@ EXPORT int hal_power_hotplug_set_online_state(unsigned int res_type, char *res_n /* Get and set the minimum number of online CPUs */ EXPORT int hal_power_hotplug_get_online_min_num(unsigned int res_type, char *res_name) { - struct pass_resource_hotplug_ops *hotplug; + struct hal_power_resource_hotplug_ops *hotplug; int ret; ret = get_hotplug(g_power_funcs, res_type, res_name, &hotplug); @@ -576,7 +576,7 @@ EXPORT int hal_power_hotplug_get_online_min_num(unsigned int res_type, char *res EXPORT int hal_power_hotplug_set_online_min_num(unsigned int res_type, char *res_name, int min_num) { - struct pass_resource_hotplug_ops *hotplug; + struct hal_power_resource_hotplug_ops *hotplug; int ret; if (min_num < 0) @@ -593,7 +593,7 @@ EXPORT int hal_power_hotplug_set_online_min_num(unsigned int res_type, EXPORT int hal_power_hotplug_get_online_max_num(unsigned int res_type, char *res_name) { - struct pass_resource_hotplug_ops *hotplug; + struct hal_power_resource_hotplug_ops *hotplug; int ret; ret = get_hotplug(g_power_funcs, res_type, res_name, &hotplug); @@ -606,7 +606,7 @@ EXPORT int hal_power_hotplug_get_online_max_num(unsigned int res_type, EXPORT int hal_power_hotplug_set_online_max_num(unsigned int res_type, char *res_name, int max_num) { - struct pass_resource_hotplug_ops *hotplug; + struct hal_power_resource_hotplug_ops *hotplug; int ret; if (max_num < 0) @@ -626,7 +626,7 @@ EXPORT int hal_power_hotplug_set_online_max_num(unsigned int res_type, EXPORT int hal_power_thermal_get_temp(unsigned int res_type, char *res_thermal_name) { - struct pass_resource_tmu_ops *tmu; + struct hal_power_resource_tmu_ops *tmu; int ret; ret = get_tmu(g_power_funcs, res_type, res_thermal_name, &tmu); @@ -645,7 +645,7 @@ EXPORT int hal_power_thermal_get_policy(unsigned int res_type, char *res_thermal_name, char *policy) { - struct pass_resource_tmu_ops *tmu; + struct hal_power_resource_tmu_ops *tmu; int ret; if (!policy) @@ -667,7 +667,7 @@ EXPORT int hal_power_thermal_set_cooling_device_state(unsigned int device_type, char *cooling_device_name, int state) { - struct pass_resource_tmu_ops *tmu; + struct hal_power_resource_tmu_ops *tmu; int ret; if (state < 0) @@ -687,7 +687,7 @@ EXPORT int hal_power_thermal_set_cooling_device_state(unsigned int device_type, EXPORT int hal_power_thermal_get_cooling_device_state(unsigned int device_type, char *cooling_device_name) { - struct pass_resource_tmu_ops *tmu; + struct hal_power_resource_tmu_ops *tmu; int ret; ret= get_tmu(g_power_funcs, device_type, cooling_device_name, &tmu); @@ -704,7 +704,7 @@ EXPORT int hal_power_thermal_get_cooling_device_state(unsigned int device_type, EXPORT int hal_power_thermal_get_cooling_device_max_state(unsigned int device_type, char *cooling_device_name) { - struct pass_resource_tmu_ops *tmu; + struct hal_power_resource_tmu_ops *tmu; int ret; ret = get_tmu(g_power_funcs, device_type, cooling_device_name, &tmu); @@ -722,7 +722,7 @@ EXPORT int hal_power_battery_set_charging_status(unsigned int device_type, char *res_name, int state) { - struct pass_resource_battery_ops *charging; + struct hal_power_resource_battery_ops *charging; int ret; if (state < 0) @@ -738,7 +738,7 @@ EXPORT int hal_power_battery_set_charging_status(unsigned int device_type, EXPORT int hal_power_battery_get_charging_status(unsigned int device_type, char *res_name) { - struct pass_resource_battery_ops *charging; + struct hal_power_resource_battery_ops *charging; int ret; ret = get_charging(g_power_funcs, device_type, res_name, &charging); @@ -752,7 +752,7 @@ EXPORT int hal_power_battery_set_charging_current(unsigned int device_type, char *res_name, int charing_current_uA) { - struct pass_resource_battery_ops *charging; + struct hal_power_resource_battery_ops *charging; int ret; if (charing_current_uA < 0) @@ -768,7 +768,7 @@ EXPORT int hal_power_battery_set_charging_current(unsigned int device_type, EXPORT int hal_power_battery_get_charging_current(unsigned int device_type, char *res_name) { - struct pass_resource_battery_ops *charging; + struct hal_power_resource_battery_ops *charging; int ret; ret = get_charging(g_power_funcs, device_type, res_name, &charging); @@ -785,14 +785,14 @@ EXPORT int hal_power_battery_get_charging_current(unsigned int device_type, EXPORT int hal_power_memory_get_fault_around_bytes(unsigned int res_type, char *res_name) { - struct pass_resource_memory *memory; + struct hal_power_resource_memory *memory; int ret; if (!res_name) return -EINVAL; switch (res_type) { - case PASS_RESOURCE_MEMORY_ID: + case HAL_POWER_RESOURCE_MEMORY_ID: memory = g_power_funcs->memory; break; default: @@ -806,7 +806,7 @@ EXPORT int hal_power_memory_set_fault_around_bytes(unsigned int res_type, char *res_name, int fault_around_bytes) { - struct pass_resource_memory *memory; + struct hal_power_resource_memory *memory; int ret; ret = is_valid_param_with_int(res_name, fault_around_bytes); @@ -824,7 +824,7 @@ EXPORT int hal_power_memory_set_fault_around_bytes(unsigned int res_type, return -EINVAL; switch (res_type) { - case PASS_RESOURCE_MEMORY_ID: + case HAL_POWER_RESOURCE_MEMORY_ID: memory = g_power_funcs->memory; break; default: diff --git a/tests/unittest/hal-backend-power.c b/tests/unittest/hal-backend-power.c index 3f0bbb6..cb0594e 100644 --- a/tests/unittest/hal-backend-power.c +++ b/tests/unittest/hal-backend-power.c @@ -52,7 +52,7 @@ static int set_value(char *res_name, int value) return 0; } -static struct pass_resource_dvfs_ops cpufreq_dvfs_ops = { +static struct hal_power_resource_dvfs_ops cpufreq_dvfs_ops = { .get_curr_governor = get_string_value, .set_curr_governor = set_string_value, .get_curr_freq = get_value, @@ -82,7 +82,7 @@ static int cpu_hotplug_set_online_state(char *res_name, int cpu, int on) return 0; } -static struct pass_resource_hotplug_ops cpu_hotplus_ops = { +static struct hal_power_resource_hotplug_ops cpu_hotplus_ops = { .get_online_state = cpu_hotplug_get_online_state, .set_online_state = cpu_hotplug_set_online_state, .get_online_min_num = NULL, @@ -91,12 +91,12 @@ static struct pass_resource_hotplug_ops cpu_hotplus_ops = { .set_online_max_num = NULL, }; -static struct pass_resource_tmu_ops tmu_ops = { +static struct hal_power_resource_tmu_ops tmu_ops = { .get_temp = get_value, .get_policy = get_string_value, }; -static struct pass_resource_dvfs_ops devfreq_dvfs_ops = { +static struct hal_power_resource_dvfs_ops devfreq_dvfs_ops = { .get_curr_governor = get_string_value, .set_curr_governor = set_string_value, .get_curr_freq = get_value, diff --git a/tests/unittest/test-hal-api-power.cc b/tests/unittest/test-hal-api-power.cc index b38b6a5..e1efc90 100644 --- a/tests/unittest/test-hal-api-power.cc +++ b/tests/unittest/test-hal-api-power.cc @@ -54,29 +54,29 @@ static int __init_backend(void **data, void *user_data) if (!power_funcs) return -ENOMEM; - power_funcs->cpu = (struct pass_resource_cpu *)calloc(1, - sizeof(struct pass_resource_cpu)); + power_funcs->cpu = (struct hal_power_resource_cpu *)calloc(1, + sizeof(struct hal_power_resource_cpu)); if (!power_funcs->cpu) { ret = -ENOMEM; goto err_cpu; } - power_funcs->bus = (struct pass_resource_bus *)calloc(1, - sizeof(struct pass_resource_bus)); + power_funcs->bus = (struct hal_power_resource_bus *)calloc(1, + sizeof(struct hal_power_resource_bus)); if (!power_funcs->bus) { ret = -ENOMEM; goto err_bus; } - power_funcs->gpu = (struct pass_resource_gpu *)calloc(1, - sizeof(struct pass_resource_gpu)); + power_funcs->gpu = (struct hal_power_resource_gpu *)calloc(1, + sizeof(struct hal_power_resource_gpu)); if (!power_funcs->gpu) { ret = -ENOMEM; goto err_gpu; } - power_funcs->memory = (struct pass_resource_memory *)calloc(1, - sizeof(struct pass_resource_memory)); + power_funcs->memory = (struct hal_power_resource_memory *)calloc(1, + sizeof(struct hal_power_resource_memory)); if (!power_funcs->memory) { ret = -ENOMEM; goto err_memory; @@ -145,10 +145,10 @@ int hal_common_put_backend_v2(enum hal_module module, } static int resources[] = { - PASS_RESOURCE_CPU_ID, - PASS_RESOURCE_BUS_ID, - PASS_RESOURCE_GPU_ID, - PASS_RESOURCE_MEMORY_ID, + HAL_POWER_RESOURCE_CPU_ID, + HAL_POWER_RESOURCE_BUS_ID, + HAL_POWER_RESOURCE_GPU_ID, + HAL_POWER_RESOURCE_MEMORY_ID, }; static int test_begin(void) @@ -178,7 +178,7 @@ static int test_end(void) } TEST(HalApiPowerTest, hal_power_get_backend_with_cpu_id) { - int ret = hal_power_get_backend(PASS_RESOURCE_CPU_ID); + int ret = hal_power_get_backend(HAL_POWER_RESOURCE_CPU_ID); EXPECT_TRUE(ret == 0); ret = hal_power_put_backend(); @@ -186,7 +186,7 @@ TEST(HalApiPowerTest, hal_power_get_backend_with_cpu_id) { } TEST(HalApiPowerTest, hal_power_get_backend_with_bus_id) { - int ret = hal_power_get_backend(PASS_RESOURCE_BUS_ID); + int ret = hal_power_get_backend(HAL_POWER_RESOURCE_BUS_ID); EXPECT_TRUE(ret == 0); ret = hal_power_put_backend(); @@ -194,7 +194,7 @@ TEST(HalApiPowerTest, hal_power_get_backend_with_bus_id) { } TEST(HalApiPowerTest, hal_power_get_backend_with_gpu_id) { - int ret = hal_power_get_backend(PASS_RESOURCE_GPU_ID); + int ret = hal_power_get_backend(HAL_POWER_RESOURCE_GPU_ID); EXPECT_TRUE(ret == 0); ret = hal_power_put_backend(); @@ -202,7 +202,7 @@ TEST(HalApiPowerTest, hal_power_get_backend_with_gpu_id) { } TEST(HalApiPowerTest, hal_power_get_backend_with_memory_id) { - int ret = hal_power_get_backend(PASS_RESOURCE_MEMORY_ID); + int ret = hal_power_get_backend(HAL_POWER_RESOURCE_MEMORY_ID); EXPECT_TRUE(ret == 0); ret = hal_power_put_backend(); @@ -217,11 +217,11 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_curr_governor_valid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_CPU_ID, res_name, governor); + ret = hal_power_dvfs_get_curr_governor(HAL_POWER_RESOURCE_CPU_ID, res_name, governor); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_BUS_ID, res_name, governor); + ret = hal_power_dvfs_get_curr_governor(HAL_POWER_RESOURCE_BUS_ID, res_name, governor); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_GPU_ID, res_name, governor); + ret = hal_power_dvfs_get_curr_governor(HAL_POWER_RESOURCE_GPU_ID, res_name, governor); EXPECT_TRUE(ret == 0); ret = test_end(); @@ -236,20 +236,20 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_curr_governor_invalid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_CPU_ID, NULL, governor); + ret = hal_power_dvfs_get_curr_governor(HAL_POWER_RESOURCE_CPU_ID, NULL, governor); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_CPU_ID, res_name, NULL); + ret = hal_power_dvfs_get_curr_governor(HAL_POWER_RESOURCE_CPU_ID, res_name, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_BUS_ID, NULL, governor); + ret = hal_power_dvfs_get_curr_governor(HAL_POWER_RESOURCE_BUS_ID, NULL, governor); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_BUS_ID, res_name, NULL); + ret = hal_power_dvfs_get_curr_governor(HAL_POWER_RESOURCE_BUS_ID, res_name, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_GPU_ID, NULL, governor); + ret = hal_power_dvfs_get_curr_governor(HAL_POWER_RESOURCE_GPU_ID, NULL, governor); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_GPU_ID, res_name, NULL); + ret = hal_power_dvfs_get_curr_governor(HAL_POWER_RESOURCE_GPU_ID, res_name, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_curr_governor(PASS_RESOURCE_MEMORY_ID, res_name, governor); + ret = hal_power_dvfs_get_curr_governor(HAL_POWER_RESOURCE_MEMORY_ID, res_name, governor); EXPECT_TRUE(ret == -EPERM); ret = test_end(); @@ -263,11 +263,11 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_curr_freq_valid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_get_curr_freq(PASS_RESOURCE_CPU_ID, res_name); + ret = hal_power_dvfs_get_curr_freq(HAL_POWER_RESOURCE_CPU_ID, res_name); EXPECT_TRUE(ret > 0); - ret = hal_power_dvfs_get_curr_freq(PASS_RESOURCE_BUS_ID, res_name); + ret = hal_power_dvfs_get_curr_freq(HAL_POWER_RESOURCE_BUS_ID, res_name); EXPECT_TRUE(ret > 0); - ret = hal_power_dvfs_get_curr_freq(PASS_RESOURCE_GPU_ID, res_name); + ret = hal_power_dvfs_get_curr_freq(HAL_POWER_RESOURCE_GPU_ID, res_name); EXPECT_TRUE(ret > 0); ret = test_end(); @@ -281,18 +281,18 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_curr_freq_invalid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_get_curr_freq(PASS_RESOURCE_UNKNOWN, res_name); + ret = hal_power_dvfs_get_curr_freq(HAL_POWER_RESOURCE_UNKNOWN, res_name); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_get_curr_freq(PASS_RESOURCE_UNKNOWN, NULL); + ret = hal_power_dvfs_get_curr_freq(HAL_POWER_RESOURCE_UNKNOWN, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_curr_freq(PASS_RESOURCE_CPU_ID, NULL); + ret = hal_power_dvfs_get_curr_freq(HAL_POWER_RESOURCE_CPU_ID, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_curr_freq(PASS_RESOURCE_BUS_ID, NULL); + ret = hal_power_dvfs_get_curr_freq(HAL_POWER_RESOURCE_BUS_ID, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_curr_freq(PASS_RESOURCE_GPU_ID, NULL); + ret = hal_power_dvfs_get_curr_freq(HAL_POWER_RESOURCE_GPU_ID, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_curr_freq(PASS_RESOURCE_MEMORY_ID, res_name); + ret = hal_power_dvfs_get_curr_freq(HAL_POWER_RESOURCE_MEMORY_ID, res_name); EXPECT_TRUE(ret == -EPERM); ret = test_end(); @@ -306,11 +306,11 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_min_freq_valid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_get_min_freq(PASS_RESOURCE_CPU_ID, res_name); + ret = hal_power_dvfs_get_min_freq(HAL_POWER_RESOURCE_CPU_ID, res_name); EXPECT_TRUE(ret > 0); - ret = hal_power_dvfs_get_min_freq(PASS_RESOURCE_BUS_ID, res_name); + ret = hal_power_dvfs_get_min_freq(HAL_POWER_RESOURCE_BUS_ID, res_name); EXPECT_TRUE(ret > 0); - ret = hal_power_dvfs_get_min_freq(PASS_RESOURCE_GPU_ID, res_name); + ret = hal_power_dvfs_get_min_freq(HAL_POWER_RESOURCE_GPU_ID, res_name); EXPECT_TRUE(ret > 0); ret = test_end(); @@ -324,18 +324,18 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_min_freq_invalid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_get_min_freq(PASS_RESOURCE_UNKNOWN, res_name); + ret = hal_power_dvfs_get_min_freq(HAL_POWER_RESOURCE_UNKNOWN, res_name); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_get_min_freq(PASS_RESOURCE_UNKNOWN, NULL); + ret = hal_power_dvfs_get_min_freq(HAL_POWER_RESOURCE_UNKNOWN, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_min_freq(PASS_RESOURCE_CPU_ID, NULL); + ret = hal_power_dvfs_get_min_freq(HAL_POWER_RESOURCE_CPU_ID, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_min_freq(PASS_RESOURCE_BUS_ID, NULL); + ret = hal_power_dvfs_get_min_freq(HAL_POWER_RESOURCE_BUS_ID, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_min_freq(PASS_RESOURCE_GPU_ID, NULL); + ret = hal_power_dvfs_get_min_freq(HAL_POWER_RESOURCE_GPU_ID, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_min_freq(PASS_RESOURCE_MEMORY_ID, res_name); + ret = hal_power_dvfs_get_min_freq(HAL_POWER_RESOURCE_MEMORY_ID, res_name); EXPECT_TRUE(ret == -EPERM); ret = test_end(); @@ -349,11 +349,11 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_max_freq_valid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_get_max_freq(PASS_RESOURCE_CPU_ID, res_name); + ret = hal_power_dvfs_get_max_freq(HAL_POWER_RESOURCE_CPU_ID, res_name); EXPECT_TRUE(ret > 0); - ret = hal_power_dvfs_get_max_freq(PASS_RESOURCE_BUS_ID, res_name); + ret = hal_power_dvfs_get_max_freq(HAL_POWER_RESOURCE_BUS_ID, res_name); EXPECT_TRUE(ret > 0); - ret = hal_power_dvfs_get_max_freq(PASS_RESOURCE_GPU_ID, res_name); + ret = hal_power_dvfs_get_max_freq(HAL_POWER_RESOURCE_GPU_ID, res_name); EXPECT_TRUE(ret > 0); ret = test_end(); @@ -367,18 +367,18 @@ TEST(HalApiPowerTest, hal_power_dvfs_get_max_freq_invalid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_get_max_freq(PASS_RESOURCE_UNKNOWN, res_name); + ret = hal_power_dvfs_get_max_freq(HAL_POWER_RESOURCE_UNKNOWN, res_name); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_get_max_freq(PASS_RESOURCE_UNKNOWN, NULL); + ret = hal_power_dvfs_get_max_freq(HAL_POWER_RESOURCE_UNKNOWN, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_max_freq(PASS_RESOURCE_CPU_ID, NULL); + ret = hal_power_dvfs_get_max_freq(HAL_POWER_RESOURCE_CPU_ID, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_max_freq(PASS_RESOURCE_BUS_ID, NULL); + ret = hal_power_dvfs_get_max_freq(HAL_POWER_RESOURCE_BUS_ID, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_max_freq(PASS_RESOURCE_GPU_ID, NULL); + ret = hal_power_dvfs_get_max_freq(HAL_POWER_RESOURCE_GPU_ID, NULL); EXPECT_TRUE(ret == -EINVAL); - ret = hal_power_dvfs_get_max_freq(PASS_RESOURCE_MEMORY_ID, res_name); + ret = hal_power_dvfs_get_max_freq(HAL_POWER_RESOURCE_MEMORY_ID, res_name); EXPECT_TRUE(ret == -EPERM); ret = test_end(); @@ -392,11 +392,11 @@ TEST(HalApiPowerTest, hal_power_dvfs_set_min_freq_valid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_CPU_ID, res_name, DEFAULT_FREQ); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_CPU_ID, res_name, DEFAULT_FREQ); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_BUS_ID, res_name, DEFAULT_FREQ); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_BUS_ID, res_name, DEFAULT_FREQ); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_GPU_ID, res_name, DEFAULT_FREQ); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_GPU_ID, res_name, DEFAULT_FREQ); EXPECT_TRUE(ret == 0); ret = test_end(); @@ -410,26 +410,26 @@ TEST(HalApiPowerTest, hal_power_dvfs_set_min_freq_invalid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_UNKNOWN, res_name, DEFAULT_FREQ); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_UNKNOWN, res_name, DEFAULT_FREQ); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_UNKNOWN, res_name, -1); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_UNKNOWN, res_name, -1); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_UNKNOWN, NULL, 0); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_UNKNOWN, NULL, 0); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_CPU_ID, res_name, -1); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_CPU_ID, res_name, -1); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_CPU_ID, NULL, 0); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_CPU_ID, NULL, 0); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_BUS_ID, res_name, -1); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_BUS_ID, res_name, -1); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_BUS_ID, NULL, 0); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_BUS_ID, NULL, 0); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_GPU_ID, res_name, -1); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_GPU_ID, res_name, -1); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_GPU_ID, NULL, 0); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_GPU_ID, NULL, 0); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_min_freq(PASS_RESOURCE_MEMORY_ID, res_name, 0); + ret = hal_power_dvfs_set_min_freq(HAL_POWER_RESOURCE_MEMORY_ID, res_name, 0); EXPECT_TRUE(ret != 0); ret = test_end(); @@ -443,11 +443,11 @@ TEST(HalApiPowerTest, hal_power_dvfs_set_max_freq_valid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_CPU_ID, res_name, DEFAULT_FREQ); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_CPU_ID, res_name, DEFAULT_FREQ); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_BUS_ID, res_name, DEFAULT_FREQ); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_BUS_ID, res_name, DEFAULT_FREQ); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_GPU_ID, res_name, DEFAULT_FREQ); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_GPU_ID, res_name, DEFAULT_FREQ); EXPECT_TRUE(ret == 0); ret = test_end(); @@ -461,26 +461,26 @@ TEST(HalApiPowerTest, hal_power_dvfs_set_max_freq_invalid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_UNKNOWN, res_name, DEFAULT_FREQ); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_UNKNOWN, res_name, DEFAULT_FREQ); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_UNKNOWN, res_name, -1); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_UNKNOWN, res_name, -1); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_UNKNOWN, NULL, 0); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_UNKNOWN, NULL, 0); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_CPU_ID, res_name, -1); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_CPU_ID, res_name, -1); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_CPU_ID, NULL, 0); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_CPU_ID, NULL, 0); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_BUS_ID, res_name, -1); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_BUS_ID, res_name, -1); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_BUS_ID, NULL, 0); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_BUS_ID, NULL, 0); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_GPU_ID, res_name, -1); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_GPU_ID, res_name, -1); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_GPU_ID, NULL, 0); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_GPU_ID, NULL, 0); EXPECT_TRUE(ret != 0); - ret = hal_power_dvfs_set_max_freq(PASS_RESOURCE_MEMORY_ID, res_name, 0); + ret = hal_power_dvfs_set_max_freq(HAL_POWER_RESOURCE_MEMORY_ID, res_name, 0); EXPECT_TRUE(ret != 0); ret = test_end(); @@ -494,7 +494,7 @@ TEST(HalApiPowerTest, hal_power_memory_set_fault_around_bytes_valid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_memory_set_fault_around_bytes(PASS_RESOURCE_MEMORY_ID, res_name, DEFAULT_FAULT_AROUND_BYTES); + ret = hal_power_memory_set_fault_around_bytes(HAL_POWER_RESOURCE_MEMORY_ID, res_name, DEFAULT_FAULT_AROUND_BYTES); EXPECT_TRUE(ret == 0); ret = test_end(); @@ -508,10 +508,10 @@ TEST(HalApiPowerTest, hal_power_memory_set_fault_around_bytes_invalid) { ret = test_begin(); EXPECT_TRUE(ret == 0); - ret = hal_power_memory_set_fault_around_bytes(PASS_RESOURCE_MEMORY_ID, res_name, 0); + ret = hal_power_memory_set_fault_around_bytes(HAL_POWER_RESOURCE_MEMORY_ID, res_name, 0); EXPECT_TRUE(ret != 0); - ret = hal_power_memory_set_fault_around_bytes(PASS_RESOURCE_MEMORY_ID, res_name, 6000); + ret = hal_power_memory_set_fault_around_bytes(HAL_POWER_RESOURCE_MEMORY_ID, res_name, 6000); EXPECT_TRUE(ret != 0); ret = test_end();