drm/amdgpu: update the handle ptr in suspend
authorSunil Khatri <sunil.khatri@amd.com>
Mon, 30 Sep 2024 11:30:38 +0000 (17:00 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Oct 2024 18:02:45 +0000 (14:02 -0400)
Update the *handle to amdgpu_ip_block ptr for all
functions pointers of suspend.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
89 files changed:
drivers/gpu/drm/amd/amdgpu/aldebaran.c
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
drivers/gpu/drm/amd/amdgpu/cik.c
drivers/gpu/drm/amd/amdgpu/cik_ih.c
drivers/gpu/drm/amd/amdgpu/cik_sdma.c
drivers/gpu/drm/amd/amdgpu/cz_ih.c
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
drivers/gpu/drm/amd/amdgpu/iceland_ih.c
drivers/gpu/drm/amd/amdgpu/ih_v6_0.c
drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
drivers/gpu/drm/amd/amdgpu/navi10_ih.c
drivers/gpu/drm/amd/amdgpu/nv.c
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
drivers/gpu/drm/amd/amdgpu/si.c
drivers/gpu/drm/amd/amdgpu/si_dma.c
drivers/gpu/drm/amd/amdgpu/si_ih.c
drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
drivers/gpu/drm/amd/amdgpu/soc15.c
drivers/gpu/drm/amd/amdgpu/soc21.c
drivers/gpu/drm/amd/amdgpu/soc24.c
drivers/gpu/drm/amd/amdgpu/tonga_ih.c
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
drivers/gpu/drm/amd/amdgpu/vega10_ih.c
drivers/gpu/drm/amd/amdgpu/vega20_ih.c
drivers/gpu/drm/amd/amdgpu/vi.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/include/amd_shared.h
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

index 574aeca..5bcf451 100644 (file)
@@ -85,7 +85,7 @@ static int aldebaran_mode2_suspend_ip(struct amdgpu_device *adev)
                              AMD_IP_BLOCK_TYPE_SDMA))
                        continue;
 
-               r = adev->ip_blocks[i].version->funcs->suspend(adev);
+               r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
 
                if (r) {
                        dev_err(adev->dev,
index 7e327ad..1d3948e 100644 (file)
@@ -565,9 +565,9 @@ static int acp_hw_fini(void *handle)
        return 0;
 }
 
-static int acp_suspend(void *handle)
+static int acp_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        /* power up on suspend */
        if (!adev->acp.acp_cell)
index 2df8bd4..5348832 100644 (file)
@@ -3464,7 +3464,7 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
                        continue;
 
                /* XXX handle errors */
-               r = adev->ip_blocks[i].version->funcs->suspend(adev);
+               r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
                /* XXX handle errors */
                if (r) {
                        DRM_ERROR("suspend of IP block <%s> failed %d\n",
@@ -3546,7 +3546,7 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
                        continue;
 
                /* XXX handle errors */
-               r = adev->ip_blocks[i].version->funcs->suspend(adev);
+               r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
                /* XXX handle errors */
                if (r) {
                        DRM_ERROR("suspend of IP block <%s> failed %d\n",
index 63a1640..46d6136 100644 (file)
@@ -83,7 +83,7 @@ static int isp_hw_fini(void *handle)
        return -ENODEV;
 }
 
-static int isp_suspend(void *handle)
+static int isp_suspend(struct amdgpu_ip_block *ip_block)
 {
        return 0;
 }
index 02fad4d..eb6ae3c 100644 (file)
@@ -3026,10 +3026,10 @@ static int psp_hw_fini(void *handle)
        return 0;
 }
 
-static int psp_suspend(void *handle)
+static int psp_suspend(struct amdgpu_ip_block *ip_block)
 {
        int ret = 0;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        struct psp_context *psp = &adev->psp;
 
        if (adev->gmc.xgmi.num_physical_nodes > 1 &&
index f35fcb4..3e27245 100644 (file)
@@ -40,7 +40,7 @@ static int amdgpu_reset_xgmi_reset_on_init_suspend(struct amdgpu_device *adev)
                        continue;
 
                /* XXX handle errors */
-               r = adev->ip_blocks[i].version->funcs->suspend(adev);
+               r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
                /* XXX handle errors */
                if (r) {
                        dev_err(adev->dev, "suspend of IP block <%s> failed %d",
index c95c6ea..99cb064 100644 (file)
@@ -873,9 +873,9 @@ static int umsch_mm_hw_fini(void *handle)
        return 0;
 }
 
-static int umsch_mm_suspend(void *handle)
+static int umsch_mm_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return umsch_mm_hw_fini(adev);
 }
index 822c9e0..e27c5d2 100644 (file)
@@ -605,15 +605,15 @@ static int amdgpu_vkms_hw_fini(void *handle)
        return 0;
 }
 
-static int amdgpu_vkms_suspend(void *handle)
+static int amdgpu_vkms_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = drm_mode_config_helper_suspend(adev_to_drm(adev));
        if (r)
                return r;
-       return amdgpu_vkms_hw_fini(handle);
+       return amdgpu_vkms_hw_fini(adev);
 }
 
 static int amdgpu_vkms_resume(void *handle)
index 1b4c602..fd784b8 100644 (file)
@@ -434,9 +434,9 @@ static int vpe_hw_fini(void *handle)
        return 0;
 }
 
-static int vpe_suspend(void *handle)
+static int vpe_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        cancel_delayed_work_sync(&adev->vpe.idle_work);
 
index 5ff1c91..05a9530 100644 (file)
@@ -2153,9 +2153,9 @@ static int cik_common_hw_fini(void *handle)
        return 0;
 }
 
-static int cik_common_suspend(void *handle)
+static int cik_common_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return cik_common_hw_fini(adev);
 }
