Documentation/driver-api/thermal/sysfs-api.rst

Source file repositories/reference/linux-study-clean/Documentation/driver-api/thermal/sysfs-api.rst

File Facts

System
Linux kernel
Corpus path
Documentation/driver-api/thermal/sysfs-api.rst
Extension
.rst
Size
15446 bytes
Lines
434
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

===================================
Generic Thermal Sysfs driver How To
===================================

Written by Sujith Thomas <sujith.thomas@intel.com>, Zhang Rui <rui.zhang@intel.com>

Copyright (c)  2008 Intel Corporation


0. Introduction
===============

The generic thermal sysfs provides a set of interfaces for thermal zone
devices (sensors) and thermal cooling devices (fan, processor...) to register
with the thermal management solution and to be a part of it.

This how-to focuses on enabling new thermal zone and cooling devices to
participate in thermal management.
This solution is platform independent and any type of thermal zone devices
and cooling devices should be able to make use of the infrastructure.

The main task of the thermal sysfs driver is to expose thermal zone attributes
as well as cooling device attributes to the user space.
An intelligent thermal management application can make decisions based on
inputs from thermal zone attributes (the current temperature and trip point
temperature) and throttle appropriate devices.

- `[0-*]`	denotes any positive number starting from 0
- `[1-*]`	denotes any positive number starting from 1

1. thermal sysfs driver interface functions
===========================================

1.1 thermal zone device interface
---------------------------------

    ::

	struct thermal_zone_device *
	thermal_zone_device_register_with_trips(const char *type,
					const struct thermal_trip *trips,
					int num_trips, void *devdata,
					const struct thermal_zone_device_ops *ops,
					const struct thermal_zone_params *tzp,
					unsigned int passive_delay,
					unsigned int polling_delay)

    This interface function adds a new thermal zone device (sensor) to the
    /sys/class/thermal folder as `thermal_zone[0-*]`. It tries to bind all the
    thermal cooling devices registered to it at the same time.

    type:
	the thermal zone type.
    trips:
	the table of trip points for this thermal zone.
    devdata:
	device private data
    ops:
	thermal zone device call-backs.

	.should_bind:
		check whether or not a given cooling device should be bound to
		a given trip point in this thermal zone.
	.get_temp:
		get the current temperature of the thermal zone.
	.set_trips:
		set the trip points window. Whenever the current temperature
		is updated, the trip points immediately below and above the
		current temperature are found.
	.change_mode:

Annotation

Implementation Notes