diff options
| author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2024-11-04 14:44:16 +0100 | 
|---|---|---|
| committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2024-11-04 14:45:21 +0100 | 
| commit | d78f0ee0406803cda8801fd5201746ccf89e5e4a (patch) | |
| tree | d0d145319344a07cb6f4b47578f01236b71ad473 /drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | |
| parent | a88f9ed63b3cec761b04cba8104b2d0b2b66b25d (diff) | |
| parent | 30169bb64580bd7bce9290c1952bf0aa6cc37fe5 (diff) | |
Merge remote-tracking branch 'drm/drm-next' into drm-misc-next
Didn't notice drm/drm-next had the build fix for drm_bridge, so ended up
committing the same patch. Sync with drm and pretend it didn't happen?
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 55 | 
1 files changed, 14 insertions, 41 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index bf6c4a0d0525..ec5e0dcf8613 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c @@ -98,9 +98,9 @@ enum {  	ACP_TILE_DSP2,  }; -static int acp_sw_init(void *handle) +static int acp_sw_init(struct amdgpu_ip_block *ip_block)  { -	struct amdgpu_device *adev = (struct amdgpu_device *)handle; +	struct amdgpu_device *adev = ip_block->adev;  	adev->acp.parent = adev->dev; @@ -112,9 +112,9 @@ static int acp_sw_init(void *handle)  	return 0;  } -static int acp_sw_fini(void *handle) +static int acp_sw_fini(struct amdgpu_ip_block *ip_block)  { -	struct amdgpu_device *adev = (struct amdgpu_device *)handle; +	struct amdgpu_device *adev = ip_block->adev;  	if (adev->acp.cgs_device)  		amdgpu_cgs_destroy_device(adev->acp.cgs_device); @@ -219,10 +219,10 @@ static const struct dmi_system_id acp_quirk_table[] = {  /**   * acp_hw_init - start and test ACP block   * - * @handle: handle used to pass amdgpu_device pointer + * @ip_block: Pointer to the amdgpu_ip_block for this hw instance.   *   */ -static int acp_hw_init(void *handle) +static int acp_hw_init(struct amdgpu_ip_block *ip_block)  {  	int r;  	u64 acp_base; @@ -230,13 +230,7 @@ static int acp_hw_init(void *handle)  	u32 count = 0;  	struct i2s_platform_data *i2s_pdata = NULL; -	struct amdgpu_device *adev = (struct amdgpu_device *)handle; - -	const struct amdgpu_ip_block *ip_block = -		amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_ACP); - -	if (!ip_block) -		return -EINVAL; +	struct amdgpu_device *adev = ip_block->adev;  	r = amd_acp_hw_init(adev->acp.cgs_device,  			    ip_block->version->major, ip_block->version->minor); @@ -503,14 +497,14 @@ failure:  /**   * acp_hw_fini - stop the hardware block   * - * @handle: handle used to pass amdgpu_device pointer + * @ip_block: Pointer to the amdgpu_ip_block for this hw instance.   *   */ -static int acp_hw_fini(void *handle) +static int acp_hw_fini(struct amdgpu_ip_block *ip_block)  {  	u32 val = 0;  	u32 count = 0; -	struct amdgpu_device *adev = (struct amdgpu_device *)handle; +	struct amdgpu_device *adev = ip_block->adev;  	/* return early if no ACP */  	if (!adev->acp.acp_genpd) { @@ -565,9 +559,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) @@ -575,9 +569,9 @@ static int acp_suspend(void *handle)  	return 0;  } -static int acp_resume(void *handle) +static int acp_resume(struct amdgpu_ip_block *ip_block)  { -	struct amdgpu_device *adev = (struct amdgpu_device *)handle; +	struct amdgpu_device *adev = ip_block->adev;  	/* power down again on resume */  	if (!adev->acp.acp_cell) @@ -585,26 +579,11 @@ static int acp_resume(void *handle)  	return 0;  } -static int acp_early_init(void *handle) -{ -	return 0; -} -  static bool acp_is_idle(void *handle)  {  	return true;  } -static int acp_wait_for_idle(void *handle) -{ -	return 0; -} - -static int acp_soft_reset(void *handle) -{ -	return 0; -} -  static int acp_set_clockgating_state(void *handle,  				     enum amd_clockgating_state state)  { @@ -624,8 +603,6 @@ static int acp_set_powergating_state(void *handle,  static const struct amd_ip_funcs acp_ip_funcs = {  	.name = "acp_ip", -	.early_init = acp_early_init, -	.late_init = NULL,  	.sw_init = acp_sw_init,  	.sw_fini = acp_sw_fini,  	.hw_init = acp_hw_init, @@ -633,12 +610,8 @@ static const struct amd_ip_funcs acp_ip_funcs = {  	.suspend = acp_suspend,  	.resume = acp_resume,  	.is_idle = acp_is_idle, -	.wait_for_idle = acp_wait_for_idle, -	.soft_reset = acp_soft_reset,  	.set_clockgating_state = acp_set_clockgating_state,  	.set_powergating_state = acp_set_powergating_state, -	.dump_ip_state = NULL, -	.print_ip_state = NULL,  };  const struct amdgpu_ip_block_version acp_ip_block = {  | 
