drivers/thermal/intel/int340x_thermal/int3400_thermal.c
Source file repositories/reference/linux-study-clean/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/thermal/intel/int340x_thermal/int3400_thermal.c- Extension
.c- Size
- 17120 bytes
- Lines
- 714
- 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/module.hlinux/platform_device.hlinux/acpi.hlinux/thermal.hacpi_thermal_rel.h
Detected Declarations
struct odvp_attrstruct int3400_thermal_privstruct odvp_attrenum int3400_thermal_uuidfunction imok_storefunction available_uuids_showfunction current_uuid_showfunction int3400_thermal_run_oscfunction set_os_uuid_maskfunction current_uuid_storefunction int3400_thermal_get_uuidsfunction production_mode_showfunction production_mode_initfunction production_mode_exitfunction odvp_showfunction cleanup_odvpfunction evaluate_odvpfunction int3400_notifyfunction int3400_thermal_get_tempfunction int3400_thermal_change_modefunction int3400_setup_gddvfunction int3400_thermal_probefunction int3400_thermal_remove
Annotated Snippet
struct int3400_thermal_priv {
struct acpi_device *adev;
struct platform_device *pdev;
struct thermal_zone_device *thermal;
int art_count;
struct art *arts;
int trt_count;
struct trt *trts;
u32 uuid_bitmap;
int rel_misc_dev_res;
int current_uuid_index;
char *data_vault;
int odvp_count;
int *odvp;
u32 os_uuid_mask;
int production_mode;
struct odvp_attr *odvp_attrs;
};
static int evaluate_odvp(struct int3400_thermal_priv *priv);
struct odvp_attr {
int odvp;
struct int3400_thermal_priv *priv;
struct device_attribute attr;
};
static BIN_ATTR_SIMPLE_RO(data_vault);
static ssize_t imok_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct int3400_thermal_priv *priv = dev_get_drvdata(dev);
acpi_status status;
int input, ret;
ret = kstrtouint(buf, 10, &input);
if (ret)
return ret;
status = acpi_execute_simple_method(priv->adev->handle, "IMOK", input);
if (ACPI_FAILURE(status))
return -EIO;
return count;
}
static DEVICE_ATTR_WO(imok);
static struct attribute *imok_attr[] = {
&dev_attr_imok.attr,
NULL
};
static const struct attribute_group imok_attribute_group = {
.attrs = imok_attr,
};
static ssize_t available_uuids_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct int3400_thermal_priv *priv = dev_get_drvdata(dev);
int i;
int length = 0;
if (!priv->uuid_bitmap)
return sysfs_emit(buf, "UNKNOWN\n");
for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) {
if (priv->uuid_bitmap & (1 << i))
length += sysfs_emit_at(buf, length, "%s\n", int3400_thermal_uuids[i]);
}
return length;
}
static ssize_t current_uuid_show(struct device *dev,
struct device_attribute *devattr, char *buf)
{
struct int3400_thermal_priv *priv = dev_get_drvdata(dev);
int i, length = 0;
if (priv->current_uuid_index >= 0)
return sysfs_emit(buf, "%s\n",
int3400_thermal_uuids[priv->current_uuid_index]);
for (i = 0; i <= INT3400_THERMAL_CRITICAL; i++) {
if (priv->os_uuid_mask & BIT(i))
length += sysfs_emit_at(buf, length, "%s\n", int3400_thermal_uuids[i]);
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/platform_device.h`, `linux/acpi.h`, `linux/thermal.h`, `acpi_thermal_rel.h`.
- Detected declarations: `struct odvp_attr`, `struct int3400_thermal_priv`, `struct odvp_attr`, `enum int3400_thermal_uuid`, `function imok_store`, `function available_uuids_show`, `function current_uuid_show`, `function int3400_thermal_run_osc`, `function set_os_uuid_mask`, `function current_uuid_store`.
- 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.