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.

Dependency Surface

Detected Declarations

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

Implementation Notes