drivers/thermal/gov_bang_bang.c
Source file repositories/reference/linux-study-clean/drivers/thermal/gov_bang_bang.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/thermal/gov_bang_bang.c- Extension
.c- Size
- 3938 bytes
- Lines
- 130
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/thermal.hthermal_core.h
Detected Declarations
function Copyrightfunction bang_bang_trip_crossedfunction bang_bang_managefunction for_each_trip_descfunction list_for_each_entryfunction bang_bang_update_tz
Annotated Snippet
list_for_each_entry(instance, &td->thermal_instances, trip_node) {
if (!instance->initialized)
bang_bang_set_instance_target(instance, turn_on);
}
}
tz->governor_data = (void *)true;
}
static void bang_bang_update_tz(struct thermal_zone_device *tz,
enum thermal_notify_event reason)
{
/*
* Let bang_bang_manage() know that it needs to walk trips after binding
* a new cdev and after system resume.
*/
if (reason == THERMAL_TZ_BIND_CDEV || reason == THERMAL_TZ_RESUME)
tz->governor_data = NULL;
}
static struct thermal_governor thermal_gov_bang_bang = {
.name = "bang_bang",
.trip_crossed = bang_bang_trip_crossed,
.manage = bang_bang_manage,
.update_tz = bang_bang_update_tz,
};
THERMAL_GOVERNOR_DECLARE(thermal_gov_bang_bang);
Annotation
- Immediate include surface: `linux/thermal.h`, `thermal_core.h`.
- Detected declarations: `function Copyright`, `function bang_bang_trip_crossed`, `function bang_bang_manage`, `function for_each_trip_desc`, `function list_for_each_entry`, `function bang_bang_update_tz`.
- 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.