drivers/accel/amdxdna/aie2_pm.c
Source file repositories/reference/linux-study-clean/drivers/accel/amdxdna/aie2_pm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/accel/amdxdna/aie2_pm.c- Extension
.c- Size
- 2742 bytes
- Lines
- 135
- Domain
- Driver Families
- Bucket
- drivers/accel
- 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
drm/amdxdna_accel.hdrm/drm_device.hdrm/drm_print.hdrm/gpu_scheduler.haie2_pci.hamdxdna_pci_drv.hamdxdna_pm.h
Detected Declarations
function Copyrightfunction aie2_pm_set_dpmfunction aie2_pm_initfunction aie2_pm_set_mode
Annotated Snippet
if (ndev->hwctx_num) {
XDNA_ERR(xdna, "Can not set turbo when there is active hwctx");
return -EINVAL;
}
clk_gating = AIE2_CLK_GATING_DISABLE;
dpm_level = ndev->max_dpm_level;
break;
case POWER_MODE_HIGH:
clk_gating = AIE2_CLK_GATING_ENABLE;
dpm_level = ndev->max_dpm_level;
break;
case POWER_MODE_DEFAULT:
clk_gating = AIE2_CLK_GATING_ENABLE;
dpm_level = ndev->dft_dpm_level;
break;
case POWER_MODE_LOW:
clk_gating = AIE2_CLK_GATING_ENABLE;
dpm_level = 0;
break;
case POWER_MODE_MEDIUM:
clk_gating = AIE2_CLK_GATING_ENABLE;
dpm_level = ndev->max_dpm_level / 2;
break;
default:
return -EOPNOTSUPP;
}
ret = aie2_pm_set_dpm(ndev, dpm_level);
if (ret)
return ret;
ret = aie2_pm_set_clk_gating(ndev, clk_gating);
if (ret)
return ret;
ndev->pw_mode = target;
return 0;
}
Annotation
- Immediate include surface: `drm/amdxdna_accel.h`, `drm/drm_device.h`, `drm/drm_print.h`, `drm/gpu_scheduler.h`, `aie2_pci.h`, `amdxdna_pci_drv.h`, `amdxdna_pm.h`.
- Detected declarations: `function Copyright`, `function aie2_pm_set_dpm`, `function aie2_pm_init`, `function aie2_pm_set_mode`.
- Atlas domain: Driver Families / drivers/accel.
- 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.