/** * Initializes the thermal controller related functions in the Hardware Manager structure. * @param hwmgr The address of the hardware manager. * @exception Any error code from the low-level communication. */ int pp_iceland_thermal_initialize(struct pp_hwmgr *hwmgr) { int result; result = phm_construct_table(hwmgr, &iceland_thermal_set_temperature_range_master, &(hwmgr->set_temperature_range)); if (0 == result) { result = phm_construct_table(hwmgr, &iceland_thermal_start_thermal_controller_master, &(hwmgr->start_thermal_controller)); if (0 != result) phm_destroy_table(hwmgr, &(hwmgr->set_temperature_range)); } if (0 == result) hwmgr->fan_ctrl_is_in_default_mode = true; return result; }
static int rv_hwmgr_backend_init(struct pp_hwmgr *hwmgr) { int result = 0; struct rv_hwmgr *data; data = kzalloc(sizeof(struct rv_hwmgr), GFP_KERNEL); if (data == NULL) return -ENOMEM; hwmgr->backend = data; result = rv_initialize_dpm_defaults(hwmgr); if (result != 0) { pr_err("rv_initialize_dpm_defaults failed\n"); return result; } phm_cap_set(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_PowerPlaySupport); rv_populate_clock_table(hwmgr); result = rv_get_system_info_data(hwmgr); if (result != 0) { pr_err("rv_get_system_info_data failed\n"); return result; } rv_construct_boot_state(hwmgr); result = phm_construct_table(hwmgr, &rv_setup_asic_master, &(hwmgr->setup_asic)); if (result != 0) { pr_err("Fail to construct setup ASIC\n"); return result; } result = phm_construct_table(hwmgr, &rv_power_down_asic_master, &(hwmgr->power_down_asic)); if (result != 0) { pr_err("Fail to construct power down ASIC\n"); return result; } result = phm_construct_table(hwmgr, &rv_set_power_state_master, &(hwmgr->set_power_state)); if (result != 0) { pr_err("Fail to construct set_power_state\n"); return result; } result = phm_construct_table(hwmgr, &rv_disable_dpm_master, &(hwmgr->disable_dynamic_state_management)); if (result != 0) { pr_err("Fail to disable_dynamic_state\n"); return result; } result = phm_construct_table(hwmgr, &rv_enable_dpm_master, &(hwmgr->enable_dynamic_state_management)); if (result != 0) { pr_err("Fail to enable_dynamic_state\n"); return result; } hwmgr->platform_descriptor.hardwareActivityPerformanceLevels = RAVEN_MAX_HARDWARE_POWERLEVELS; hwmgr->platform_descriptor.hardwarePerformanceLevels = RAVEN_MAX_HARDWARE_POWERLEVELS; hwmgr->platform_descriptor.vbiosInterruptId = 0; hwmgr->platform_descriptor.clockStep.engineClock = 500; hwmgr->platform_descriptor.clockStep.memoryClock = 500; hwmgr->platform_descriptor.minimumClocksReductionPercentage = 50; rv_init_vq_budget_table(hwmgr); return result; }