diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/tonga_dpm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/tonga_dpm.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c b/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c index cf97d496a7a4..2d5b1bd52afa 100644 --- a/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/tonga_dpm.c @@ -30,8 +30,10 @@ MODULE_FIRMWARE("amdgpu/tonga_smc.bin"); static void tonga_dpm_set_funcs(struct amdgpu_device *adev); -static int tonga_dpm_early_init(struct amdgpu_device *adev) +static int tonga_dpm_early_init(void *handle) { + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + tonga_dpm_set_funcs(adev); return 0; @@ -41,7 +43,6 @@ static int tonga_dpm_init_microcode(struct amdgpu_device *adev) { char fw_name[30] = "amdgpu/tonga_smc.bin"; int err; - err = request_firmware(&adev->pm.fw, fw_name, adev->dev); if (err) goto out; @@ -56,9 +57,10 @@ out: return err; } -static int tonga_dpm_sw_init(struct amdgpu_device *adev) +static int tonga_dpm_sw_init(void *handle) { int ret; + struct amdgpu_device *adev = (struct amdgpu_device *)handle; ret = tonga_dpm_init_microcode(adev); if (ret) @@ -67,14 +69,15 @@ static int tonga_dpm_sw_init(struct amdgpu_device *adev) return 0; } -static int tonga_dpm_sw_fini(struct amdgpu_device *adev) +static int tonga_dpm_sw_fini(void *handle) { return 0; } -static int tonga_dpm_hw_init(struct amdgpu_device *adev) +static int tonga_dpm_hw_init(void *handle) { int ret; + struct amdgpu_device *adev = (struct amdgpu_device *)handle; mutex_lock(&adev->pm.mutex); @@ -99,41 +102,47 @@ fail: return -EINVAL; } -static int tonga_dpm_hw_fini(struct amdgpu_device *adev) +static int tonga_dpm_hw_fini(void *handle) { + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + mutex_lock(&adev->pm.mutex); tonga_smu_fini(adev); mutex_unlock(&adev->pm.mutex); return 0; } -static int tonga_dpm_suspend(struct amdgpu_device *adev) +static int tonga_dpm_suspend(void *handle) { + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + tonga_dpm_hw_fini(adev); return 0; } -static int tonga_dpm_resume(struct amdgpu_device *adev) +static int tonga_dpm_resume(void *handle) { + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + tonga_dpm_hw_init(adev); return 0; } -static int tonga_dpm_set_clockgating_state(struct amdgpu_device *adev, - enum amdgpu_clockgating_state state) +static int tonga_dpm_set_clockgating_state(void *handle, + enum amd_clockgating_state state) { return 0; } -static int tonga_dpm_set_powergating_state(struct amdgpu_device *adev, - enum amdgpu_powergating_state state) +static int tonga_dpm_set_powergating_state(void *handle, + enum amd_powergating_state state) { return 0; } -const struct amdgpu_ip_funcs tonga_dpm_ip_funcs = { +const struct amd_ip_funcs tonga_dpm_ip_funcs = { .early_init = tonga_dpm_early_init, .late_init = NULL, .sw_init = tonga_dpm_sw_init, |