index 8aaf2c2..47d72f6 100644 (file)
@@ -337,9 +337,9 @@ static int cik_ih_hw_fini(void *handle)
        return 0;
 }
 
-static int cik_ih_suspend(void *handle)
+static int cik_ih_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return cik_ih_hw_fini(adev);
 }
index 844bc8c..d9b222b 100644 (file)
@@ -1011,9 +1011,9 @@ static int cik_sdma_hw_fini(void *handle)
        return 0;
 }
 
-static int cik_sdma_suspend(void *handle)
+static int cik_sdma_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return cik_sdma_hw_fini(adev);
 }
index cfae318..198dcbc 100644 (file)
@@ -333,9 +333,9 @@ static int cz_ih_hw_fini(void *handle)
        return 0;
 }
 
-static int cz_ih_suspend(void *handle)
+static int cz_ih_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return cz_ih_hw_fini(adev);
 }
index 2ae065e..cf30a14 100644 (file)
@@ -2905,9 +2905,9 @@ static int dce_v10_0_hw_fini(void *handle)
        return 0;
 }
 
-static int dce_v10_0_suspend(void *handle)
+static int dce_v10_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = amdgpu_display_suspend_helper(adev);
@@ -2917,7 +2917,7 @@ static int dce_v10_0_suspend(void *handle)
        adev->mode_info.bl_level =
                amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
 
-       return dce_v10_0_hw_fini(handle);
+       return dce_v10_0_hw_fini(adev);
 }
 
 static int dce_v10_0_resume(void *handle)
index cc90ee9..fc4de8c 100644 (file)
@@ -3043,9 +3043,9 @@ static int dce_v11_0_hw_fini(void *handle)
        return 0;
 }
 
-static int dce_v11_0_suspend(void *handle)
+static int dce_v11_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = amdgpu_display_suspend_helper(adev);
@@ -3055,7 +3055,7 @@ static int dce_v11_0_suspend(void *handle)
        adev->mode_info.bl_level =
                amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
 
-       return dce_v11_0_hw_fini(handle);
+       return dce_v11_0_hw_fini(adev);
 }
 
 static int dce_v11_0_resume(void *handle)
index 52c7298..767c707 100644 (file)
@@ -2801,9 +2801,9 @@ static int dce_v6_0_hw_fini(void *handle)
        return 0;
 }
 
-static int dce_v6_0_suspend(void *handle)
+static int dce_v6_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = amdgpu_display_suspend_helper(adev);
@@ -2812,7 +2812,7 @@ static int dce_v6_0_suspend(void *handle)
        adev->mode_info.bl_level =
                amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
 
-       return dce_v6_0_hw_fini(handle);
+       return dce_v6_0_hw_fini(adev);
 }
 
 static int dce_v6_0_resume(void *handle)
index 3225c7c..9033e27 100644 (file)
@@ -2823,9 +2823,9 @@ static int dce_v8_0_hw_fini(void *handle)
        return 0;
 }
 
