Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d200372 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher
Browse files

drm/amd/pp: Refine register_thermal_interrupt function



v2: add Vega12 support

1. delete useless argument in function register_thermal_interrupt
2. rename function name register_thermal_interrupt to register_irq_handlers

Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 160b8e75
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -202,12 +202,12 @@ int phm_stop_thermal_controller(struct pp_hwmgr *hwmgr)
	return hwmgr->hwmgr_func->stop_thermal_controller(hwmgr);
}

int phm_register_thermal_interrupt(struct pp_hwmgr *hwmgr, const void *info)
int phm_register_irq_handlers(struct pp_hwmgr *hwmgr)
{
	PHM_FUNC_CHECK(hwmgr);

	if (hwmgr->hwmgr_func->register_internal_thermal_interrupt != NULL)
		return hwmgr->hwmgr_func->register_internal_thermal_interrupt(hwmgr, info);
	if (hwmgr->hwmgr_func->register_irq_handlers != NULL)
		return hwmgr->hwmgr_func->register_irq_handlers(hwmgr);

	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ int hwmgr_hw_init(struct pp_hwmgr *hwmgr)
	if (ret)
		goto err2;

	ret = phm_register_thermal_interrupt(hwmgr, NULL);
	ret = phm_register_irq_handlers(hwmgr);
	if (ret)
		goto err2;

+2 −3
Original line number Diff line number Diff line
@@ -3998,8 +3998,7 @@ static int smu7_set_max_fan_rpm_output(struct pp_hwmgr *hwmgr, uint16_t us_max_f
			PPSMC_MSG_SetFanRpmMax, us_max_fan_rpm);
}

static int smu7_register_internal_thermal_interrupt(struct pp_hwmgr *hwmgr,
					const void *thermal_interrupt_info)
static int smu7_register_irq_handlers(struct pp_hwmgr *hwmgr)
{
	return 0;
}
@@ -4984,7 +4983,7 @@ static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
	.get_fan_speed_rpm = smu7_fan_ctrl_get_fan_speed_rpm,
	.set_fan_speed_rpm = smu7_fan_ctrl_set_fan_speed_rpm,
	.uninitialize_thermal_controller = smu7_thermal_ctrl_uninitialize_thermal_controller,
	.register_internal_thermal_interrupt = smu7_register_internal_thermal_interrupt,
	.register_irq_handlers = smu7_register_irq_handlers,
	.check_smc_update_required_for_display_configuration = smu7_check_smc_update_required_for_display_configuration,
	.check_states_equal = smu7_check_states_equal,
	.set_fan_control_mode = smu7_set_fan_control_mode,
+1 −2
Original line number Diff line number Diff line
@@ -581,8 +581,7 @@ static const struct amdgpu_irq_src_funcs smu9_irq_funcs = {
	.process = phm_irq_process,
};

int smu9_register_thermal_interrupt(struct pp_hwmgr *hwmgr,
		const void *info)
int smu9_register_irq_handlers(struct pp_hwmgr *hwmgr)
{
	struct amdgpu_irq_src *source =
		kzalloc(sizeof(struct amdgpu_irq_src), GFP_KERNEL);
+1 −2
Original line number Diff line number Diff line
@@ -77,8 +77,7 @@ int phm_irq_process(struct amdgpu_device *adev,
			   struct amdgpu_irq_src *source,
			   struct amdgpu_iv_entry *entry);

int smu9_register_thermal_interrupt(struct pp_hwmgr *hwmgr,
		const void *info);
int smu9_register_irq_handlers(struct pp_hwmgr *hwmgr);

#define PHM_FIELD_SHIFT(reg, field) reg##__##field##__SHIFT
#define PHM_FIELD_MASK(reg, field) reg##__##field##_MASK
Loading