drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
Source file repositories/reference/linux-study-clean/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c- Extension
.c- Size
- 12841 bytes
- Lines
- 497
- Domain
- Driver Families
- Bucket
- drivers/thermal
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/intel_tcc.hlinux/kernel.hlinux/module.hlinux/pci.hlinux/sysfs.hlinux/thermal.hasm/msr.hint340x_thermal_zone.hprocessor_thermal_device.h../intel_soc_dts_iosf.h
Detected Declarations
function power_floor_status_showfunction power_floor_enable_showfunction power_floor_enable_storefunction power_limit_attr_visiblefunction tcc_offset_degree_celsius_showfunction tcc_offset_degree_celsius_storefunction proc_thermal_get_zone_tempfunction for_each_online_cpufunction proc_thermal_read_ppccfunction proc_thermal_notifyfunction proc_thermal_addfunction proc_thermal_removefunction proc_thermal_suspendfunction proc_thermal_resumefunction proc_thermal_set_mmio_basefunction proc_thermal_mmio_addfunction proc_thermal_mmio_removeexport proc_thermal_addexport proc_thermal_removeexport proc_thermal_suspendexport proc_thermal_resumeexport proc_thermal_mmio_addexport proc_thermal_mmio_remove
Annotated Snippet
if (ret) {
dev_err(&pdev->dev, "failed to add RAPL MMIO interface\n");
return ret;
}
}
if (feature_mask & PROC_THERMAL_FEATURE_PTC) {
ret = proc_thermal_ptc_add(pdev, proc_priv);
if (ret) {
dev_err(&pdev->dev, "failed to add PTC MMIO interface\n");
goto err_rem_rapl;
}
}
if (feature_mask & PROC_THERMAL_FEATURE_FIVR ||
feature_mask & PROC_THERMAL_FEATURE_DVFS ||
feature_mask & PROC_THERMAL_FEATURE_DLVR) {
ret = proc_thermal_rfim_add(pdev, proc_priv);
if (ret) {
dev_err(&pdev->dev, "failed to add RFIM interface\n");
goto err_rem_ptc;
}
}
if (feature_mask & PROC_THERMAL_FEATURE_WT_REQ) {
ret = proc_thermal_wt_req_add(pdev, proc_priv);
if (ret) {
dev_err(&pdev->dev, "failed to add MBOX interface\n");
goto err_rem_rfim;
}
} else if (feature_mask & PROC_THERMAL_FEATURE_WT_HINT) {
ret = proc_thermal_wt_hint_add(pdev, proc_priv);
if (ret) {
dev_err(&pdev->dev, "failed to add WT Hint\n");
goto err_rem_rfim;
}
}
if (feature_mask & PROC_THERMAL_FEATURE_SOC_POWER_SLIDER) {
ret = proc_thermal_soc_power_slider_add(pdev, proc_priv);
if (ret) {
dev_info(&pdev->dev, "failed to add soc power efficiency slider\n");
goto err_rem_wlt;
}
}
return 0;
err_rem_wlt:
proc_thermal_wt_hint_remove(pdev);
err_rem_rfim:
proc_thermal_rfim_remove(pdev);
err_rem_ptc:
proc_thermal_ptc_remove(pdev);
err_rem_rapl:
proc_thermal_rapl_remove();
return ret;
}
EXPORT_SYMBOL_GPL(proc_thermal_mmio_add);
void proc_thermal_mmio_remove(struct pci_dev *pdev, struct proc_thermal_device *proc_priv)
{
if (proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_RAPL)
proc_thermal_rapl_remove();
if (proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_PTC)
proc_thermal_ptc_remove(pdev);
if (proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_FIVR ||
proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_DVFS ||
proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_DLVR)
proc_thermal_rfim_remove(pdev);
if (proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_POWER_FLOOR)
proc_thermal_power_floor_set_state(proc_priv, false);
if (proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_WT_REQ)
proc_thermal_wt_req_remove(pdev);
else if (proc_priv->mmio_feature_mask & PROC_THERMAL_FEATURE_WT_HINT)
proc_thermal_wt_hint_remove(pdev);
}
EXPORT_SYMBOL_GPL(proc_thermal_mmio_remove);
MODULE_IMPORT_NS("INTEL_TCC");
MODULE_IMPORT_NS("INT340X_THERMAL");
MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
MODULE_DESCRIPTION("Processor Thermal Reporting Device Driver");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/intel_tcc.h`, `linux/kernel.h`, `linux/module.h`, `linux/pci.h`, `linux/sysfs.h`, `linux/thermal.h`, `asm/msr.h`.
- Detected declarations: `function power_floor_status_show`, `function power_floor_enable_show`, `function power_floor_enable_store`, `function power_limit_attr_visible`, `function tcc_offset_degree_celsius_show`, `function tcc_offset_degree_celsius_store`, `function proc_thermal_get_zone_temp`, `function for_each_online_cpu`, `function proc_thermal_read_ppcc`, `function proc_thermal_notify`.
- Atlas domain: Driver Families / drivers/thermal.
- Implementation status: integration 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.