-static int dce_v8_0_suspend(void *handle)
+static int dce_v8_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = amdgpu_display_suspend_helper(adev);
@@ -2835,7 +2835,7 @@ static int dce_v8_0_suspend(void *handle)
        adev->mode_info.bl_level =
                amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
 
-       return dce_v8_0_hw_fini(handle);
+       return dce_v8_0_hw_fini(adev);
 }
 
 static int dce_v8_0_resume(void *handle)
index 86d9d4c..044d846 100644 (file)
@@ -7456,9 +7456,11 @@ static int gfx_v10_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gfx_v10_0_suspend(void *handle)
+static int gfx_v10_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       return gfx_v10_0_hw_fini(handle);
+       struct amdgpu_device *adev = ip_block->adev;
+
+       return gfx_v10_0_hw_fini(adev);
 }
 
 static int gfx_v10_0_resume(void *handle)
index 3068e27..9532bcd 100644 (file)
@@ -4705,9 +4705,11 @@ static int gfx_v11_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gfx_v11_0_suspend(void *handle)
+static int gfx_v11_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       return gfx_v11_0_hw_fini(handle);
+       struct amdgpu_device *adev = ip_block->adev;
+
+       return gfx_v11_0_hw_fini(adev);
 }
 
 static int gfx_v11_0_resume(void *handle)
index 3a87b4b..9f1f6f3 100644 (file)
@@ -3643,9 +3643,11 @@ static int gfx_v12_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gfx_v12_0_suspend(void *handle)
+static int gfx_v12_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       return gfx_v12_0_hw_fini(handle);
+       struct amdgpu_device *adev = ip_block->adev;
+
+       return gfx_v12_0_hw_fini(adev);
 }
 
 static int gfx_v12_0_resume(void *handle)
index 8fb78d8..8f2e79f 100644 (file)
@@ -3153,9 +3153,9 @@ static int gfx_v6_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gfx_v6_0_suspend(void *handle)
+static int gfx_v6_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return gfx_v6_0_hw_fini(adev);
 }
index e45ab9c..f2b294b 100644 (file)
@@ -4499,9 +4499,9 @@ static int gfx_v7_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gfx_v7_0_suspend(void *handle)
+static int gfx_v7_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return gfx_v7_0_hw_fini(adev);
 }
index 446b6c9..fe4fd15 100644 (file)
@@ -4917,9 +4917,11 @@ static int gfx_v8_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gfx_v8_0_suspend(void *handle)
+static int gfx_v8_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       return gfx_v8_0_hw_fini(handle);
+       struct amdgpu_device *adev = ip_block->adev;
+
+       return gfx_v8_0_hw_fini(adev);
 }
 
 static int gfx_v8_0_resume(void *handle)
index 987d346..6c7cf7e 100644 (file)
@@ -4074,9 +4074,11 @@ static int gfx_v9_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gfx_v9_0_suspend(void *handle)
+static int gfx_v9_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       return gfx_v9_0_hw_fini(handle);
+       struct amdgpu_device *adev = ip_block->adev;
+
+       return gfx_v9_0_hw_fini(adev);
 }
 
 static int gfx_v9_0_resume(void *handle)
index 197840d..4b86c0a 100644 (file)
@@ -2386,9 +2386,11 @@ static int gfx_v9_4_3_hw_fini(void *handle)
        return 0;
 }
 
-static int gfx_v9_4_3_suspend(void *handle)
+static int gfx_v9_4_3_suspend(struct amdgpu_ip_block *ip_block)
 {
-       return gfx_v9_4_3_hw_fini(handle);
+       struct amdgpu_device *adev = ip_block->adev;
+
+       return gfx_v9_4_3_hw_fini(adev);
 }
 
 static int gfx_v9_4_3_resume(void *handle)
index 0096ddf..f19b3f0 100644 (file)
@@ -1053,9 +1053,9 @@ static int gmc_v10_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gmc_v10_0_suspend(void *handle)
+static int gmc_v10_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        gmc_v10_0_hw_fini(adev);
 
index 9fd550c..dab32d1 100644 (file)
@@ -961,9 +961,9 @@ static int gmc_v11_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gmc_v11_0_suspend(void *handle)
+static int gmc_v11_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        gmc_v11_0_hw_fini(adev);
 
