static int rv_hwmgr_backend_fini(struct pp_hwmgr *hwmgr) { struct rv_hwmgr *rv_data = (struct rv_hwmgr *)(hwmgr->backend); struct rv_clock_voltage_information *pinfo = &(rv_data->clock_vol_info); phm_destroy_table(hwmgr, &(hwmgr->set_power_state)); phm_destroy_table(hwmgr, &(hwmgr->enable_dynamic_state_management)); phm_destroy_table(hwmgr, &(hwmgr->disable_dynamic_state_management)); phm_destroy_table(hwmgr, &(hwmgr->power_down_asic)); phm_destroy_table(hwmgr, &(hwmgr->setup_asic)); if (pinfo->vdd_dep_on_dcefclk) { kfree(pinfo->vdd_dep_on_dcefclk); pinfo->vdd_dep_on_dcefclk = NULL; } if (pinfo->vdd_dep_on_socclk) { kfree(pinfo->vdd_dep_on_socclk); pinfo->vdd_dep_on_socclk = NULL; } if (pinfo->vdd_dep_on_fclk) { kfree(pinfo->vdd_dep_on_fclk); pinfo->vdd_dep_on_fclk = NULL; } if (pinfo->vdd_dep_on_dispclk) { kfree(pinfo->vdd_dep_on_dispclk); pinfo->vdd_dep_on_dispclk = NULL; } if (pinfo->vdd_dep_on_dppclk) { kfree(pinfo->vdd_dep_on_dppclk); pinfo->vdd_dep_on_dppclk = NULL; } if (pinfo->vdd_dep_on_phyclk) { kfree(pinfo->vdd_dep_on_phyclk); pinfo->vdd_dep_on_phyclk = NULL; } if (NULL != hwmgr->dyn_state.vddc_dep_on_dal_pwrl) { kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl); hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL; } if (NULL != hwmgr->dyn_state.vq_budgeting_table) { kfree(hwmgr->dyn_state.vq_budgeting_table); hwmgr->dyn_state.vq_budgeting_table = NULL; } kfree(hwmgr->backend); hwmgr->backend = NULL; return 0; }
/** * 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; }