pass: hal: Rename HAL API for the readability 20/224720/7
authorChanwoo Choi <cw00.choi@samsung.com>
Wed, 12 Feb 2020 09:05:47 +0000 (18:05 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 26 Feb 2020 10:22:19 +0000 (19:22 +0900)
Rename all HAL API from "pass_*()" to "pass_hal_*()" to improve the
readability. Usually, PASS modules used their own prefix on function name
like 'pass_resmon_*', 'pass_rescon_*'. After that, anyone can know
the kind of PASS module of functions.

Change-Id: I275fc6154eeab2af1d0e6755c3e6ceae762548b6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/pass/pass-hal.c
src/pass/pass-hal.h
src/pass/pass-rescon.c
src/pass/pass-resmon-source.c
src/pass/pass.c
unittest/pass_haltests.cpp

index 05909ecb228dd7fb1d1ab4bafc99ce0c55e437b0..0ba680fd2ff2c3ffd15e8343eaae48dd69f62a9e 100644 (file)
@@ -106,7 +106,7 @@ static struct pass_resource_hotplug_ops *get_hotplug(struct pass_resource *res,
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_curr_governor(struct pass_resource *res, char *governor)
+int pass_hal_get_curr_governor(struct pass_resource *res, char *governor)
 {
        struct pass_resource_dvfs_ops *dvfs;
 
@@ -133,7 +133,7 @@ int pass_get_curr_governor(struct pass_resource *res, char *governor)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_set_curr_governor(struct pass_resource *res, char *governor)
+int pass_hal_set_curr_governor(struct pass_resource *res, char *governor)
 {
        struct pass_resource_dvfs_ops *dvfs;
 
@@ -159,7 +159,7 @@ int pass_set_curr_governor(struct pass_resource *res, char *governor)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_curr_freq(struct pass_resource *res)
+int pass_hal_get_curr_freq(struct pass_resource *res)
 {
        struct pass_resource_dvfs_ops *dvfs;
 
@@ -185,7 +185,7 @@ int pass_get_curr_freq(struct pass_resource *res)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_min_freq(struct pass_resource *res)
+int pass_hal_get_min_freq(struct pass_resource *res)
 {
        struct pass_resource_dvfs_ops *dvfs;
 
@@ -212,7 +212,7 @@ int pass_get_min_freq(struct pass_resource *res)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_set_min_freq(struct pass_resource *res, int freq)
+int pass_hal_set_min_freq(struct pass_resource *res, int freq)
 {
        struct pass_resource_dvfs_ops *dvfs;
 
@@ -238,7 +238,7 @@ int pass_set_min_freq(struct pass_resource *res, int freq)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_max_freq(struct pass_resource *res)
+int pass_hal_get_max_freq(struct pass_resource *res)
 {
        struct pass_resource_dvfs_ops *dvfs;
 
@@ -265,7 +265,7 @@ int pass_get_max_freq(struct pass_resource *res)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_set_max_freq(struct pass_resource *res, int freq)
+int pass_hal_set_max_freq(struct pass_resource *res, int freq)
 {
        struct pass_resource_dvfs_ops *dvfs;
 
@@ -291,7 +291,7 @@ int pass_set_max_freq(struct pass_resource *res, int freq)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_available_min_freq(struct pass_resource *res)
+int pass_hal_get_available_min_freq(struct pass_resource *res)
 {
        struct pass_resource_dvfs_ops *dvfs;
 
@@ -317,7 +317,7 @@ int pass_get_available_min_freq(struct pass_resource *res)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_available_max_freq(struct pass_resource *res)
+int pass_hal_get_available_max_freq(struct pass_resource *res)
 {
        struct pass_resource_dvfs_ops *dvfs;
 
@@ -343,7 +343,7 @@ int pass_get_available_max_freq(struct pass_resource *res)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_up_threshold(struct pass_resource *res)
+int pass_hal_get_up_threshold(struct pass_resource *res)
 {
        struct pass_resource_dvfs_ops *dvfs;
 
@@ -370,7 +370,7 @@ int pass_get_up_threshold(struct pass_resource *res)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_set_up_threshold(struct pass_resource *res, int up_threshold)
+int pass_hal_set_up_threshold(struct pass_resource *res, int up_threshold)
 {
        struct pass_resource_dvfs_ops *dvfs;
 
@@ -396,7 +396,7 @@ int pass_set_up_threshold(struct pass_resource *res, int up_threshold)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_online_state(struct pass_resource *res, int cpu)
+int pass_hal_get_online_state(struct pass_resource *res, int cpu)
 {
        struct pass_resource_hotplug_ops *hotplug;
 
@@ -423,7 +423,7 @@ int pass_get_online_state(struct pass_resource *res, int cpu)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_set_online_state(struct pass_resource *res, int cpu, int on)
+int pass_hal_set_online_state(struct pass_resource *res, int cpu, int on)
 {
        struct pass_resource_hotplug_ops *hotplug;
 
@@ -448,7 +448,7 @@ int pass_set_online_state(struct pass_resource *res, int cpu, int on)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_online_min_num(struct pass_resource *res)
+int pass_hal_get_online_min_num(struct pass_resource *res)
 {
        struct pass_resource_hotplug_ops *hotplug;
 
@@ -474,7 +474,7 @@ int pass_get_online_min_num(struct pass_resource *res)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_set_online_min_num(struct pass_resource *res, int num)
+int pass_hal_set_online_min_num(struct pass_resource *res, int num)
 {
        struct pass_resource_hotplug_ops *hotplug;
 
@@ -499,7 +499,7 @@ int pass_set_online_min_num(struct pass_resource *res, int num)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_online_max_num(struct pass_resource *res)
+int pass_hal_get_online_max_num(struct pass_resource *res)
 {
        struct pass_resource_hotplug_ops *hotplug;
 
@@ -525,7 +525,7 @@ int pass_get_online_max_num(struct pass_resource *res)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_set_online_max_num(struct pass_resource *res, int num)
+int pass_hal_set_online_max_num(struct pass_resource *res, int num)
 {
        struct pass_resource_hotplug_ops *hotplug;
 
@@ -550,7 +550,7 @@ int pass_set_online_max_num(struct pass_resource *res, int num)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_temp(struct pass_resource *res)
+int pass_hal_get_temp(struct pass_resource *res)
 {
        struct pass_resource_tmu_ops *tmu;
 
@@ -580,7 +580,7 @@ int pass_get_temp(struct pass_resource *res)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_tmu_policy(struct pass_resource *res, char *policy)
+int pass_hal_get_tmu_policy(struct pass_resource *res, char *policy)
 {
        struct pass_resource_tmu_ops *tmu;
 
@@ -611,7 +611,7 @@ int pass_get_tmu_policy(struct pass_resource *res, char *policy)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_set_fault_around_bytes(struct pass_resource *res,
+int pass_hal_set_fault_around_bytes(struct pass_resource *res,
                                int fault_around_bytes)
 {
        struct pass_resource_memory *memory;
@@ -641,7 +641,7 @@ int pass_set_fault_around_bytes(struct pass_resource *res,
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_get_fault_around_bytes(struct pass_resource *res)
+int pass_hal_get_fault_around_bytes(struct pass_resource *res)
 {
        struct pass_resource_memory *memory;
 
@@ -670,7 +670,7 @@ int pass_get_fault_around_bytes(struct pass_resource *res)
  * @retval     -1 Operation not permitted (-EPERM)
  * @retval     -19 Operation not supported (-ENODEV)
  */
-int pass_set_pmqos_data(struct pass_resource *res, void *data)
+int pass_hal_set_pmqos_data(struct pass_resource *res, void *data)
 {
        struct pass_resource_nonstandard *nonstandard = NULL;
 
@@ -698,16 +698,16 @@ int pass_set_pmqos_data(struct pass_resource *res, void *data)
  * @param      [in] res Instance of h/w resource
  * @return     @c 0 on success, otherwise error value
  */
-static int pass_save_dvfs_initdata(struct pass_resource *res)
+static int pass_hal_save_dvfs_initdata(struct pass_resource *res)
 {
        struct pass_resource_init_data *initdata = &res->init_data;
        int ret;
 
-       ret = pass_get_curr_governor(res, initdata->dvfs.governor);
+       ret = pass_hal_get_curr_governor(res, initdata->dvfs.governor);
        if (ret < 0)
                initdata->dvfs.governor = NULL;
 
-       initdata->dvfs.min_freq = pass_get_min_freq(res);
+       initdata->dvfs.min_freq = pass_hal_get_min_freq(res);
 
        /*
         * Since the current maximum frequency can be affected by other
@@ -716,9 +716,9 @@ static int pass_save_dvfs_initdata(struct pass_resource *res)
         * in order to restore default maximum frequency we save available
         * maximum frequency instead of current maximum frequency.
         */
-       initdata->dvfs.max_freq = pass_get_available_max_freq(res);
+       initdata->dvfs.max_freq = pass_hal_get_available_max_freq(res);
 
-       initdata->dvfs.up_threshold = pass_get_up_threshold(res);
+       initdata->dvfs.up_threshold = pass_hal_get_up_threshold(res);
 
        return 0;
 }
@@ -729,7 +729,7 @@ static int pass_save_dvfs_initdata(struct pass_resource *res)
  * @param      [in] res Instance of h/w resource
  * @return     @c 0 on success, otherwise error value
  */
-static int pass_save_hotplug_initdata(struct pass_resource *res)
+static int pass_hal_save_hotplug_initdata(struct pass_resource *res)
 {
        struct pass_resource_init_data *initdata = &res->init_data;
        struct pass_resource_config_data *config_data = &res->config_data;
@@ -739,15 +739,15 @@ static int pass_save_hotplug_initdata(struct pass_resource *res)
        int i;
        int ret;
 
-       initdata->hotplug.online_min_num = pass_get_online_min_num(res);
-       initdata->hotplug.online_max_num = pass_get_online_max_num(res);
+       initdata->hotplug.online_min_num = pass_hal_get_online_min_num(res);
+       initdata->hotplug.online_max_num = pass_hal_get_online_max_num(res);
 
        online_state = (int *)calloc(num_cpus, sizeof(int));
        if (!online_state)
                return -ENOMEM;
 
        for (i = 0; i < num_cpus; i++) {
-               ret = pass_get_online_state(res, first_cpu + i);
+               ret = pass_hal_get_online_state(res, first_cpu + i);
                if (ret < 0) {
                        free(online_state);
                        return 0;
@@ -765,11 +765,12 @@ static int pass_save_hotplug_initdata(struct pass_resource *res)
  * @param      [in] res Instance of h/w resource
  * @return     @c 0 on success, otherwise error value
  */
-static int pass_save_memory_initdata(struct pass_resource *res)
+static int pass_hal_save_memory_initdata(struct pass_resource *res)
 {
        struct pass_resource_init_data *initdata = &res->init_data;
 
-       initdata->memory.fault_around_bytes = pass_get_fault_around_bytes(res);
+       initdata->memory.fault_around_bytes
+                       = pass_hal_get_fault_around_bytes(res);
 
        return 0;
 }
@@ -781,31 +782,31 @@ static int pass_save_memory_initdata(struct pass_resource *res)
  * @param      [in] res Instance of h/w resource
  * @return     @c 0 on success, otherwise error value
  */
-static int pass_restore_dvfs_initdata(struct pass_resource *res)
+static int pass_hal_restore_dvfs_initdata(struct pass_resource *res)
 {
        struct pass_resource_init_data *initdata = &res->init_data;
        int ret;
 
        if (initdata->dvfs.governor) {
-               ret = pass_set_curr_governor(res, initdata->dvfs.governor);
+               ret = pass_hal_set_curr_governor(res, initdata->dvfs.governor);
                if (ret < 0)
                        return ret;
        }
 
        if (initdata->dvfs.min_freq >= 0) {
-               ret = pass_set_min_freq(res, initdata->dvfs.min_freq);
+               ret = pass_hal_set_min_freq(res, initdata->dvfs.min_freq);
                if (ret < 0)
                        return ret;
        }
 
        if (initdata->dvfs.max_freq >= 0) {
-               ret = pass_set_max_freq(res, initdata->dvfs.max_freq);
+               ret = pass_hal_set_max_freq(res, initdata->dvfs.max_freq);
                if (ret < 0)
                        return ret;
        }
 
        if (initdata->dvfs.up_threshold >= 0) {
-               ret = pass_set_up_threshold(res, initdata->dvfs.up_threshold);
+               ret = pass_hal_set_up_threshold(res, initdata->dvfs.up_threshold);
                if (ret < 0)
                        return ret;
        }
@@ -819,7 +820,7 @@ static int pass_restore_dvfs_initdata(struct pass_resource *res)
  * @param      [in] res Instance of h/w resource
  * @return     @c 0 on success, otherwise error value
  */
-static int pass_restore_hotplug_initdata(struct pass_resource *res)
+static int pass_hal_restore_hotplug_initdata(struct pass_resource *res)
 {
        struct pass_resource_init_data *initdata = &res->init_data;
        struct pass_resource_config_data *config_data = &res->config_data;
@@ -833,7 +834,7 @@ static int pass_restore_hotplug_initdata(struct pass_resource *res)
 
        if (online_state) {
                for (i = 0; i < num_cpus; i++) {
-                       ret = pass_set_online_state(res, first_cpu + i,
+                       ret = pass_hal_set_online_state(res, first_cpu + i,
                                                        online_state[i]);
                        if (ret < 0) {
                                free(online_state);
@@ -844,13 +845,13 @@ static int pass_restore_hotplug_initdata(struct pass_resource *res)
        }
 
        if (online_min_num >= 0) {
-               ret = pass_set_online_min_num(res, online_min_num);
+               ret = pass_hal_set_online_min_num(res, online_min_num);
                if (ret < 0)
                        return ret;
        }
 
        if (online_max_num >= 0) {
-               ret = pass_set_online_max_num(res, online_max_num);
+               ret = pass_hal_set_online_max_num(res, online_max_num);
                if (ret < 0)
                        return ret;
        }
@@ -864,14 +865,14 @@ static int pass_restore_hotplug_initdata(struct pass_resource *res)
  * @param      [in] res Instance of h/w resource
  * @return     @c 0 on success, otherwise error value
  */
-static int pass_restore_memory_initdata(struct pass_resource *res)
+static int pass_hal_restore_memory_initdata(struct pass_resource *res)
 {
        struct pass_resource_init_data *initdata = &res->init_data;
        int fault_around_bytes = initdata->memory.fault_around_bytes;
        int ret;
 
        if (fault_around_bytes >= 0) {
-               ret = pass_set_fault_around_bytes(res, fault_around_bytes);
+               ret = pass_hal_set_fault_around_bytes(res, fault_around_bytes);
                if (ret < 0)
                        return ret;
        }
@@ -885,7 +886,7 @@ static int pass_restore_memory_initdata(struct pass_resource *res)
  * @param      [in] res Instance of h/w resource
  * @return     @c 0 on success, otherwise error value
  */
-int pass_save_initdata(struct pass_resource *res)
+int pass_hal_save_initdata(struct pass_resource *res)
 {
        int ret;
 
@@ -894,7 +895,7 @@ int pass_save_initdata(struct pass_resource *res)
 
        switch (res->config_data.res_type) {
        case PASS_RESOURCE_CPU_ID:
-               ret = pass_save_hotplug_initdata(res);
+               ret = pass_hal_save_hotplug_initdata(res);
                if (ret < 0) {
                        _E("Failed to save hp initdata for '%s' resource",
                                                        res->config_data.res_name);
@@ -903,7 +904,7 @@ int pass_save_initdata(struct pass_resource *res)
                /* fall through */
        case PASS_RESOURCE_BUS_ID:
        case PASS_RESOURCE_GPU_ID:
-               ret = pass_save_dvfs_initdata(res);
+               ret = pass_hal_save_dvfs_initdata(res);
                if (ret < 0) {
                        _E("Failed to save dvfs initdata for '%s' resource",
                                                        res->config_data.res_name);
@@ -911,7 +912,7 @@ int pass_save_initdata(struct pass_resource *res)
                }
                break;
        case PASS_RESOURCE_MEMORY_ID:
-               ret = pass_save_memory_initdata(res);
+               ret = pass_hal_save_memory_initdata(res);
                if (ret < 0) {
                        _E("Failed to save memory initdata for '%s' resource",
                                                        res->config_data.res_name);
@@ -935,7 +936,7 @@ int pass_save_initdata(struct pass_resource *res)
  * @param      [in] res Instance of h/w resource
  * @return     @c 0 on success, otherwise error value
  */
-int pass_restore_initdata(struct pass_resource *res)
+int pass_hal_restore_initdata(struct pass_resource *res)
 {
        int ret;
 
@@ -944,7 +945,7 @@ int pass_restore_initdata(struct pass_resource *res)
 
        switch (res->config_data.res_type) {
        case PASS_RESOURCE_CPU_ID:
-               ret = pass_restore_hotplug_initdata(res);
+               ret = pass_hal_restore_hotplug_initdata(res);
                if (ret < 0) {
                        _E("Failed to restore hp initdata for '%s' resource",
                                                        res->config_data.res_name);
@@ -953,7 +954,7 @@ int pass_restore_initdata(struct pass_resource *res)
                /* fall through */
        case PASS_RESOURCE_BUS_ID:
        case PASS_RESOURCE_GPU_ID:
-               ret = pass_restore_dvfs_initdata(res);
+               ret = pass_hal_restore_dvfs_initdata(res);
                if (ret < 0) {
                        _E("Failed to restore dvfs initdata for '%s' resource",
                                                        res->config_data.res_name);
@@ -961,7 +962,7 @@ int pass_restore_initdata(struct pass_resource *res)
                }
                break;
        case PASS_RESOURCE_MEMORY_ID:
-               ret = pass_restore_memory_initdata(res);
+               ret = pass_hal_restore_memory_initdata(res);
                if (ret < 0) {
                        _E("Failed to restore memory data for '%s' resource",
                                                        res->config_data.res_name);
@@ -987,7 +988,7 @@ int pass_restore_initdata(struct pass_resource *res)
  * @param      [in] res Instance of h/w resource
  * @return     @c 0 on success, otherwise error value
  */
-int pass_get_resource(struct pass_resource *res)
+int pass_hal_get_resource(struct pass_resource *res)
 {
        struct pass_resource_info *info;
        const char *name;
@@ -1070,7 +1071,7 @@ int pass_get_resource(struct pass_resource *res)
  * @param      [in] res Instance of h/w resource
  * @return     @c 0 on success, otherwise error value
  */
-int pass_put_resource(struct pass_resource *res)
+int pass_hal_put_resource(struct pass_resource *res)
 {
        struct pass_resource_common *common;
        struct pass_resource_info *info;
index 3ff1b6e9bfac67c99bac269cc041b92b6442ea67..63296025281c4a7fe20aaa5f44a11b4120fd470f 100644 (file)
  * Functions for all H/W resources
  */
 /* Get and put the h/w resource. */
-int pass_get_resource(struct pass_resource *res);
-int pass_put_resource(struct pass_resource *res);
+int pass_hal_get_resource(struct pass_resource *res);
+int pass_hal_put_resource(struct pass_resource *res);
 
 /* Save and restore the initial data of the h/w resource. */
-int pass_save_initdata(struct pass_resource *pass_res);
-int pass_restore_initdata(struct pass_resource *pass_res);
+int pass_hal_save_initdata(struct pass_resource *pass_res);
+int pass_hal_restore_initdata(struct pass_resource *pass_res);
 
 /***
  * Functions for CPU/BUS/GPU H/W resources
  */
 /* Get and the current governor. */
-int pass_get_curr_governor(struct pass_resource *res, char *governor);
-int pass_set_curr_governor(struct pass_resource *res, char *governor);
+int pass_hal_get_curr_governor(struct pass_resource *res, char *governor);
+int pass_hal_set_curr_governor(struct pass_resource *res, char *governor);
 
 /* Get the current frequency. */
-int pass_get_curr_freq(struct pass_resource *res);
+int pass_hal_get_curr_freq(struct pass_resource *res);
 
 /* Get and set the minimum frequency. */
-int pass_get_min_freq(struct pass_resource *res);
-int pass_set_min_freq(struct pass_resource *res, int freq);
+int pass_hal_get_min_freq(struct pass_resource *res);
+int pass_hal_set_min_freq(struct pass_resource *res, int freq);
 
 /* Get and set the maximum frequency. */
-int pass_get_max_freq(struct pass_resource *res);
-int pass_set_max_freq(struct pass_resource *res, int freq);
+int pass_hal_get_max_freq(struct pass_resource *res);
+int pass_hal_set_max_freq(struct pass_resource *res, int freq);
 
 /* Get the minimum/maximum frequency which can be set to resource. */
-int pass_get_available_min_freq(struct pass_resource *res);
-int pass_get_available_max_freq(struct pass_resource *res);
+int pass_hal_get_available_min_freq(struct pass_resource *res);
+int pass_hal_get_available_max_freq(struct pass_resource *res);
 
 /* Get and set the up_threshold to support boosting. */
-int pass_get_up_threshold(struct pass_resource *res);
-int pass_set_up_threshold(struct pass_resource *res, int up_threshold);
+int pass_hal_get_up_threshold(struct pass_resource *res);
+int pass_hal_set_up_threshold(struct pass_resource *res, int up_threshold);
 
 /* Get the temperature and policy of thermal unit on specific h/w. */
-int pass_get_temp(struct pass_resource *res);
-int pass_get_tmu_policy(struct pass_resource *res, char *policy);
+int pass_hal_get_temp(struct pass_resource *res);
+int pass_hal_get_tmu_policy(struct pass_resource *res, char *policy);
 
 /***
  * Functions for CPU H/W resources
  */
 /* Get and set online state of cpu. */
-int pass_get_online_state(struct pass_resource *res, int cpu);
-int pass_set_online_state(struct pass_resource *res, int cpu, int on);
+int pass_hal_get_online_state(struct pass_resource *res, int cpu);
+int pass_hal_set_online_state(struct pass_resource *res, int cpu, int on);
 /* Get and set the minimum number of online CPUs */
-int pass_get_online_min_num(struct pass_resource *res);
-int pass_set_online_min_num(struct pass_resource *res, int num);
+int pass_hal_get_online_min_num(struct pass_resource *res);
+int pass_hal_set_online_min_num(struct pass_resource *res, int num);
 /* Get and set the maximum number of online CPUs */
-int pass_get_online_max_num(struct pass_resource *res);
-int pass_set_online_max_num(struct pass_resource *res, int num);
+int pass_hal_get_online_max_num(struct pass_resource *res);
+int pass_hal_set_online_max_num(struct pass_resource *res, int num);
 
 /***
  * Functions for Memory h/w resource
  */
 /* Get and set the /sys/kernel/debug/fault_around_bytes */
-int pass_get_fault_around_bytes(struct pass_resource *res);
-int pass_set_fault_around_bytes(struct pass_resource *res,
+int pass_hal_get_fault_around_bytes(struct pass_resource *res);
+int pass_hal_set_fault_around_bytes(struct pass_resource *res,
                                int fault_around_bytes);
 
 /***
@@ -105,6 +105,6 @@ int pass_set_fault_around_bytes(struct pass_resource *res,
  *
  * This function will be removed after finding the proper method.
  */
-int pass_set_pmqos_data(struct pass_resource *res, void *data);
+int pass_hal_set_pmqos_data(struct pass_resource *res, void *data);
 
 #endif /* __PASS_HAL__ */
index 0ff6328337ef14dc1a9a682dee6624d0543477d2..4908916bed504d9bb4b54696165f51300847dbc5 100644 (file)
@@ -179,7 +179,7 @@ static int rescon_update(struct pass_resource *res)
                if (limit_min_cpu > limit_max_cpu)
                        limit_min_cpu = limit_max_cpu;
 
-               ret = pass_set_online_min_num(res, limit_min_cpu);
+               ret = pass_hal_set_online_min_num(res, limit_min_cpu);
                if (ret == -EPERM || ret == -ENODEV) {
                        /*
                         * If -EPERM, function is not supported according to
@@ -196,7 +196,7 @@ static int rescon_update(struct pass_resource *res)
                        failed = 1;
                }
 
-               ret = pass_set_online_max_num(res, limit_max_cpu);
+               ret = pass_hal_set_online_max_num(res, limit_max_cpu);
                if (ret == -EPERM || ret == -ENODEV) {
                        ;
                } else if (ret < 0) {
@@ -207,7 +207,7 @@ static int rescon_update(struct pass_resource *res)
                }
 
                for (i = 0; i < limit_max_cpu; i++) {
-                       ret = pass_set_online_state(res,
+                       ret = pass_hal_set_online_state(res,
                                                res->config_data.cpu + i,
                                                (i < limit_min_cpu) ? 1 : 0);
                        if (ret == -EPERM || ret == -ENODEV) {
@@ -225,18 +225,18 @@ static int rescon_update(struct pass_resource *res)
 
        /* Set minimum and maximum frequency */
        if (limit_max_freq > 0 && limit_min_freq > 0) {
-               int curr_min_freq = pass_get_min_freq(res);
-               int curr_max_freq = pass_get_max_freq(res);
+               int curr_min_freq = pass_hal_get_min_freq(res);
+               int curr_max_freq = pass_hal_get_max_freq(res);
                int ret_min;
                int ret_max;
 
                if ((limit_max_freq > curr_min_freq)
                                && (limit_min_freq > curr_max_freq)) {
-                       ret_max = pass_set_max_freq(res, limit_max_freq);
-                       ret_min = pass_set_min_freq(res, limit_min_freq);
+                       ret_max = pass_hal_set_max_freq(res, limit_max_freq);
+                       ret_min = pass_hal_set_min_freq(res, limit_min_freq);
                } else {
-                       ret_min = pass_set_min_freq(res, limit_min_freq);
-                       ret_max = pass_set_max_freq(res, limit_max_freq);
+                       ret_min = pass_hal_set_min_freq(res, limit_min_freq);
+                       ret_max = pass_hal_set_max_freq(res, limit_max_freq);
                }
 
                if (ret_max < 0) {
@@ -256,7 +256,7 @@ static int rescon_update(struct pass_resource *res)
 
        /* Set fault_around_bytes for the memory h/w */
        if (fault_around_bytes > 0) {
-               ret = pass_set_fault_around_bytes(res, fault_around_bytes);
+               ret = pass_hal_set_fault_around_bytes(res, fault_around_bytes);
                if (ret < 0) {
                        _W("failed to set the fault_around_bytes(%d) of %s",
                                                fault_around_bytes,
@@ -460,7 +460,7 @@ int pass_rescon_set_scenario_level_sync_with_data(struct pass_resource *res,
         * be removed after finding the proper method.
         */
        if (data)
-               pass_set_pmqos_data(res, data);
+               pass_hal_set_pmqos_data(res, data);
 
        rescon_set_scenario_level(res, scenario_level);
 
@@ -484,7 +484,7 @@ int pass_rescon_unset_scenario_level_sync_with_data(struct pass_resource *res,
         * be removed after finding the proper method.
         */
        if (data)
-               pass_set_pmqos_data(res, data);
+               pass_hal_set_pmqos_data(res, data);
 
        rescon_unset_scenario_level(res, scenario_level);
 
@@ -526,7 +526,7 @@ int pass_rescon_init(struct pass_resource *res)
         * Save the current data of h/w resource. The saved data
         * will be used for restoring the h/w resource on exit().
         */
-       ret = pass_save_initdata(res);
+       ret = pass_hal_save_initdata(res);
        if (ret < 0) {
                _E("failed to save initdata of '%s' resource (%d)\n",
                                res->config_data.res_name, ret);
@@ -582,7 +582,7 @@ int pass_rescon_exit(struct pass_resource *res)
        rescon = &res->rescon;
 
        /* Restore the h/w resource by using the saved data */
-       ret = pass_restore_initdata(res);
+       ret = pass_hal_restore_initdata(res);
        if (ret < 0)
                _E("failed to restore initdata of '%s' resource (%d)\n",
                                res->config_data.res_name, ret);
index 6ea9e7192378b75da785f7ed085d830108829a5b..0248fb894bf266514790637c45a17ebb877cfb79 100644 (file)
@@ -60,7 +60,7 @@ static int resmon_thermal_init(struct resmon *monitor)
         * resource monitor for thermal is ticked, get current temperature
         * in advance.
         */
-       result->temp = pass_get_temp(res);
+       result->temp = pass_hal_get_temp(res);
 
        monitor->result = result;
 
@@ -103,7 +103,7 @@ static int resmon_thermal_timer_handler(struct resmon *monitor, void *result)
                return -ENOMEM;
 
        /* Get temperature of h/w resource */
-       temp = pass_get_temp(res);
+       temp = pass_hal_get_temp(res);
        if (temp < 0)
                return temp;
 
@@ -133,7 +133,7 @@ static int resmon_thermal_uevent_handler(struct resmon *monitor, void *result,
                return -ENOMEM;
 
        /* Get temperature of h/w resource */
-       temp = pass_get_temp(res);
+       temp = pass_hal_get_temp(res);
        if (temp < 0)
                return temp;
 
index 8ce58761773a12c3604953425ff080630e349272..9038f25f1c7cbc1c6ae3f17f7c2a693d4da13936 100644 (file)
@@ -387,7 +387,7 @@ static int pass_init_done(void *data, void *user_data)
                struct pass_resource_config_data *config_data =
                                                &g_pass.res[i].config_data;
 
-               ret = pass_get_resource(res);
+               ret = pass_hal_get_resource(res);
                if (ret < 0) {
                        _E("Cannot get the pass '%s' resource (%d)\n",
                                        config_data->res_name, ret);
@@ -401,7 +401,7 @@ static int pass_init_done(void *data, void *user_data)
                        _E("Cannot initialize the pass '%s' resource (%d)\n",
                                        config_data->res_name, ret);
 
-                       ret = pass_put_resource(res);
+                       ret = pass_hal_put_resource(res);
                        if (ret < 0)
                                _E("Cannot put the pass '%s' resource (%d)\n",
                                        config_data->res_name, ret);
@@ -439,7 +439,7 @@ static void pass_exit_done(void)
                        _E("Cannot exit the pass '%s' resource (%d)\n",
                                        config_data->res_name, ret);
 
-               ret = pass_put_resource(res);
+               ret = pass_hal_put_resource(res);
                if (ret < 0) {
                        _E("Cannot put the pass '%s' resource (%d)\n",
                                        config_data->res_name, ret);
index 53dfa40941e5983defd087aba242c31db703afe3..4fbde96c2e7bdcd5a8d08332f8b6953605805675 100644 (file)
@@ -69,7 +69,7 @@ TEST_F(PowerMgntHalTest, GetResourceConfig_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_resource(res);
+               ret = pass_hal_get_resource(res);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetResourceConfig Failed";
                }
@@ -85,7 +85,7 @@ TEST_F(PowerMgntHalTest, GetCurrGovernor_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_curr_governor(res, governor);
+               ret = pass_hal_get_curr_governor(res, governor);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetCurrGovernor Failed";
                }
@@ -101,12 +101,12 @@ TEST_F(PowerMgntHalTest, SetCurrGovernor_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_curr_governor(res, governor);
+               ret = pass_hal_get_curr_governor(res, governor);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetCurrGovernor Failed";
                }
 
-               ret = pass_set_curr_governor(res, governor);
+               ret = pass_hal_set_curr_governor(res, governor);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "SetCurrGovernor Failed";
                }
@@ -121,7 +121,7 @@ TEST_F(PowerMgntHalTest, GetCurrFreq_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_curr_freq(res);
+               ret = pass_hal_get_curr_freq(res);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetCurrFreq Failed";
                }
@@ -136,7 +136,7 @@ TEST_F(PowerMgntHalTest, GetMinFreq_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_min_freq(res);
+               ret = pass_hal_get_min_freq(res);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetMinFreq Failed";
                }
@@ -152,13 +152,13 @@ TEST_F(PowerMgntHalTest, SetMinFreq_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               min_freq = pass_get_available_min_freq(res);
+               min_freq = pass_hal_get_available_min_freq(res);
                if (haltest_is_failed(res, min_freq)) {
                        ASSERT_EQ(min_freq, 0) << "GetAvailableMinFreq Failed";
                }
 
                if (min_freq >= 0) {
-                       ret = pass_set_min_freq(res, min_freq);
+                       ret = pass_hal_set_min_freq(res, min_freq);
                        if (haltest_is_failed(res, ret)) {
                                ASSERT_EQ(ret, 0) << "SetMinFreq Failed";
                        }
@@ -174,7 +174,7 @@ TEST_F(PowerMgntHalTest, GetMaxFreq_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_max_freq(res);
+               ret = pass_hal_get_max_freq(res);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetMaxFreq Failed";
                }
@@ -190,13 +190,13 @@ TEST_F(PowerMgntHalTest, SetMaxFreq_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               max_freq = pass_get_available_max_freq(res);
+               max_freq = pass_hal_get_available_max_freq(res);
                if (haltest_is_failed(res, max_freq)) {
                        ASSERT_EQ(max_freq, 0) << "GetAvailableMaxFreq Failed";
                }
 
                if (max_freq >= 0) {
-                       ret = pass_set_max_freq(res, max_freq);
+                       ret = pass_hal_set_max_freq(res, max_freq);
                        if (haltest_is_failed(res, ret)) {
                                ASSERT_EQ(ret, 0) << "SetMaxFreq Failed";
                        }
@@ -212,7 +212,7 @@ TEST_F(PowerMgntHalTest, GetAvailableMinFreq_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_available_min_freq(res);
+               ret = pass_hal_get_available_min_freq(res);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetAvailableMinFreq Failed";
                }
@@ -227,7 +227,7 @@ TEST_F(PowerMgntHalTest, GetAvailableMaxFreq_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_available_max_freq(res);
+               ret = pass_hal_get_available_max_freq(res);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetAvailableMaxFreq Failed";
                }
@@ -243,7 +243,7 @@ TEST_F(PowerMgntHalTest, GetUpThreshold_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_up_threshold(res);
+               ret = pass_hal_get_up_threshold(res);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetUpThreshold Failed";
                }
@@ -259,13 +259,13 @@ TEST_F(PowerMgntHalTest, SetUpThreshold_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               up_threshold = pass_get_up_threshold(res);
+               up_threshold = pass_hal_get_up_threshold(res);
                if (haltest_is_failed(res, up_threshold)) {
                        ASSERT_EQ(up_threshold, 0) << "GetUpThreshold Failed";
                }
 
                if (up_threshold >= 0) {
-                       ret = pass_set_up_threshold(res, up_threshold);
+                       ret = pass_hal_set_up_threshold(res, up_threshold);
                        if (haltest_is_failed(res, ret)) {
                                ASSERT_EQ(ret, 0) << "SetUpThreshold Failed";
                        }
@@ -281,7 +281,7 @@ TEST_F(PowerMgntHalTest, GetTemperature_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_temp(res);
+               ret = pass_hal_get_temp(res);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetTemperature Failed";
                }
@@ -297,7 +297,7 @@ TEST_F(PowerMgntHalTest, GetTmuPolicy_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_tmu_policy(res, policy);
+               ret = pass_hal_get_tmu_policy(res, policy);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetTmuPolicy Failed";
                }
@@ -313,7 +313,7 @@ TEST_F(PowerMgntHalTest, GetOnlineState_HandlesValidInput)
                struct pass_resource *res = &g_pass.res[i];
 
                for (j = 0; j < res->config_data.num_cpus; j++) {
-                       ret = pass_get_online_state(res, j);
+                       ret = pass_hal_get_online_state(res, j);
                        if (haltest_is_failed(res, ret)) {
                                ASSERT_EQ(ret, 0) << "GetOnlineState Failed";
                        }
@@ -335,13 +335,13 @@ TEST_F(PowerMgntHalTest, SetOnlineState_HandlesValidInput)
                struct pass_resource *res = &g_pass.res[i];
 
                for (j = 0; j < res->config_data.num_cpus; j++) {
-                       online_state = pass_get_online_state(res, j);
+                       online_state = pass_hal_get_online_state(res, j);
                        if (haltest_is_failed(res, online_state)) {
                                ASSERT_EQ(online_state, 0) << "GetOnlineState Failed";
                        }
 
                        if (online_state >= 0) {
-                               ret = pass_set_online_state(res, j, online_state);
+                               ret = pass_hal_set_online_state(res, j, online_state);
                                if (haltest_is_failed(res, ret)) {
                                        ASSERT_EQ(ret, 0) << "SetOnlineState Failed";
                                }
@@ -359,7 +359,7 @@ TEST_F(PowerMgntHalTest, GetOnlineMinNum_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_online_min_num(res);
+               ret = pass_hal_get_online_min_num(res);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetOnlineMinNum Failed";
                }
@@ -375,13 +375,13 @@ TEST_F(PowerMgntHalTest, SetOnlineMinNum_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               online_min_num = pass_get_online_min_num(res);
+               online_min_num = pass_hal_get_online_min_num(res);
                if (haltest_is_failed(res, online_min_num)) {
                        ASSERT_EQ(online_min_num, 0) << "GetOnlineMinNum Failed";
                }
 
                if (online_min_num >= 0) {
-                       ret = pass_set_online_min_num(res, online_min_num);
+                       ret = pass_hal_set_online_min_num(res, online_min_num);
                        if (haltest_is_failed(res, ret)) {
                                ASSERT_EQ(ret, 0) << "SetOnlineMinNum Failed";
                        }
@@ -397,7 +397,7 @@ TEST_F(PowerMgntHalTest, GetOnlineMaxNum_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_online_max_num(res);
+               ret = pass_hal_get_online_max_num(res);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetOnlineMaxNum Failed";
                }
@@ -413,13 +413,13 @@ TEST_F(PowerMgntHalTest, SetOnlineMaxNum_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               online_max_num = pass_get_online_max_num(res);
+               online_max_num = pass_hal_get_online_max_num(res);
                if (haltest_is_failed(res, online_max_num)) {
                        ASSERT_EQ(online_max_num, 0) << "GetOnlineMaxNum Failed";
                }
 
                if (online_max_num >= 0) {
-                       ret = pass_set_online_max_num(res, online_max_num);
+                       ret = pass_hal_set_online_max_num(res, online_max_num);
                        if (haltest_is_failed(res, ret)) {
                                ASSERT_EQ(ret, 0) << "SetOnlineMaxNum Failed";
                        }
@@ -435,7 +435,7 @@ TEST_F(PowerMgntHalTest, GetFaultAroundBytes_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_get_fault_around_bytes(res);
+               ret = pass_hal_get_fault_around_bytes(res);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "GetFaultAroundBytes Failed";
                }
@@ -451,13 +451,13 @@ TEST_F(PowerMgntHalTest, SetFaultAroundBytes_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               fault_around_bytes = pass_get_fault_around_bytes(res);
+               fault_around_bytes = pass_hal_get_fault_around_bytes(res);
                if (haltest_is_failed(res, fault_around_bytes)) {
                        ASSERT_EQ(fault_around_bytes, 0) << "GetFaultAroundBytes Failed";
                }
 
                if (fault_around_bytes >= 0) {
-                       ret = pass_set_fault_around_bytes(res, fault_around_bytes);
+                       ret = pass_hal_set_fault_around_bytes(res, fault_around_bytes);
                        if (haltest_is_failed(res, ret)) {
                                ASSERT_EQ(ret, 0) << "SetFaultAroundBytes Failed";
                        }
@@ -474,7 +474,7 @@ TEST_F(PowerMgntHalTest, SetPmqosData_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_set_pmqos_data(res, applaunch_scenario);
+               ret = pass_hal_set_pmqos_data(res, applaunch_scenario);
                if (haltest_is_failed(res, ret)) {
                        ASSERT_EQ(ret, 0) << "SetPmqosData Failed";
                }
@@ -489,7 +489,7 @@ TEST_F(PowerMgntHalTest, PutResourceConfig_HandlesValidInput)
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
 
-               ret = pass_put_resource(res);
+               ret = pass_hal_put_resource(res);
                if (ret < 0) {
                        pass_put_resource_config(&g_pass);
                        ASSERT_EQ(ret, 0) << "PutResourceConfig Failed";