index 9f967e0..05f6b4c 100644 (file)
@@ -945,9 +945,9 @@ static int gmc_v12_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gmc_v12_0_suspend(void *handle)
+static int gmc_v12_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        gmc_v12_0_hw_fini(adev);
 
index ab90d29..c311378 100644 (file)
@@ -935,9 +935,9 @@ static int gmc_v6_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gmc_v6_0_suspend(void *handle)
+static int gmc_v6_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        gmc_v6_0_hw_fini(adev);
 
index 2644e97..5f725ff 100644 (file)
@@ -1111,9 +1111,9 @@ static int gmc_v7_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gmc_v7_0_suspend(void *handle)
+static int gmc_v7_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        gmc_v7_0_hw_fini(adev);
 
index 32954cc..d34cec8 100644 (file)
@@ -1242,9 +1242,9 @@ static int gmc_v8_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gmc_v8_0_suspend(void *handle)
+static int gmc_v8_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        gmc_v8_0_hw_fini(adev);
 
index bbc1e06..198101e 100644 (file)
@@ -2428,9 +2428,9 @@ static int gmc_v9_0_hw_fini(void *handle)
        return 0;
 }
 
-static int gmc_v9_0_suspend(void *handle)
+static int gmc_v9_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return gmc_v9_0_hw_fini(adev);
 }
index 9e0f5f7..ed29392 100644 (file)
@@ -327,9 +327,9 @@ static int iceland_ih_hw_fini(void *handle)
        return 0;
 }
 
-static int iceland_ih_suspend(void *handle)
+static int iceland_ih_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return iceland_ih_hw_fini(adev);
 }
index a719c1c..41bc748 100644 (file)
@@ -644,9 +644,9 @@ static int ih_v6_0_hw_fini(void *handle)
        return 0;
 }
 
-static int ih_v6_0_suspend(void *handle)
+static int ih_v6_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return ih_v6_0_hw_fini(adev);
 }
index f3b8f67..e6c6960 100644 (file)
@@ -623,9 +623,9 @@ static int ih_v6_1_hw_fini(void *handle)
        return 0;
 }
 
-static int ih_v6_1_suspend(void *handle)
+static int ih_v6_1_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return ih_v6_1_hw_fini(adev);
 }
index 3658e93..73201d2 100644 (file)
@@ -613,9 +613,9 @@ static int ih_v7_0_hw_fini(void *handle)
        return 0;
 }
 
-static int ih_v7_0_suspend(void *handle)
+static int ih_v7_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return ih_v7_0_hw_fini(adev);
 }
index 65a0eed..a334357 100644 (file)
@@ -166,9 +166,9 @@ static int jpeg_v2_0_hw_fini(void *handle)
  *
  * HW fini and suspend JPEG block
  */
-static int jpeg_v2_0_suspend(void *handle)
+static int jpeg_v2_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = jpeg_v2_0_hw_fini(adev);
index 363a1fd..b0d19a2 100644 (file)
@@ -235,9 +235,9 @@ static int jpeg_v2_5_hw_fini(void *handle)
  *
  * HW fini and suspend JPEG block
  */
-static int jpeg_v2_5_suspend(void *handle)
+static int jpeg_v2_5_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = jpeg_v2_5_hw_fini(adev);
index 0afd3f0..f6f5924 100644 (file)
@@ -180,9 +180,9 @@ static int jpeg_v3_0_hw_fini(void *handle)
  *
  * HW fini and suspend JPEG block
  */
-static int jpeg_v3_0_suspend(void *handle)
+static int jpeg_v3_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = jpeg_v3_0_hw_fini(adev);
index e73fe80..bb6fb11 100644 (file)
@@ -214,9 +214,9 @@ static int jpeg_v4_0_hw_fini(void *handle)
  *
  * HW fini and suspend JPEG block
  */
-static int jpeg_v4_0_suspend(void *handle)
+static int jpeg_v4_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = jpeg_v4_0_hw_fini(adev);
index 973baa7..a219aca 100644 (file)
@@ -384,9 +384,9 @@ static int jpeg_v4_0_3_hw_fini(void *handle)
  *
  * HW fini and suspend JPEG block
  */
-static int jpeg_v4_0_3_suspend(void *handle)
+static int jpeg_v4_0_3_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = jpeg_v4_0_3_hw_fini(adev);
index 7fc36a8..de3c423 100644 (file)
@@ -241,9 +241,9 @@ static int jpeg_v4_0_5_hw_fini(void *handle)
  *
  * HW fini and suspend JPEG block
  */
