Documentation/driver-api/thermal/cpu-cooling-api.rst

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

File Facts

System
Linux kernel
Corpus path
Documentation/driver-api/thermal/cpu-cooling-api.rst
Extension
.rst
Size
3994 bytes
Lines
108
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

=======================
CPU cooling APIs How To
=======================

Written by Amit Daniel Kachhap <amit.kachhap@linaro.org>

Updated: 6 Jan 2015

Copyright (c)  2012 Samsung Electronics Co., Ltd(http://www.samsung.com)

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

The generic cpu cooling(freq clipping) provides registration/unregistration APIs
to the caller. The binding of the cooling devices to the trip point is left for
the user. The registration APIs returns the cooling device pointer.

1. cpu cooling APIs
===================

1.1 cpufreq registration/unregistration APIs
--------------------------------------------

    ::

	struct thermal_cooling_device
	*cpufreq_cooling_register(struct cpumask *clip_cpus)

    This interface function registers the cpufreq cooling device with the name
    "thermal-cpufreq-%x". This api can support multiple instances of cpufreq
    cooling devices.

   clip_cpus:
	cpumask of cpus where the frequency constraints will happen.

    ::

	struct thermal_cooling_device
	*of_cpufreq_cooling_register(struct cpufreq_policy *policy)

    This interface function registers the cpufreq cooling device with
    the name "thermal-cpufreq-%x" linking it with a device tree node, in
    order to bind it via the thermal DT code. This api can support multiple
    instances of cpufreq cooling devices.

    policy:
	CPUFreq policy.


    ::

	void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)

    This interface function unregisters the "thermal-cpufreq-%x" cooling device.

    cdev: Cooling device pointer which has to be unregistered.

2. Power models
===============

The power API registration functions provide a simple power model for
CPUs.  The current power is calculated as dynamic power (static power isn't
supported currently).  This power model requires that the operating-points of
the CPUs are registered using the kernel's opp library and the
`cpufreq_frequency_table` is assigned to the `struct device` of the
cpu.  If you are using CONFIG_CPUFREQ_DT then the
`cpufreq_frequency_table` should already be assigned to the cpu
device.

The dynamic power consumption of a processor depends on many factors.

Annotation

Implementation Notes