drivers/thermal/intel/int340x_thermal/int3401_thermal.c
Source file repositories/reference/linux-study-clean/drivers/thermal/intel/int340x_thermal/int3401_thermal.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/thermal/intel/int340x_thermal/int3401_thermal.c- Extension
.c- Size
- 1765 bytes
- Lines
- 76
- Domain
- Driver Families
- Bucket
- drivers/thermal
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/kernel.hlinux/module.hlinux/platform_device.hlinux/thermal.hint340x_thermal_zone.hprocessor_thermal_device.h
Detected Declarations
function int3401_addfunction int3401_removefunction int3401_thermal_suspendfunction int3401_thermal_resume
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* INT3401 processor thermal device
* Copyright (c) 2020, Intel Corporation.
*/
#include <linux/acpi.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/thermal.h>
#include "int340x_thermal_zone.h"
#include "processor_thermal_device.h"
static const struct acpi_device_id int3401_device_ids[] = {
{"INT3401", 0},
{"", 0},
};
MODULE_DEVICE_TABLE(acpi, int3401_device_ids);
static int int3401_add(struct platform_device *pdev)
{
struct proc_thermal_device *proc_priv;
int ret;
proc_priv = devm_kzalloc(&pdev->dev, sizeof(*proc_priv), GFP_KERNEL);
if (!proc_priv)
return -ENOMEM;
ret = proc_thermal_add(&pdev->dev, proc_priv);
if (ret)
return ret;
platform_set_drvdata(pdev, proc_priv);
return ret;
}
static void int3401_remove(struct platform_device *pdev)
{
proc_thermal_remove(platform_get_drvdata(pdev));
}
#ifdef CONFIG_PM_SLEEP
static int int3401_thermal_suspend(struct device *dev)
{
return proc_thermal_suspend(dev);
}
static int int3401_thermal_resume(struct device *dev)
{
return proc_thermal_resume(dev);
}
#else
#define int3401_thermal_suspend NULL
#define int3401_thermal_resume NULL
#endif
static SIMPLE_DEV_PM_OPS(int3401_proc_thermal_pm, int3401_thermal_suspend,
int3401_thermal_resume);
static struct platform_driver int3401_driver = {
.probe = int3401_add,
.remove = int3401_remove,
.driver = {
.name = "int3401 thermal",
.acpi_match_table = int3401_device_ids,
.pm = &int3401_proc_thermal_pm,
},
};
module_platform_driver(int3401_driver);
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/kernel.h`, `linux/module.h`, `linux/platform_device.h`, `linux/thermal.h`, `int340x_thermal_zone.h`, `processor_thermal_device.h`.
- Detected declarations: `function int3401_add`, `function int3401_remove`, `function int3401_thermal_suspend`, `function int3401_thermal_resume`.
- Atlas domain: Driver Families / drivers/thermal.
- 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.