Replace prefix of macro name from 'PASS' to 'HAL_POWER'.
This is because the pass module refers to macros defined in hal-api-power,
and the prefix of macros has been chaned in the hal-api-power.
Change-Id: Ifaf7b9b7d25708c988d00cfaefe89419dc305c15
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
return -EINVAL;
switch (res->config_data.res_type) {
- case PASS_RESOURCE_CPU_ID:
+ case HAL_POWER_RESOURCE_CPU_ID:
ret = pass_hal_save_hotplug_initdata(res);
if (ret < 0) {
_E("Failed to save hp initdata for '%s' resource",
return ret;
}
/* fall through */
- case PASS_RESOURCE_BUS_ID:
- case PASS_RESOURCE_GPU_ID:
+ case HAL_POWER_RESOURCE_BUS_ID:
+ case HAL_POWER_RESOURCE_GPU_ID:
ret = pass_hal_save_dvfs_initdata(res);
if (ret < 0) {
_E("Failed to save dvfs initdata for '%s' resource",
return ret;
}
/* fall through */
- case PASS_RESOURCE_BATTERY_ID:
+ case HAL_POWER_RESOURCE_BATTERY_ID:
ret = pass_hal_save_battery_initdata(res);
if (ret < 0) {
_E("Failed to save battery initdata for '%s' resource",
return ret;
}
break;
- case PASS_RESOURCE_MEMORY_ID:
+ case HAL_POWER_RESOURCE_MEMORY_ID:
ret = pass_hal_save_memory_initdata(res);
if (ret < 0) {
_E("Failed to save memory initdata for '%s' resource",
return -EINVAL;
switch (res->config_data.res_type) {
- case PASS_RESOURCE_CPU_ID:
+ case HAL_POWER_RESOURCE_CPU_ID:
ret = pass_hal_restore_hotplug_initdata(res);
if (ret < 0) {
_E("Failed to restore hp initdata for '%s' resource",
return ret;
}
/* fall through */
- case PASS_RESOURCE_BUS_ID:
- case PASS_RESOURCE_GPU_ID:
+ case HAL_POWER_RESOURCE_BUS_ID:
+ case HAL_POWER_RESOURCE_GPU_ID:
ret = pass_hal_restore_dvfs_initdata(res);
if (ret < 0) {
_E("Failed to restore dvfs initdata for '%s' resource",
return ret;
}
/* fall through */
- case PASS_RESOURCE_BATTERY_ID:
+ case HAL_POWER_RESOURCE_BATTERY_ID:
ret = pass_hal_restore_battery_initdata(res);
if (ret < 0) {
_E("Failed to restore battery initdata for '%s' resource",
return ret;
}
break;
- case PASS_RESOURCE_MEMORY_ID:
+ case HAL_POWER_RESOURCE_MEMORY_ID:
ret = pass_hal_restore_memory_initdata(res);
if (ret < 0) {
_E("Failed to restore memory data for '%s' resource",
config_data->res_thermal_priority = INT_MAX;
switch (config_data->res_type) {
- case PASS_RESOURCE_CPU_ID:
+ case HAL_POWER_RESOURCE_CPU_ID:
if (config_data->num_cpus < 0 || config_data->cpu < 0) {
_E("Invalid 'number_of_cpus'(%d) or 'first_cpu'(%d) property\n",
config_data->num_cpus, config_data->cpu);
config_data->num_cpus = 0;
/* Initialize config_data from property values of confiugartion file */
- if (!strncmp(device_type, PASS_RESOURCE_CPU_NAME, strlen(device_type)))
- config_data->res_type = PASS_RESOURCE_CPU_ID;
- else if (!strncmp(device_type, PASS_RESOURCE_GPU_NAME, strlen(device_type)))
- config_data->res_type = PASS_RESOURCE_GPU_ID;
- else if (!strncmp(device_type, PASS_RESOURCE_BUS_NAME, strlen(device_type)))
- config_data->res_type = PASS_RESOURCE_BUS_ID;
- else if (!strncmp(device_type, PASS_RESOURCE_MEMORY_NAME, strlen(device_type)))
- config_data->res_type = PASS_RESOURCE_MEMORY_ID;
- else if (!strncmp(device_type, PASS_RESOURCE_BATTERY_NAME, strlen(device_type)))
- config_data->res_type = PASS_RESOURCE_BATTERY_ID;
- else if (!strncmp(device_type, PASS_RESOURCE_DISPLAY_NAME, strlen(device_type)))
- config_data->res_type = PASS_RESOURCE_DISPLAY_ID;
- else if (!strncmp(device_type, PASS_RESOURCE_DISK_NAME, strlen(device_type)))
- config_data->res_type = PASS_RESOURCE_DISK_ID;
- else if (!strncmp(device_type, PASS_RESOURCE_NETWORK_NAME, strlen(device_type)))
- config_data->res_type = PASS_RESOURCE_NETWORK_ID;
+ if (!strncmp(device_type, HAL_POWER_RESOURCE_CPU_NAME, strlen(device_type)))
+ config_data->res_type = HAL_POWER_RESOURCE_CPU_ID;
+ else if (!strncmp(device_type, HAL_POWER_RESOURCE_GPU_NAME, strlen(device_type)))
+ config_data->res_type = HAL_POWER_RESOURCE_GPU_ID;
+ else if (!strncmp(device_type, HAL_POWER_RESOURCE_BUS_NAME, strlen(device_type)))
+ config_data->res_type = HAL_POWER_RESOURCE_BUS_ID;
+ else if (!strncmp(device_type, HAL_POWER_RESOURCE_MEMORY_NAME, strlen(device_type)))
+ config_data->res_type = HAL_POWER_RESOURCE_MEMORY_ID;
+ else if (!strncmp(device_type, HAL_POWER_RESOURCE_BATTERY_NAME, strlen(device_type)))
+ config_data->res_type = HAL_POWER_RESOURCE_BATTERY_ID;
+ else if (!strncmp(device_type, HAL_POWER_RESOURCE_DISPLAY_NAME, strlen(device_type)))
+ config_data->res_type = HAL_POWER_RESOURCE_DISPLAY_ID;
+ else if (!strncmp(device_type, HAL_POWER_RESOURCE_DISK_NAME, strlen(device_type)))
+ config_data->res_type = HAL_POWER_RESOURCE_DISK_ID;
+ else if (!strncmp(device_type, HAL_POWER_RESOURCE_NETWORK_NAME, strlen(device_type)))
+ config_data->res_type = HAL_POWER_RESOURCE_NETWORK_ID;
else {
_E("Unknown 'device_type' property value (%s)\n", device_type);
return -EINVAL;
g_mutex_unlock(&rescon->scenario_level_mutex);
switch (res_type) {
- case PASS_RESOURCE_CPU_ID:
+ case HAL_POWER_RESOURCE_CPU_ID:
limit_min_cpu = adjusted_level.limit_min_cpu;
limit_max_cpu = adjusted_level.limit_max_cpu;
/* fall through */
- case PASS_RESOURCE_GPU_ID:
- case PASS_RESOURCE_BUS_ID:
+ case HAL_POWER_RESOURCE_GPU_ID:
+ case HAL_POWER_RESOURCE_BUS_ID:
limit_max_freq = adjusted_level.limit_max_freq;
limit_min_freq = adjusted_level.limit_min_freq;
/* fall through */
- case PASS_RESOURCE_BATTERY_ID:
+ case HAL_POWER_RESOURCE_BATTERY_ID:
cooling_device_state = adjusted_level.cooling_device_state;
charging_status = adjusted_level.charging_status;
charging_current_uA = adjusted_level.charging_current_uA;
break;
- case PASS_RESOURCE_MEMORY_ID:
+ case HAL_POWER_RESOURCE_MEMORY_ID:
fault_around_bytes = adjusted_level.fault_around_bytes;
break;
default:
enum pass_module_type type)
{
switch (res->config_data.res_type) {
- case PASS_RESOURCE_CPU_ID:
+ case HAL_POWER_RESOURCE_CPU_ID:
return !!(PASS_RESOURCE_CPU_SUPPORTED_MODULES & type);
- case PASS_RESOURCE_BUS_ID:
+ case HAL_POWER_RESOURCE_BUS_ID:
return !!(PASS_RESOURCE_BUS_SUPPORTED_MODULES & type);
- case PASS_RESOURCE_GPU_ID:
+ case HAL_POWER_RESOURCE_GPU_ID:
return !!(PASS_RESOURCE_GPU_SUPPORTED_MODULES & type);
- case PASS_RESOURCE_MEMORY_ID:
+ case HAL_POWER_RESOURCE_MEMORY_ID:
return !!(PASS_RESOURCE_MEMORY_SUPPORTED_MODULES & type);
- case PASS_RESOURCE_BATTERY_ID:
+ case HAL_POWER_RESOURCE_BATTERY_ID:
return !!(PASS_RESOURCE_BATTERY_SUPPORTED_MODULES & type);
default:
return false;
/**
* Limited maximum frequency
* and this property is used for following resources:
- * - PASS_RESOURCE_CPU_ID
- * - PASS_RESOURCE_BUS_ID
- * - PASS_RESOURCE_GPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_BUS_ID
+ * - HAL_POWER_RESOURCE_GPU_ID
*/
int limit_max_freq;
/**
* Limited minimum frequency
* and this property is used for following resources:
- * - PASS_RESOURCE_CPU_ID
- * - PASS_RESOURCE_BUS_ID
- * - PASS_RESOURCE_GPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_BUS_ID
+ * - HAL_POWER_RESOURCE_GPU_ID
*/
int limit_min_freq;
/**
* The maximum number of online CPU
* and this property is used for the following resources:
- * - PASS_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
*/
int limit_max_cpu;
/**
* The minimum number of online CPU
* and this property is used for the following resources:
- * - PASS_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
*/
int limit_min_cpu;
/**
* The number of bytes to be mapped around the fault
* and this property is used for the following resources:
- * - PASS_RESOURCE_MEMORY_ID
+ * - HAL_POWER_RESOURCE_MEMORY_ID
*/
int fault_around_bytes;
/**
* The current state of cooling device
* and this property is used for the following resources:
- * - PASS_RESOURCE_CPU_ID
- * - PASS_RESOURCE_BUS_ID
- * - PASS_RESOURCE_GPU_ID
- * - PASS_RESOURCE_BATTERY_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_BUS_ID
+ * - HAL_POWER_RESOURCE_GPU_ID
+ * - HAL_POWER_RESOURCE_BATTERY_ID
*/
int cooling_device_state;
/**
* The current state of battery charging device
* and this property is used for the following resources:
- * - PASS_RESOURCE_BATTERY_ID
+ * - HAL_POWER_RESOURCE_BATTERY_ID
*/
int charging_status;
int charging_current_uA;
/**
* Period of timer for each pass_level
* and this property is used for thefollowing resources:
- * - PASS_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
*/
int gov_timeout;
/**
* The up condition to change between pass_level
* and this property is used for the following resources:
- * - PASS_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
*/
struct pass_level_condition up_cond[PASS_LEVEL_COND_MAX];
/**
* The down condition to change between pass_level
* and this property is used for the following resources:
- * - PASS_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
*/
struct pass_level_condition down_cond[PASS_LEVEL_COND_MAX];
/**
* The left condition to change between pass_level
* and this property is used for the following resources:
- * - PASS_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
*/
struct pass_level_condition left_cond[PASS_LEVEL_COND_MAX];
/**
* The right condition to change between pass_level
* and this property is used for the following resources:
- * - PASS_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
*/
struct pass_level_condition right_cond[PASS_LEVEL_COND_MAX];
/**
* The number of up condition to change between pass_level
* and this property is used for the following resources:
- * - PASS_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
*/
int num_up_cond;
/**
* The number of down condition to change between pass_level
* and this property is used for the following resources:
- * - PASS_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
*/
int num_down_cond;
/**
* The number of left condition to change between pass_level
* and this property is used for the following resources:
- * - PASS_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
*/
int num_left_cond;
/**
* The number of right condition to change between pass_level
* and this property is used for the following resources:
- * - PASS_RESOURCE_CPU_ID
+ * - HAL_POWER_RESOURCE_CPU_ID
*/
int num_right_cond;
};
/**
* [mandatory] The unique id for each h/w resource. The id can have
* the one value among following defined resource id.
- * - 1: PASS_RESOURCE_CPU_ID
- * - 2: PASS_RESOURCE_BUS_ID
- * - 3: PASS_RESOURCE_GPU_ID
- * - 4: PASS_RESOURCE_MEMORY_ID
+ * - 1: HAL_POWER_RESOURCE_CPU_ID
+ * - 2: HAL_POWER_RESOURCE_BUS_ID
+ * - 3: HAL_POWER_RESOURCE_GPU_ID
+ * - 4: HAL_POWER_RESOURCE_MEMORY_ID
*/
unsigned int res_type;
/**
/**
* Path for load_table entry from kernel. If res_type is
- * PASS_RESOURCE_CPU_ID, it is mandatory.
+ * HAL_POWER_RESOURCE_CPU_ID, it is mandatory.
*/
char path_load_table[BUFF_MAX];
/**
* The number of supported CPU in the same cluster.
- * If res_type is PASS_RESOURCE_CPU_ID, it is mandatory.
+ * If res_type is HAL_POWER_RESOURCE_CPU_ID, it is mandatory.
*/
int num_cpus;
/**
* [optional] Index of first cpu in the same cluster.
- * If res_type is PASS_RESOURCE_CPU_ID, it is mandatory.
+ * If res_type is HAL_POWER_RESOURCE_CPU_ID, it is mandatory.
*/
int cpu;
/**
* The hal instance of each h/w resource from pass_get_hal_info().
- * - If res_type of cdata is PASS_RESOURCE_CPU_ID, hal.cpu will be used.
- * - If res_type of cdata is PASS_RESOURCE_BUS_ID, hal.bus will be used.
- * - If res_type of cdata is PASS_RESOURCE_GPU_ID, hal.gpu will be used.
- * - If res_type of cdata is PASS_RESOURCE_MEMORY_ID,
+ * - If res_type of cdata is HAL_POWER_RESOURCE_CPU_ID, hal.cpu will be used.
+ * - If res_type of cdata is HAL_POWER_RESOURCE_BUS_ID, hal.bus will be used.
+ * - If res_type of cdata is HAL_POWER_RESOURCE_GPU_ID, hal.gpu will be used.
+ * - If res_type of cdata is HAL_POWER_RESOURCE_MEMORY_ID,
* hal.memory will be used.
*/
union {
TEST(PassResconInitExitTest, pass_rescon_prepare_and_init_and_exit) {
struct pass_resource res;
- res.config_data.res_type = PASS_RESOURCE_CPU_ID;
+ res.config_data.res_type = HAL_POWER_RESOURCE_CPU_ID;
res.rescon = NULL;
int ret = pass_rescon_prepare(&res);
gPassHalMock = new PassHalMock();
g_resource = (struct pass_resource *)calloc(1, sizeof(struct pass_resource));
- g_resource->config_data.res_type = PASS_RESOURCE_CPU_ID;
+ g_resource->config_data.res_type = HAL_POWER_RESOURCE_CPU_ID;
EXPECT_CALL(*gPassHalMock, pass_hal_save_initdata(_)).WillRepeatedly(Return(0));
EXPECT_CALL(*gPassHalMock, pass_hal_restore_initdata(_)).WillRepeatedly(Return(0));
gPassHalMock = new PassHalMock();
g_resource = (struct pass_resource *)calloc(1, sizeof(struct pass_resource));
- g_resource->config_data.res_type = PASS_RESOURCE_CPU_ID;
+ g_resource->config_data.res_type = HAL_POWER_RESOURCE_CPU_ID;
EXPECT_CALL(*gPassHalMock, pass_hal_save_initdata(_)).WillRepeatedly(Return(0));
EXPECT_CALL(*gPassHalMock, pass_hal_restore_initdata(_)).WillRepeatedly(Return(0));