diff options
author | Huang Rui <ray.huang@amd.com> | 2016-12-14 21:55:09 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-01-27 11:12:41 -0500 |
commit | e81f749452001cc4c08aca1b1e9c0f51f878042a (patch) | |
tree | 8126e48f678a70fa9d5c671f988ea024eb584ef5 /drivers | |
parent | 613e61a0252c54371c957d44767544a76f0da3a6 (diff) |
drm/amd/powerplay: add request_firmware/release_firmware for smu7
Signed-off-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c index a74f60a575ae..880d3967e31c 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | |||
@@ -40,6 +40,8 @@ | |||
40 | 40 | ||
41 | #include "hwmgr.h" | 41 | #include "hwmgr.h" |
42 | #include "smu7_hwmgr.h" | 42 | #include "smu7_hwmgr.h" |
43 | #include "smu7_smumgr.h" | ||
44 | #include "smu_ucode_xfer_vi.h" | ||
43 | #include "smu7_powertune.h" | 45 | #include "smu7_powertune.h" |
44 | #include "smu7_dyn_defaults.h" | 46 | #include "smu7_dyn_defaults.h" |
45 | #include "smu7_thermal.h" | 47 | #include "smu7_thermal.h" |
@@ -4324,6 +4326,32 @@ static int smu7_get_clock_by_type(struct pp_hwmgr *hwmgr, enum amd_pp_clock_type | |||
4324 | return 0; | 4326 | return 0; |
4325 | } | 4327 | } |
4326 | 4328 | ||
4329 | static int smu7_request_firmware(struct pp_hwmgr *hwmgr) | ||
4330 | { | ||
4331 | int ret; | ||
4332 | struct cgs_firmware_info info = {0}; | ||
4333 | |||
4334 | ret = cgs_get_firmware_info(hwmgr->device, | ||
4335 | smu7_convert_fw_type_to_cgs(UCODE_ID_SMU), | ||
4336 | &info); | ||
4337 | if (ret || !info.kptr) | ||
4338 | return -EINVAL; | ||
4339 | |||
4340 | return 0; | ||
4341 | } | ||
4342 | |||
4343 | static int smu7_release_firmware(struct pp_hwmgr *hwmgr) | ||
4344 | { | ||
4345 | int ret; | ||
4346 | |||
4347 | ret = cgs_rel_firmware(hwmgr->device, | ||
4348 | smu7_convert_fw_type_to_cgs(UCODE_ID_SMU)); | ||
4349 | if (ret) | ||
4350 | return -EINVAL; | ||
4351 | |||
4352 | return 0; | ||
4353 | } | ||
4354 | |||
4327 | static const struct pp_hwmgr_func smu7_hwmgr_funcs = { | 4355 | static const struct pp_hwmgr_func smu7_hwmgr_funcs = { |
4328 | .backend_init = &smu7_hwmgr_backend_init, | 4356 | .backend_init = &smu7_hwmgr_backend_init, |
4329 | .backend_fini = &phm_hwmgr_backend_fini, | 4357 | .backend_fini = &phm_hwmgr_backend_fini, |
@@ -4371,6 +4399,8 @@ static const struct pp_hwmgr_func smu7_hwmgr_funcs = { | |||
4371 | .get_clock_by_type = smu7_get_clock_by_type, | 4399 | .get_clock_by_type = smu7_get_clock_by_type, |
4372 | .read_sensor = smu7_read_sensor, | 4400 | .read_sensor = smu7_read_sensor, |
4373 | .dynamic_state_management_disable = smu7_disable_dpm_tasks, | 4401 | .dynamic_state_management_disable = smu7_disable_dpm_tasks, |
4402 | .request_firmware = smu7_request_firmware, | ||
4403 | .release_firmware = smu7_release_firmware, | ||
4374 | }; | 4404 | }; |
4375 | 4405 | ||
4376 | uint8_t smu7_get_sleep_divider_id_from_clock(uint32_t clock, | 4406 | uint8_t smu7_get_sleep_divider_id_from_clock(uint32_t clock, |