drm/amdgpu/pp: remove the get_temperature API
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Jan 2018 22:44:48 +0000 (17:44 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Feb 2018 19:18:51 +0000 (14:18 -0500)
This is also supported with the read_sensor API and there
were no more users of the get_temperature API.

Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
drivers/gpu/drm/amd/amdgpu/ci_dpm.c
drivers/gpu/drm/amd/amdgpu/kv_dpm.c
drivers/gpu/drm/amd/amdgpu/si_dpm.c
drivers/gpu/drm/amd/include/kgd_pp_interface.h
drivers/gpu/drm/amd/powerplay/amd_powerplay.c
drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h

index 4b5755e..c489c69 100644 (file)
@@ -265,9 +265,6 @@ enum amdgpu_pcie_gen {
 #define amdgpu_dpm_read_sensor(adev, idx, value, size) \
                ((adev)->powerplay.pp_funcs->read_sensor((adev)->powerplay.pp_handle, (idx), (value), (size)))
 
-#define amdgpu_dpm_get_temperature(adev) \
-               ((adev)->powerplay.pp_funcs->get_temperature((adev)->powerplay.pp_handle))
-
 #define amdgpu_dpm_set_fan_control_mode(adev, m) \
                ((adev)->powerplay.pp_funcs->set_fan_control_mode((adev)->powerplay.pp_handle, (m)))
 
index 659467a..6c53c6b 100644 (file)
@@ -1620,9 +1620,6 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev)
        if (adev->pm.dpm_enabled == 0)
                return 0;
 
-       if (adev->powerplay.pp_funcs->get_temperature == NULL)
-               return 0;
-
        adev->pm.int_hwmon_dev = hwmon_device_register_with_groups(adev->dev,
                                                                   DRIVER_NAME, adev,
                                                                   hwmon_groups);
index ab45232..5ceb5a2 100644 (file)
@@ -7029,7 +7029,6 @@ const struct amd_ip_funcs ci_dpm_ip_funcs = {
 };
 
 const struct amd_pm_funcs ci_dpm_funcs = {
-       .get_temperature = &ci_dpm_get_temp,
        .pre_set_power_state = &ci_dpm_pre_set_power_state,
        .set_power_state = &ci_dpm_set_power_state,
        .post_set_power_state = &ci_dpm_post_set_power_state,
index d9e9e52..8766681 100644 (file)
@@ -3319,7 +3319,6 @@ const struct amd_ip_funcs kv_dpm_ip_funcs = {
 };
 
 const struct amd_pm_funcs kv_dpm_funcs = {
-       .get_temperature = &kv_dpm_get_temp,
        .pre_set_power_state = &kv_dpm_pre_set_power_state,
        .set_power_state = &kv_dpm_set_power_state,
        .post_set_power_state = &kv_dpm_post_set_power_state,
index 9d57115..8138053 100644 (file)
@@ -8056,7 +8056,6 @@ const struct amd_ip_funcs si_dpm_ip_funcs = {
 };
 
 const struct amd_pm_funcs si_dpm_funcs = {
-       .get_temperature = &si_dpm_get_temp,
        .pre_set_power_state = &si_dpm_pre_set_power_state,
        .set_power_state = &si_dpm_set_power_state,
        .post_set_power_state = &si_dpm_post_set_power_state,
index b9aa9f4..1fc995b 100644 (file)
@@ -241,7 +241,6 @@ struct amd_pm_funcs {
                                void  *rps,
                                bool  *equal);
 /* export for sysfs */
-       int (*get_temperature)(void *handle);
        void (*set_fan_control_mode)(void *handle, u32 mode);
        u32 (*get_fan_control_mode)(void *handle);
        int (*set_fan_speed_percent)(void *handle, u32 speed);
index 854c43c..173382c 100644 (file)
@@ -687,29 +687,6 @@ static int pp_dpm_get_fan_speed_rpm(void *handle, uint32_t *rpm)
        return ret;
 }
 
-static int pp_dpm_get_temperature(void *handle)
-{
-       struct pp_hwmgr  *hwmgr;
-       struct pp_instance *pp_handle = (struct pp_instance *)handle;
-       int ret = 0;
-
-       ret = pp_check(pp_handle);
-
-       if (ret)
-               return ret;
-
-       hwmgr = pp_handle->hwmgr;
-
-       if (hwmgr->hwmgr_func->get_temperature == NULL) {
-               pr_info("%s was not implemented.\n", __func__);
-               return 0;
-       }
-       mutex_lock(&pp_handle->pp_lock);
-       ret = hwmgr->hwmgr_func->get_temperature(hwmgr);
-       mutex_unlock(&pp_handle->pp_lock);
-       return ret;
-}
-
 static int pp_dpm_get_pp_num_states(void *handle,
                struct pp_states_info *data)
 {
@@ -1492,7 +1469,6 @@ static int pp_get_display_mode_validation_clocks(void *handle,
 }
 
 const struct amd_pm_funcs pp_dpm_funcs = {
-       .get_temperature = pp_dpm_get_temperature,
        .load_firmware = pp_dpm_load_fw,
        .wait_for_fw_loading_complete = pp_dpm_fw_loading_complete,
        .force_performance_level = pp_dpm_force_performance_level,
index dec8dd9..1394b2b 100644 (file)
@@ -1907,7 +1907,6 @@ static const struct pp_hwmgr_func cz_hwmgr_funcs = {
        .get_current_shallow_sleep_clocks = cz_get_current_shallow_sleep_clocks,
        .get_clock_by_type = cz_get_clock_by_type,
        .get_max_high_clocks = cz_get_max_high_clocks,
-       .get_temperature = cz_thermal_get_temperature,
        .read_sensor = cz_read_sensor,
        .power_off_asic = cz_power_off_asic,
        .asic_setup = cz_setup_asic_task,
index f6236f9..21b9fa2 100644 (file)
@@ -4958,7 +4958,6 @@ static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
        .display_config_changed = smu7_display_configuration_changed_task,
        .set_max_fan_pwm_output = smu7_set_max_fan_pwm_output,
        .set_max_fan_rpm_output = smu7_set_max_fan_rpm_output,
-       .get_temperature = smu7_thermal_get_temperature,
        .stop_thermal_controller = smu7_thermal_stop_thermal_controller,
        .get_fan_speed_info = smu7_fan_ctrl_get_fan_speed_info,
        .get_fan_speed_percent = smu7_fan_ctrl_get_fan_speed_percent,
index 308dc8f..87f0660 100644 (file)
@@ -5120,7 +5120,6 @@ static const struct pp_hwmgr_func vega10_hwmgr_funcs = {
        .notify_smc_display_config_after_ps_adjustment =
                        vega10_notify_smc_display_config_after_ps_adjustment,
        .force_dpm_level = vega10_dpm_force_dpm_level,
-       .get_temperature = vega10_thermal_get_temperature,
        .stop_thermal_controller = vega10_thermal_stop_thermal_controller,
        .get_fan_speed_info = vega10_fan_ctrl_get_fan_speed_info,
        .get_fan_speed_percent = vega10_fan_ctrl_get_fan_speed_percent,
index 604a7cb..5512dc2 100644 (file)
@@ -279,7 +279,6 @@ struct pp_hwmgr_func {
                                                const uint32_t *msg_id);
        int (*set_max_fan_rpm_output)(struct pp_hwmgr *hwmgr, uint16_t us_max_fan_pwm);
        int (*set_max_fan_pwm_output)(struct pp_hwmgr *hwmgr, uint16_t us_max_fan_pwm);
-       int (*get_temperature)(struct pp_hwmgr *hwmgr);
        int (*stop_thermal_controller)(struct pp_hwmgr *hwmgr);
        int (*get_fan_speed_info)(struct pp_hwmgr *hwmgr, struct phm_fan_speed_info *fan_speed_info);
        void (*set_fan_control_mode)(struct pp_hwmgr *hwmgr, uint32_t mode);