[Bluetooth] Add support for TIOCOUTQ and TIOCINQ ioctls
[pandora-kernel.git] / Documentation / thermal / sysfs-api.txt
index 5776e09..70d68ce 100644 (file)
@@ -14,7 +14,7 @@ The generic thermal sysfs provides a set of interfaces for thermal zone devices
 and thermal cooling devices (fan, processor...) to register with the thermal management
 solution and to be a part of it.
 
-This how-to focusses on enabling new thermal zone and cooling devices to participate
+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.
@@ -41,9 +41,9 @@ and throttle appropriate devices.
        name: the thermal zone name.
        trips: the total number of trip points this thermal zone supports.
        devdata: device private data
-       ops: thermal zone device callbacks.
+       ops: thermal zone device call-backs.
                .bind: bind the thermal zone device with a thermal cooling device.
-               .unbind: unbing the thermal zone device with a thermal cooling device.
+               .unbind: unbind the thermal zone device with a thermal cooling device.
                .get_temp: get the current temperature of the thermal zone.
                .get_mode: get the current mode (user/kernel) of the thermal zone.
                           "kernel" means thermal management is done in kernel.
@@ -69,7 +69,7 @@ and throttle appropriate devices.
        It tries to bind itself to all the thermal zone devices register at the same time.
        name: the cooling device name.
        devdata: device private data.
-       ops: thermal cooling devices callbacks.
+       ops: thermal cooling devices call-backs.
                .get_max_state: get the Maximum throttle state of the cooling device.
                .get_cur_state: get the Current throttle state of the cooling device.
                .set_cur_state: set the Current throttle state of the cooling device.
@@ -108,11 +108,12 @@ and throttle appropriate devices.
 RO     read only value
 RW     read/write value
 
-All thermal sysfs attributes will be represented under /sys/class/thermal
-/sys/class/thermal/
+Thermal sysfs attributes will be represented under /sys/class/thermal.
+Hwmon sysfs I/F extension is also available under /sys/class/hwmon
+if hwmon is compiled in or built as a module.
 
 Thermal zone device sys I/F, created once it's registered:
-|thermal_zone[0-*]:
+/sys/class/thermal/thermal_zone[0-*]:
        |-----type:                     Type of the thermal zone
        |-----temp:                     Current temperature
        |-----mode:                     Working mode of the thermal zone
@@ -120,7 +121,7 @@ Thermal zone device sys I/F, created once it's registered:
        |-----trip_point_[0-*]_type:    Trip point type
 
 Thermal cooling device sys I/F, created once it's registered:
-|cooling_device[0-*]:
+/sys/class/thermal/cooling_device[0-*]:
        |-----type :                    Type of the cooling device(processor/fan/...)
        |-----max_state:                Maximum cooling state of the cooling device
        |-----cur_state:                Current cooling state of the cooling device
@@ -129,12 +130,21 @@ Thermal cooling device sys I/F, created once it's registered:
 These two dynamic attributes are created/removed in pairs.
 They represent the relationship between a thermal zone and its associated cooling device.
 They are created/removed for each
-thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful exection.
+thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful execution.
 
-|thermal_zone[0-*]
+/sys/class/thermal/thermal_zone[0-*]
        |-----cdev[0-*]:                The [0-*]th cooling device in the current thermal zone
        |-----cdev[0-*]_trip_point:     Trip point that cdev[0-*] is associated with
 
+Besides the thermal zone device sysfs I/F and cooling device sysfs I/F,
+the generic thermal driver also creates a hwmon sysfs I/F for each _type_ of
+thermal zone device. E.g. the generic thermal driver registers one hwmon class device
+and build the associated hwmon sysfs I/F for all the registered ACPI thermal zones.
+/sys/class/hwmon/hwmon[0-*]:
+       |-----name:                     The type of the thermal zone devices.
+       |-----temp[1-*]_input:          The current temperature of thermal zone [1-*].
+       |-----temp[1-*]_critical:       The critical trip point of thermal zone [1-*].
+Please read Documentation/hwmon/sysfs-interface for additional information.
 
 ***************************
 * Thermal zone attributes *
@@ -142,16 +152,19 @@ thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device successful e
 
 type                           Strings which represent the thermal zone type.
                                This is given by thermal zone driver as part of registration.
