drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_thermal.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_thermal.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_thermal.c- Extension
.c- Size
- 9319 bytes
- Lines
- 311
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
vega12_thermal.hvega12_hwmgr.hvega12_smumgr.hvega12_ppsmc.hvega12_inc.hsoc15_common.hpp_debug.h
Detected Declarations
function filesfunction vega12_fan_ctrl_get_fan_speed_infofunction vega12_fan_ctrl_get_fan_speed_rpmfunction vega12_enable_fan_control_featurefunction vega12_disable_fan_control_featurefunction vega12_fan_ctrl_start_smc_fan_controlfunction vega12_fan_ctrl_stop_smc_fan_controlfunction vega12_fan_ctrl_reset_fan_speed_to_defaultfunction vega12_thermal_get_temperaturefunction vega12_thermal_set_temperature_rangefunction vega12_thermal_enable_alertfunction vega12_thermal_disable_alertfunction vega12_thermal_stop_thermal_controllerfunction vega12_thermal_setup_fan_tablefunction vega12_thermal_start_smc_fan_controlfunction vega12_start_thermal_controller
Annotated Snippet
#include "vega12_thermal.h"
#include "vega12_hwmgr.h"
#include "vega12_smumgr.h"
#include "vega12_ppsmc.h"
#include "vega12_inc.h"
#include "soc15_common.h"
#include "pp_debug.h"
static int vega12_get_current_rpm(struct pp_hwmgr *hwmgr, uint32_t *current_rpm)
{
PP_ASSERT_WITH_CODE(!smum_send_msg_to_smc(hwmgr,
PPSMC_MSG_GetCurrentRpm,
current_rpm),
"Attempt to get current RPM from SMC Failed!",
return -EINVAL);
return 0;
}
int vega12_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr,
struct phm_fan_speed_info *fan_speed_info)
{
memset(fan_speed_info, 0, sizeof(*fan_speed_info));
fan_speed_info->supports_percent_read = false;
fan_speed_info->supports_percent_write = false;
fan_speed_info->supports_rpm_read = true;
fan_speed_info->supports_rpm_write = true;
return 0;
}
int vega12_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t *speed)
{
*speed = 0;
return vega12_get_current_rpm(hwmgr, speed);
}
/**
* vega12_enable_fan_control_feature -Enables the SMC Fan Control Feature.
*
* @hwmgr: the address of the powerplay hardware manager.
* Return: 0 on success. -1 otherwise.
*/
static int vega12_enable_fan_control_feature(struct pp_hwmgr *hwmgr)
{
#if 0
struct vega12_hwmgr *data = (struct vega12_hwmgr *)(hwmgr->backend);
if (data->smu_features[GNLD_FAN_CONTROL].supported) {
PP_ASSERT_WITH_CODE(!vega12_enable_smc_features(
hwmgr, true,
data->smu_features[GNLD_FAN_CONTROL].
smu_feature_bitmap),
"Attempt to Enable FAN CONTROL feature Failed!",
return -1);
data->smu_features[GNLD_FAN_CONTROL].enabled = true;
}
#endif
return 0;
}
static int vega12_disable_fan_control_feature(struct pp_hwmgr *hwmgr)
{
#if 0
struct vega12_hwmgr *data = (struct vega12_hwmgr *)(hwmgr->backend);
if (data->smu_features[GNLD_FAN_CONTROL].supported) {
PP_ASSERT_WITH_CODE(!vega12_enable_smc_features(
hwmgr, false,
data->smu_features[GNLD_FAN_CONTROL].
smu_feature_bitmap),
"Attempt to Enable FAN CONTROL feature Failed!",
return -1);
data->smu_features[GNLD_FAN_CONTROL].enabled = false;
}
#endif
return 0;
}
int vega12_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr)
{
struct vega12_hwmgr *data = (struct vega12_hwmgr *)(hwmgr->backend);
if (data->smu_features[GNLD_FAN_CONTROL].supported)
PP_ASSERT_WITH_CODE(
!vega12_enable_fan_control_feature(hwmgr),
"Attempt to Enable SMC FAN CONTROL Feature Failed!",
return -1);
Annotation
- Immediate include surface: `vega12_thermal.h`, `vega12_hwmgr.h`, `vega12_smumgr.h`, `vega12_ppsmc.h`, `vega12_inc.h`, `soc15_common.h`, `pp_debug.h`.
- Detected declarations: `function files`, `function vega12_fan_ctrl_get_fan_speed_info`, `function vega12_fan_ctrl_get_fan_speed_rpm`, `function vega12_enable_fan_control_feature`, `function vega12_disable_fan_control_feature`, `function vega12_fan_ctrl_start_smc_fan_control`, `function vega12_fan_ctrl_stop_smc_fan_control`, `function vega12_fan_ctrl_reset_fan_speed_to_default`, `function vega12_thermal_get_temperature`, `function vega12_thermal_set_temperature_range`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.