drivers/thermal/intel/intel_soc_dts_iosf.c

Source file repositories/reference/linux-study-clean/drivers/thermal/intel/intel_soc_dts_iosf.c

File Facts

System
Linux kernel
Corpus path
drivers/thermal/intel/intel_soc_dts_iosf.c
Extension
.c
Size
9972 bytes
Lines
394
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (critical_trip) {
			temp = sensors->tj_max - crit_offset;
			set_trip(&trips[i][1], THERMAL_TRIP_CRITICAL, 0, temp, 1);
		} else {
			set_trip(&trips[i][1], THERMAL_TRIP_PASSIVE,
				 THERMAL_TRIP_FLAG_RW_TEMP, 0, 1);
			temp = 0;
		}

		ret = update_trip_temp(sensors, 1, temp);
		if (ret)
			goto err_reset_trips;
	}

	for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) {
		ret = add_dts_thermal_zone(i, &sensors->soc_dts[i], trips[i]);
		if (ret)
			goto err_remove_zone;
	}

	return sensors;

err_remove_zone:
	for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i)
		remove_dts_thermal_zone(&sensors->soc_dts[i]);

err_reset_trips:
	for (i = 0; i < SOC_MAX_DTS_SENSORS; i++)
		dts_trips_reset(sensors, i);

	kfree(sensors);
	return ERR_PTR(ret);
}
EXPORT_SYMBOL_GPL(intel_soc_dts_iosf_init);

void intel_soc_dts_iosf_exit(struct intel_soc_dts_sensors *sensors)
{
	int i;

	for (i = 0; i < SOC_MAX_DTS_SENSORS; ++i) {
		remove_dts_thermal_zone(&sensors->soc_dts[i]);
		dts_trips_reset(sensors, i);
	}
	kfree(sensors);
}
EXPORT_SYMBOL_GPL(intel_soc_dts_iosf_exit);

MODULE_IMPORT_NS("INTEL_TCC");
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("SoC DTS driver using side band interface");

Annotation

Implementation Notes