diff options
| author | Evan Quan <[email protected]> | 2020-08-13 03:51:11 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2020-08-14 20:22:41 +0000 |
| commit | 20d3c28ce4e28ac4df9d139054aecb65ee5a9ee4 (patch) | |
| tree | 847870e899b5fee029c5c58d907c62d227324c6f /drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | |
| parent | drm/amd/powerplay: drop unnecessary pp_funcs checker (diff) | |
| download | kernel-20d3c28ce4e28ac4df9d139054aecb65ee5a9ee4.tar.gz kernel-20d3c28ce4e28ac4df9d139054aecb65ee5a9ee4.zip | |
drm/amd/powerplay: optimize i2c bus access implementation
The caller needs not care about the internal details how the powerplay
API implemented.
Signed-off-by: Evan Quan <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Acked-by: Nirmoy Das <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c index 5e9baca556a4..3465fddff666 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c @@ -1247,3 +1247,18 @@ int amdgpu_dpm_set_clockgating_by_smu(struct amdgpu_device *adev, return ret; } + +int amdgpu_dpm_smu_i2c_bus_access(struct amdgpu_device *adev, + bool acquire) +{ + void *pp_handle = adev->powerplay.pp_handle; + const struct amd_pm_funcs *pp_funcs = + adev->powerplay.pp_funcs; + int ret = -EOPNOTSUPP; + + if (pp_funcs && pp_funcs->smu_i2c_bus_access) + ret = pp_funcs->smu_i2c_bus_access(pp_handle, + acquire); + + return ret; +} |