-static int jpeg_v4_0_5_suspend(void *handle)
+static int jpeg_v4_0_5_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = jpeg_v4_0_5_hw_fini(adev);
index 8af3318..638c1ec 100644 (file)
@@ -177,9 +177,9 @@ static int jpeg_v5_0_0_hw_fini(void *handle)
  *
  * HW fini and suspend JPEG block
  */
-static int jpeg_v5_0_0_suspend(void *handle)
+static int jpeg_v5_0_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = jpeg_v5_0_0_hw_fini(adev);
index e62a41d..a047b76 100644 (file)
@@ -1629,10 +1629,10 @@ static int mes_v11_0_hw_fini(void *handle)
        return 0;
 }
 
-static int mes_v11_0_suspend(void *handle)
+static int mes_v11_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        r = amdgpu_mes_suspend(adev);
        if (r)
index 471adfb..0902f7c 100644 (file)
@@ -1593,10 +1593,10 @@ static int mes_v12_0_hw_fini(void *handle)
        return 0;
 }
 
-static int mes_v12_0_suspend(void *handle)
+static int mes_v12_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        r = amdgpu_mes_suspend(adev);
        if (r)
index c249cbe..fafe416 100644 (file)
@@ -618,9 +618,9 @@ static int navi10_ih_hw_fini(void *handle)
        return 0;
 }
 
-static int navi10_ih_suspend(void *handle)
+static int navi10_ih_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return navi10_ih_hw_fini(adev);
 }
index f0b4227..b6d373b 100644 (file)
@@ -1029,9 +1029,9 @@ static int nv_common_hw_fini(void *handle)
        return 0;
 }
 
-static int nv_common_suspend(void *handle)
+static int nv_common_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return nv_common_hw_fini(adev);
 }
index 912b0bb..4d878c0 100644 (file)
@@ -901,9 +901,9 @@ static int sdma_v2_4_hw_fini(void *handle)
        return 0;
 }
 
-static int sdma_v2_4_suspend(void *handle)
+static int sdma_v2_4_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return sdma_v2_4_hw_fini(adev);
 }
index 1458678..c31334e 100644 (file)
@@ -1188,9 +1188,9 @@ static int sdma_v3_0_hw_fini(void *handle)
        return 0;
 }
 
-static int sdma_v3_0_suspend(void *handle)
+static int sdma_v3_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return sdma_v3_0_hw_fini(adev);
 }
index 7343b86..1571444 100644 (file)
@@ -1988,9 +1988,9 @@ static int sdma_v4_0_hw_fini(void *handle)
        return 0;
 }
 
-static int sdma_v4_0_suspend(void *handle)
+static int sdma_v4_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        /* SMU saves SDMA state for us */
        if (adev->in_s0ix) {
index d83e247..91eed90 100644 (file)
@@ -1508,9 +1508,9 @@ static int sdma_v4_4_2_hw_fini(void *handle)
 static int sdma_v4_4_2_set_clockgating_state(void *handle,
                                             enum amd_clockgating_state state);
 
-static int sdma_v4_4_2_suspend(void *handle)
+static int sdma_v4_4_2_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        if (amdgpu_in_reset(adev))
                sdma_v4_4_2_set_clockgating_state(adev, AMD_CG_STATE_UNGATE);
index 0dd1522..65a5c24 100644 (file)
@@ -1502,9 +1502,9 @@ static int sdma_v5_0_hw_fini(void *handle)
        return 0;
 }
 
-static int sdma_v5_0_suspend(void *handle)
+static int sdma_v5_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return sdma_v5_0_hw_fini(adev);
 }
index 0b54433..e29bff3 100644 (file)
@@ -1402,9 +1402,9 @@ static int sdma_v5_2_hw_fini(void *handle)
        return 0;
 }
 
-static int sdma_v5_2_suspend(void *handle)
+static int sdma_v5_2_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return sdma_v5_2_hw_fini(adev);
 }
index ac14916..a378d35 100644 (file)
@@ -1400,9 +1400,9 @@ static int sdma_v6_0_hw_fini(void *handle)
        return 0;
 }
 
-static int sdma_v6_0_suspend(void *handle)
+static int sdma_v6_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return sdma_v6_0_hw_fini(adev);
 }
