diff options
Diffstat (limited to 'Documentation/thermal/sysfs-api.txt')
-rw-r--r-- | Documentation/thermal/sysfs-api.txt | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt index ca1a1a34970e..88c02334e356 100644 --- a/Documentation/thermal/sysfs-api.txt +++ b/Documentation/thermal/sysfs-api.txt | |||
@@ -112,6 +112,29 @@ temperature) and throttle appropriate devices. | |||
112 | trip: indicates which trip point the cooling devices is associated with | 112 | trip: indicates which trip point the cooling devices is associated with |
113 | in this thermal zone. | 113 | in this thermal zone. |
114 | 114 | ||
115 | 1.4 Thermal Zone Parameters | ||
116 | 1.4.1 struct thermal_bind_params | ||
117 | This structure defines the following parameters that are used to bind | ||
118 | a zone with a cooling device for a particular trip point. | ||
119 | .cdev: The cooling device pointer | ||
120 | .weight: The 'influence' of a particular cooling device on this zone. | ||
121 | This is on a percentage scale. The sum of all these weights | ||
122 | (for a particular zone) cannot exceed 100. | ||
123 | .trip_mask:This is a bit mask that gives the binding relation between | ||
124 | this thermal zone and cdev, for a particular trip point. | ||
125 | If nth bit is set, then the cdev and thermal zone are bound | ||
126 | for trip point n. | ||
127 | .match: This call back returns success(0) if the 'tz and cdev' need to | ||
128 | be bound, as per platform data. | ||
129 | 1.4.2 struct thermal_zone_params | ||
130 | This structure defines the platform level parameters for a thermal zone. | ||
131 | This data, for each thermal zone should come from the platform layer. | ||
132 | This is an optional feature where some platforms can choose not to | ||
133 | provide this data. | ||
134 | .governor_name: Name of the thermal governor used for this zone | ||
135 | .num_tbps: Number of thermal_bind_params entries for this zone | ||
136 | .tbp: thermal_bind_params entries | ||
137 | |||
115 | 2. sysfs attributes structure | 138 | 2. sysfs attributes structure |
116 | 139 | ||
117 | RO read only value | 140 | RO read only value |
@@ -126,6 +149,7 @@ Thermal zone device sys I/F, created once it's registered: | |||
126 | |---type: Type of the thermal zone | 149 | |---type: Type of the thermal zone |
127 | |---temp: Current temperature | 150 | |---temp: Current temperature |
128 | |---mode: Working mode of the thermal zone | 151 | |---mode: Working mode of the thermal zone |
152 | |---policy: Thermal governor used for this zone | ||
129 | |---trip_point_[0-*]_temp: Trip point temperature | 153 | |---trip_point_[0-*]_temp: Trip point temperature |
130 | |---trip_point_[0-*]_type: Trip point type | 154 | |---trip_point_[0-*]_type: Trip point type |
131 | |---trip_point_[0-*]_hyst: Hysteresis value for this trip point | 155 | |---trip_point_[0-*]_hyst: Hysteresis value for this trip point |
@@ -187,6 +211,10 @@ mode | |||
187 | charge of the thermal management. | 211 | charge of the thermal management. |
188 | RW, Optional | 212 | RW, Optional |
189 | 213 | ||
214 | policy | ||
215 | One of the various thermal governors used for a particular zone. | ||
216 | RW, Required | ||
217 | |||
190 | trip_point_[0-*]_temp | 218 | trip_point_[0-*]_temp |
191 | The temperature above which trip point will be fired. | 219 | The temperature above which trip point will be fired. |
192 | Unit: millidegree Celsius | 220 | Unit: millidegree Celsius |
@@ -264,6 +292,7 @@ method, the sys I/F structure will be built like this: | |||
264 | |---type: acpitz | 292 | |---type: acpitz |
265 | |---temp: 37000 | 293 | |---temp: 37000 |
266 | |---mode: enabled | 294 | |---mode: enabled |
295 | |---policy: step_wise | ||
267 | |---trip_point_0_temp: 100000 | 296 | |---trip_point_0_temp: 100000 |
268 | |---trip_point_0_type: critical | 297 | |---trip_point_0_type: critical |
269 | |---trip_point_1_temp: 80000 | 298 | |---trip_point_1_temp: 80000 |
@@ -305,3 +334,38 @@ to a thermal_zone_device when it registers itself with the framework. The | |||
305 | event will be one of:{THERMAL_AUX0, THERMAL_AUX1, THERMAL_CRITICAL, | 334 | event will be one of:{THERMAL_AUX0, THERMAL_AUX1, THERMAL_CRITICAL, |
306 | THERMAL_DEV_FAULT}. Notification can be sent when the current temperature | 335 | THERMAL_DEV_FAULT}. Notification can be sent when the current temperature |
307 | crosses any of the configured thresholds. | 336 | crosses any of the configured thresholds. |
337 | |||
338 | 5. Export Symbol APIs: | ||
339 | |||
340 | 5.1: get_tz_trend: | ||
341 | This function returns the trend of a thermal zone, i.e the rate of change | ||
342 | of temperature of the thermal zone. Ideally, the thermal sensor drivers | ||
343 | are supposed to implement the callback. If they don't, the thermal | ||
344 | framework calculated the trend by comparing the previous and the current | ||
345 | temperature values. | ||
346 | |||
347 | 5.2:get_thermal_instance: | ||
348 | This function returns the thermal_instance corresponding to a given | ||
349 | {thermal_zone, cooling_device, trip_point} combination. Returns NULL | ||
350 | if such an instance does not exist. | ||
351 | |||
352 | 5.3:notify_thermal_framework: | ||
353 | This function handles the trip events from sensor drivers. It starts | ||
354 | throttling the cooling devices according to the policy configured. | ||
355 | For CRITICAL and HOT trip points, this notifies the respective drivers, | ||
356 | and does actual throttling for other trip points i.e ACTIVE and PASSIVE. | ||
357 | The throttling policy is based on the configured platform data; if no | ||
358 | platform data is provided, this uses the step_wise throttling policy. | ||
359 | |||
360 | 5.4:thermal_cdev_update: | ||
361 | This function serves as an arbitrator to set the state of a cooling | ||
362 | device. It sets the cooling device to the deepest cooling state if | ||
363 | possible. | ||
364 | |||
365 | 5.5:thermal_register_governor: | ||
366 | This function lets the various thermal governors to register themselves | ||
367 | with the Thermal framework. At run time, depending on a zone's platform | ||
368 | data, a particular governor is used for throttling. | ||
369 | |||
370 | 5.6:thermal_unregister_governor: | ||
371 | This function unregisters a governor from the thermal framework. | ||