-                               Eg: "ACPI thermal zone" indicates it's a ACPI thermal device
+                               Eg: "acpitz" indicates it's an ACPI thermal device.
+                               In order to keep it consistent with hwmon sys attribute,
+                               this should be a short, lowercase string,
+                               not containing spaces nor dashes.
                                RO
-                               Optional
+                               Required
 
 temp                           Current temperature as reported by thermal zone (sensor)
-                               Unit: degree celsius
+                               Unit: millidegree Celsius
                                RO
                                Required
 
-mode                           One of the predifned values in [kernel, user]
+mode                           One of the predefined values in [kernel, user]
                                This file gives information about the algorithm
                                that is currently managing the thermal zone.
                                It can be either default kernel based algorithm
@@ -164,12 +177,12 @@ mode                              One of the predifned values in [kernel, user]
                                          charge of the thermal management.
 
 trip_point_[0-*]_temp          The temperature above which trip point will be fired
-                               Unit: degree celsius
+                               Unit: millidegree Celsius
                                RO
                                Optional
 
 trip_point_[0-*]_type          Strings which indicate the type of the trip point
-                               Eg. it can be one of critical, hot, passive,
+                               E.g. it can be one of critical, hot, passive,
                                    active[0-*] for ACPI thermal zone.
                                RO
                                Optional
@@ -179,7 +192,7 @@ cdev[0-*]                   Sysfs link to the thermal cooling device node where the sys I/F
                                RO
                                Optional
 
-cdev[0-*]_trip_point           The trip point with which cdev[0-*] is assocated in this thermal zone
+cdev[0-*]_trip_point           The trip point with which cdev[0-*] is associated in this thermal zone
                                -1 means the cooling device is not associated with any trip point.
                                RO
                                Optional
@@ -194,7 +207,7 @@ type                                String which represents the type of device
                                eg. For memory controller device on intel_menlow platform:
                                this should be "Memory controller"
                                RO
-                               Optional
+                               Required
 
 max_state                      The maximum permissible cooling state of this cooling device.
                                RO
@@ -211,7 +224,7 @@ cur_state                   The current cooling state of this cooling device.
 
 ACPI thermal zone may support multiple trip points like critical/hot/passive/active.
 If an ACPI thermal zone supports critical, passive, active[0] and active[1] at the same time,
-it may register itself as a thermale_zone_device (thermal_zone1) with 4 trip points in all.
+it may register itself as a thermal_zone_device (thermal_zone1) with 4 trip points in all.
 It has one processor and one fan, which are both registered as thermal_cooling_device.
 If the processor is listed in _PSL method, and the fan is listed in _AL0 method,
 the sys I/F structure will be built like this:
@@ -219,17 +232,17 @@ the sys I/F structure will be built like this:
 /sys/class/thermal:
 
 |thermal_zone1:
-       |-----type:                     ACPI thermal zone
-       |-----temp:                     37
+       |-----type:                     acpitz
+       |-----temp:                     37000
        |-----mode:                     kernel
-       |-----trip_point_0_temp:        100
+       |-----trip_point_0_temp:        100000
        |-----trip_point_0_type:        critical
-       |-----trip_point_1_temp:        80
+       |-----trip_point_1_temp:        80000
        |-----trip_point_1_type:        passive
-       |-----trip_point_2_temp:        70
-       |-----trip_point_2_type:        active[0]
-       |-----trip_point_3_temp:        60
-       |-----trip_point_3_type:        active[1]
+       |-----trip_point_2_temp:        70000
+       |-----trip_point_2_type:        active0
+       |-----trip_point_3_temp:        60000
+       |-----trip_point_3_type:        active1
        |-----cdev0:                    --->/sys/class/thermal/cooling_device0
        |-----cdev0_trip_point:         1       /* cdev0 can be used for passive */
        |-----cdev1:                    --->/sys/class/thermal/cooling_device3
@@ -244,3 +257,10 @@ the sys I/F structure will be built like this:
        |-----type:                     Fan
        |-----max_state:                2
        |-----cur_state:                0
+
+/sys/class/hwmon:
+
+|hwmon0:
+       |-----name:                     acpitz
+       |-----temp1_input:              37000
+       |-----temp1_crit:               100000