index 0e70169..d74b66a 100644 (file)
@@ -1358,9 +1358,9 @@ static int sdma_v7_0_hw_fini(void *handle)
        return 0;
 }
 
-static int sdma_v7_0_suspend(void *handle)
+static int sdma_v7_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return sdma_v7_0_hw_fini(adev);
 }
index 42588b1..b251a93 100644 (file)
@@ -2650,9 +2650,9 @@ static int si_common_hw_fini(void *handle)
        return 0;
 }
 
-static int si_common_suspend(void *handle)
+static int si_common_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return si_common_hw_fini(adev);
 }
index ac05b74..12a6c71 100644 (file)
@@ -533,9 +533,9 @@ static int si_dma_hw_fini(void *handle)
        return 0;
 }
 
-static int si_dma_suspend(void *handle)
+static int si_dma_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return si_dma_hw_fini(adev);
 }
index f09b1d8..569e552 100644 (file)
@@ -202,9 +202,9 @@ static int si_ih_hw_fini(void *handle)
        return 0;
 }
 
-static int si_ih_suspend(void *handle)
+static int si_ih_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return si_ih_hw_fini(adev);
 }
index bda786d..37f6377 100644 (file)
@@ -81,7 +81,7 @@ static int sienna_cichlid_mode2_suspend_ip(struct amdgpu_device *adev)
                              AMD_IP_BLOCK_TYPE_SDMA))
                        continue;
 
-               r = adev->ip_blocks[i].version->funcs->suspend(adev);
+               r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
 
                if (r) {
                        dev_err(adev->dev,
index e0c0518..3008d80 100644 (file)
@@ -80,7 +80,7 @@ static int smu_v13_0_10_mode2_suspend_ip(struct amdgpu_device *adev)
                              AMD_IP_BLOCK_TYPE_MES))
                        continue;
 
-               r = adev->ip_blocks[i].version->funcs->suspend(adev);
+               r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
 
                if (r) {
                        dev_err(adev->dev,
index ca3675f..c0be766 100644 (file)
@@ -1318,9 +1318,9 @@ static int soc15_common_hw_fini(void *handle)
        return 0;
 }
 
-static int soc15_common_suspend(void *handle)
+static int soc15_common_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return soc15_common_hw_fini(adev);
 }
index 5454d2f..d267d97 100644 (file)
@@ -890,9 +890,9 @@ static int soc21_common_hw_fini(void *handle)
        return 0;
 }
 
-static int soc21_common_suspend(void *handle)
+static int soc21_common_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return soc21_common_hw_fini(adev);
 }
index 4a41af8..180cb39 100644 (file)
@@ -512,9 +512,9 @@ static int soc24_common_hw_fini(void *handle)
        return 0;
 }
 
-static int soc24_common_suspend(void *handle)
+static int soc24_common_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return soc24_common_hw_fini(adev);
 }
index be17007..f642cdb 100644 (file)
@@ -345,9 +345,9 @@ static int tonga_ih_hw_fini(void *handle)
        return 0;
 }
 
-static int tonga_ih_suspend(void *handle)
+static int tonga_ih_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return tonga_ih_hw_fini(adev);
 }
index 7ba5e64..079ce94 100644 (file)
@@ -711,10 +711,10 @@ static int uvd_v3_1_prepare_suspend(struct amdgpu_ip_block *ip_block)
        return amdgpu_uvd_prepare_suspend(adev);
 }
 
