mwifiex: wait for firmware
[cascardo/linux.git] / Documentation / thermal / cpu-cooling-api.txt
1 CPU cooling APIs How To
2 ===================================
3
4 Written by Amit Daniel Kachhap <amit.kachhap@linaro.org>
5
6 Updated: 12 May 2012
7
8 Copyright (c)  2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
9
10 0. Introduction
11
12 The generic cpu cooling(freq clipping, cpuhotplug etc) provides
13 registration/unregistration APIs to the caller. The binding of the cooling
14 devices to the trip point is left for the user. The registration APIs returns
15 the cooling device pointer.
16
17 1. cpu cooling APIs
18
19 1.1 cpufreq registration/unregistration APIs
20 1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
21         struct freq_clip_table *tab_ptr, unsigned int tab_size)
22
23     This interface function registers the cpufreq cooling device with the name
24     "thermal-cpufreq-%x". This api can support multiple instances of cpufreq
25     cooling devices.
26
27     tab_ptr: The table containing the maximum value of frequency to be clipped
28     for each cooling state.
29         .freq_clip_max: Value of frequency to be clipped for each allowed
30          cpus.
31         .temp_level: Temperature level at which the frequency clamping will
32         happen.
33         .mask_val: cpumask of the allowed cpu's
34     tab_size: the total number of cpufreq cooling states.
35
36 1.1.2 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
37
38     This interface function unregisters the "thermal-cpufreq-%x" cooling device.
39
40     cdev: Cooling device pointer which has to be unregistered.
41
42
43 1.2 CPU cooling action notifier register/unregister interface
44 1.2.1 int cputherm_register_notifier(struct notifier_block *nb,
45         unsigned int list)
46
47     This interface registers a driver with cpu cooling layer. The driver will
48     be notified when any cpu cooling action is called.
49
50     nb: notifier function to register
51     list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP
52
53 1.2.2 int cputherm_unregister_notifier(struct notifier_block *nb,
54         unsigned int list)
55
56     This interface registers a driver with cpu cooling layer. The driver will
57     be notified when any cpu cooling action is called.
58
59     nb: notifier function to register
60     list: CPUFREQ_COOLING_START or CPUFREQ_COOLING_STOP