-static int uvd_v3_1_suspend(void *handle)
+static int uvd_v3_1_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        /*
         * Proper cleanups before halting the HW engine:
index 5a60d7c..53233c4 100644 (file)
@@ -225,10 +225,10 @@ static int uvd_v4_2_prepare_suspend(struct amdgpu_ip_block *ip_block)
        return amdgpu_uvd_prepare_suspend(adev);
 }
 
-static int uvd_v4_2_suspend(void *handle)
+static int uvd_v4_2_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        /*
         * Proper cleanups before halting the HW engine:
index 6fd6deb..bef29cf 100644 (file)
@@ -223,10 +223,10 @@ static int uvd_v5_0_prepare_suspend(struct amdgpu_ip_block *ip_block)
        return amdgpu_uvd_prepare_suspend(adev);
 }
 
-static int uvd_v5_0_suspend(void *handle)
+static int uvd_v5_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        /*
         * Proper cleanups before halting the HW engine:
index 6bc02f5..cb6e9ca 100644 (file)
@@ -547,10 +547,10 @@ static int uvd_v6_0_prepare_suspend(struct amdgpu_ip_block *ip_block)
        return amdgpu_uvd_prepare_suspend(adev);
 }
 
-static int uvd_v6_0_suspend(void *handle)
+static int uvd_v6_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        /*
         * Proper cleanups before halting the HW engine:
index 7aeb59e..1354277 100644 (file)
@@ -615,10 +615,10 @@ static int uvd_v7_0_prepare_suspend(struct amdgpu_ip_block *ip_block)
        return amdgpu_uvd_prepare_suspend(adev);
 }
 
-static int uvd_v7_0_suspend(void *handle)
+static int uvd_v7_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        /*
         * Proper cleanups before halting the HW engine:
index 28184a5..f796c58 100644 (file)
@@ -490,10 +490,10 @@ static int vce_v2_0_hw_fini(void *handle)
        return 0;
 }
 
-static int vce_v2_0_suspend(void *handle)
+static int vce_v2_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
 
        /*
index 6afa88b..e53b3c1 100644 (file)
@@ -505,10 +505,10 @@ static int vce_v3_0_hw_fini(void *handle)
        return vce_v3_0_set_clockgating_state(adev, AMD_CG_STATE_GATE);
 }
 
-static int vce_v3_0_suspend(void *handle)
+static int vce_v3_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        /*
         * Proper cleanups before halting the HW engine:
@@ -713,7 +713,7 @@ static int vce_v3_0_pre_soft_reset(struct amdgpu_ip_block *ip_block)
 
        mdelay(5);
 
-       return vce_v3_0_suspend(adev);
+       return vce_v3_0_suspend(ip_block);
 }
 
 
index aced76b..bd273d5 100644 (file)
@@ -558,9 +558,9 @@ static int vce_v4_0_hw_fini(void *handle)
        return 0;
 }
 
-static int vce_v4_0_suspend(void *handle)
+static int vce_v4_0_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r, idx;
 
        if (adev->vce.vcpu_bo == NULL)
index 0727c41..d5ff66c 100644 (file)
@@ -294,10 +294,10 @@ static int vcn_v1_0_hw_fini(void *handle)
  *
  * HW fini and suspend VCN block
  */
-static int vcn_v1_0_suspend(void *handle)
+static int vcn_v1_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        bool idle_work_unexecuted;
 
        idle_work_unexecuted = cancel_delayed_work_sync(&adev->vcn.idle_work);
index aef0aa9..0aef4af 100644 (file)
@@ -330,10 +330,10 @@ static int vcn_v2_0_hw_fini(void *handle)
  *
  * HW fini and suspend VCN block
  */
-static int vcn_v2_0_suspend(void *handle)
+static int vcn_v2_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        r = vcn_v2_0_hw_fini(adev);
        if (r)
index c483124..93bf87d 100644 (file)
@@ -415,10 +415,10 @@ static int vcn_v2_5_hw_fini(void *handle)
  *
  * HW fini and suspend VCN block
  */
-static int vcn_v2_5_suspend(void *handle)
+static int vcn_v2_5_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        r = vcn_v2_5_hw_fini(adev);
        if (r)
index e5c22b1..44c1db2 100644 (file)
@@ -447,10 +447,10 @@ static int vcn_v3_0_hw_fini(void *handle)
  *
  * HW fini and suspend VCN block
  */
-static int vcn_v3_0_suspend(void *handle)
+static int vcn_v3_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        r = vcn_v3_0_hw_fini(adev);
        if (r)
index 4c92844..3832f6b 100644 (file)
@@ -376,10 +376,10 @@ static int vcn_v4_0_hw_fini(void *handle)
  *
  * HW fini and suspend VCN block
  */
-static int vcn_v4_0_suspend(void *handle)
+static int vcn_v4_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        r = vcn_v4_0_hw_fini(adev);
        if (r)
index b00ad0a..e071fb6 100644 (file)
@@ -331,9 +331,9 @@ static int vcn_v4_0_3_hw_fini(void *handle)
  *
  * HW fini and suspend VCN block
  */
-static int vcn_v4_0_3_suspend(void *handle)
+static int vcn_v4_0_3_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        int r;
 
        r = vcn_v4_0_3_hw_fini(adev);
index 8989713..d7460b4 100644 (file)
@@ -324,10 +324,10 @@ static int vcn_v4_0_5_hw_fini(void *handle)
  *
  * HW fini and suspend VCN block
  */
-static int vcn_v4_0_5_suspend(void *handle)
+static int vcn_v4_0_5_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        r = vcn_v4_0_5_hw_fini(adev);
        if (r)
index f3f6e37..4d4d7ca 100644 (file)
@@ -288,10 +288,10 @@ static int vcn_v5_0_0_hw_fini(void *handle)
  *
  * HW fini and suspend VCN block
  */
-static int vcn_v5_0_0_suspend(void *handle)
+static int vcn_v5_0_0_suspend(struct amdgpu_ip_block *ip_block)
 {
        int r;
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        r = vcn_v5_0_0_hw_fini(adev);
        if (r)
index 31f3ed1..c024d25 100644 (file)
@@ -550,9 +550,9 @@ static int vega10_ih_hw_fini(void *handle)
        return 0;
 }
 
-static int vega10_ih_suspend(void *handle)
+static int vega10_ih_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return vega10_ih_hw_fini(adev);
 }
index 6a9ef3e..d9b5633 100644 (file)
@@ -616,9 +616,9 @@ static int vega20_ih_hw_fini(void *handle)
        return 0;
 }
 
-static int vega20_ih_suspend(void *handle)
+static int vega20_ih_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return vega20_ih_hw_fini(adev);
 }
index b1d78cc..c428950 100644 (file)
@@ -1731,9 +1731,9 @@ static int vi_common_hw_fini(void *handle)
        return 0;
 }
 
-static int vi_common_suspend(void *handle)
+static int vi_common_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        return vi_common_hw_fini(adev);
 }
index 2363ddf..b0f26f3 100644 (file)
@@ -2936,9 +2936,9 @@ static void hpd_rx_irq_work_suspend(struct amdgpu_display_manager *dm)
        }
 }
 
-static int dm_suspend(void *handle)
+static int dm_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = handle;
+       struct amdgpu_device *adev = ip_block->adev;
        struct amdgpu_display_manager *dm = &adev->dm;
        int ret = 0;
 
index d095a73..9110a3a 100644 (file)
@@ -388,7 +388,7 @@ struct amd_ip_funcs {
        int (*hw_fini)(void *handle);
        void (*late_fini)(struct amdgpu_ip_block *ip_block);
        int (*prepare_suspend)(struct amdgpu_ip_block *ip_block);
-       int (*suspend)(void *handle);
+       int (*suspend)(struct amdgpu_ip_block *ip_block);
        int (*resume)(void *handle);
        bool (*is_idle)(void *handle);
        int (*wait_for_idle)(struct amdgpu_ip_block *ip_block);
index 7d2ff59..c468828 100644 (file)
@@ -3062,9 +3062,9 @@ static int kv_dpm_hw_fini(void *handle)
        return 0;
 }
 
-static int kv_dpm_suspend(void *handle)
+static int kv_dpm_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        if (adev->pm.dpm_enabled) {
                /* disable dpm */
index 3a08350..cba82d1 100644 (file)
@@ -7805,9 +7805,9 @@ static int si_dpm_hw_fini(void *handle)
        return 0;
 }
 
-static int si_dpm_suspend(void *handle)
+static int si_dpm_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
 
        if (adev->pm.dpm_enabled) {
                /* disable dpm */
index d531d08..dfdc26f 100644 (file)
@@ -261,9 +261,9 @@ static int pp_set_powergating_state(void *handle,
        return 0;
 }
 
-static int pp_suspend(void *handle)
+static int pp_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = handle;
+       struct amdgpu_device *adev = ip_block->adev;
        struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
 
        cancel_delayed_work_sync(&hwmgr->swctf_delayed_work);
index 2dd3867..a267ed6 100644 (file)
@@ -2075,9 +2075,9 @@ static int smu_reset(struct smu_context *smu)
        return 0;
 }
 
-static int smu_suspend(void *handle)
+static int smu_suspend(struct amdgpu_ip_block *ip_block)
 {
-       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       struct amdgpu_device *adev = ip_block->adev;
        struct smu_context *smu = adev->powerplay.pp_handle;
        int ret;
        uint64_t count;