Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
thermal.h File Reference
#include <linux/idr.h>
#include <linux/device.h>
#include <linux/workqueue.h>

Go to the source code of this file.

Data Structures

struct  thermal_zone_device_ops
 
struct  thermal_cooling_device_ops
 
struct  thermal_cooling_device
 
struct  thermal_attr
 
struct  thermal_zone_device
 
struct  thermal_genl_event
 

Macros

#define THERMAL_NO_LIMIT   -1UL /* no upper/lower limit requirement */
 
#define THERMAL_TRIPS_NONE   -1
 
#define THERMAL_MAX_TRIPS   12
 
#define THERMAL_NAME_LENGTH   20
 
#define KELVIN_TO_CELSIUS(t)
 
#define CELSIUS_TO_KELVIN(t)   ((t)*10+2732)
 
#define THERMAL_GENL_FAMILY_NAME   "thermal_event"
 
#define THERMAL_GENL_VERSION   0x01
 
#define THERMAL_GENL_MCAST_GROUP_NAME   "thermal_mc_group"
 
#define THERMAL_GENL_ATTR_MAX   (__THERMAL_GENL_ATTR_MAX - 1)
 
#define THERMAL_GENL_CMD_MAX   (__THERMAL_GENL_CMD_MAX - 1)
 

Enumerations

enum  thermal_device_mode { THERMAL_DEVICE_DISABLED = 0, THERMAL_DEVICE_ENABLED }
 
enum  thermal_trip_type { THERMAL_TRIP_ACTIVE = 0, THERMAL_TRIP_PASSIVE, THERMAL_TRIP_HOT, THERMAL_TRIP_CRITICAL }
 
enum  thermal_trend { THERMAL_TREND_STABLE, THERMAL_TREND_RAISING, THERMAL_TREND_DROPPING }
 
enum  events { THERMAL_AUX0, THERMAL_AUX1, THERMAL_CRITICAL, THERMAL_DEV_FAULT }
 
enum  { THERMAL_GENL_ATTR_UNSPEC, THERMAL_GENL_ATTR_EVENT, __THERMAL_GENL_ATTR_MAX }
 
enum  { THERMAL_GENL_CMD_UNSPEC, THERMAL_GENL_CMD_EVENT, __THERMAL_GENL_CMD_MAX }
 

Functions

struct thermal_zone_devicethermal_zone_device_register (const char *, int, int, void *, const struct thermal_zone_device_ops *, int, int)
 
void thermal_zone_device_unregister (struct thermal_zone_device *)
 
int thermal_zone_bind_cooling_device (struct thermal_zone_device *, int, struct thermal_cooling_device *, unsigned long, unsigned long)
 
int thermal_zone_unbind_cooling_device (struct thermal_zone_device *, int, struct thermal_cooling_device *)
 
void thermal_zone_device_update (struct thermal_zone_device *)
 
struct thermal_cooling_devicethermal_cooling_device_register (char *, void *, const struct thermal_cooling_device_ops *)
 
void thermal_cooling_device_unregister (struct thermal_cooling_device *)
 

Macro Definition Documentation

#define CELSIUS_TO_KELVIN (   t)    ((t)*10+2732)

Definition at line 105 of file thermal.h.

#define KELVIN_TO_CELSIUS (   t)
Value:
(long)(((long)t-2732 >= 0) ? \
((long)t-2732+5)/10 : ((long)t-2732-5)/10)

Definition at line 103 of file thermal.h.

#define THERMAL_GENL_ATTR_MAX   (__THERMAL_GENL_ATTR_MAX - 1)

Definition at line 156 of file thermal.h.

#define THERMAL_GENL_CMD_MAX   (__THERMAL_GENL_CMD_MAX - 1)

Definition at line 164 of file thermal.h.

#define THERMAL_GENL_FAMILY_NAME   "thermal_event"

Definition at line 135 of file thermal.h.

#define THERMAL_GENL_MCAST_GROUP_NAME   "thermal_mc_group"

Definition at line 137 of file thermal.h.

#define THERMAL_GENL_VERSION   0x01

Definition at line 136 of file thermal.h.

#define THERMAL_MAX_TRIPS   12

Definition at line 89 of file thermal.h.

#define THERMAL_NAME_LENGTH   20

Definition at line 90 of file thermal.h.

#define THERMAL_NO_LIMIT   -1UL /* no upper/lower limit requirement */

Definition at line 86 of file thermal.h.

#define THERMAL_TRIPS_NONE   -1

Definition at line 88 of file thermal.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
THERMAL_GENL_ATTR_UNSPEC 
THERMAL_GENL_ATTR_EVENT 
__THERMAL_GENL_ATTR_MAX 

Definition at line 151 of file thermal.h.

anonymous enum
Enumerator:
THERMAL_GENL_CMD_UNSPEC 
THERMAL_GENL_CMD_EVENT 
__THERMAL_GENL_CMD_MAX 

Definition at line 159 of file thermal.h.

enum events
Enumerator:
THERMAL_AUX0 
THERMAL_AUX1 
THERMAL_CRITICAL 
THERMAL_DEV_FAULT 

Definition at line 139 of file thermal.h.

Enumerator:
THERMAL_DEVICE_DISABLED 
THERMAL_DEVICE_ENABLED 

Definition at line 35 of file thermal.h.

Enumerator:
THERMAL_TREND_STABLE 
THERMAL_TREND_RAISING 
THERMAL_TREND_DROPPING 

Definition at line 47 of file thermal.h.

Enumerator:
THERMAL_TRIP_ACTIVE 
THERMAL_TRIP_PASSIVE 
THERMAL_TRIP_HOT 
THERMAL_TRIP_CRITICAL 

Definition at line 40 of file thermal.h.

Function Documentation

struct thermal_cooling_device* thermal_cooling_device_register ( char type,
void devdata,
const struct thermal_cooling_device_ops ops 
)
read

thermal_cooling_device_register - register a new thermal cooling device : the thermal cooling device type. : device private data. : standard thermal cooling devices callbacks.

Definition at line 894 of file thermal_sys.c.

void thermal_cooling_device_unregister ( struct thermal_cooling_device cdev)

thermal_cooling_device_unregister - removes the registered thermal cooling device : the thermal cooling device to remove.

thermal_cooling_device_unregister() must be called when the device is no longer needed.

Definition at line 977 of file thermal_sys.c.

int thermal_zone_bind_cooling_device ( struct thermal_zone_device tz,
int  trip,
struct thermal_cooling_device cdev,
unsigned long  upper,
unsigned long  lower 
)

thermal_zone_bind_cooling_device - bind a cooling device to a thermal zone : thermal zone device : indicates which trip point the cooling devices is associated with in this thermal zone. : thermal cooling device

This function is usually called in the thermal zone device .bind callback.

Definition at line 733 of file thermal_sys.c.

struct thermal_zone_device* thermal_zone_device_register ( const char type,
int  trips,
int  mask,
void devdata,
const struct thermal_zone_device_ops ops,
int  passive_delay,
int  polling_delay 
)
read

thermal_zone_device_register - register a new thermal zone device : the thermal zone device type : the number of trip points the thermal zone support : a bit string indicating the writeablility of trip points : private device data : standard thermal zone device callbacks : number of milliseconds to wait between polls when performing passive cooling : number of milliseconds to wait between polls when checking whether trip points have been crossed (0 for interrupt driven systems)

thermal_zone_device_unregister() must be called when the device is no longer needed. The passive cooling depends on the .get_trend() return value.

Definition at line 1332 of file thermal_sys.c.

void thermal_zone_device_unregister ( struct thermal_zone_device tz)

thermal_device_unregister - removes the registered thermal zone device : the thermal zone device to remove

Definition at line 1448 of file thermal_sys.c.

void thermal_zone_device_update ( struct thermal_zone_device tz)

thermal_zone_device_update - force an update of a thermal zone's state : the thermal zone to update

Definition at line 1149 of file thermal_sys.c.

int thermal_zone_unbind_cooling_device ( struct thermal_zone_device tz,
int  trip,
struct thermal_cooling_device cdev 
)

thermal_zone_unbind_cooling_device - unbind a cooling device from a thermal zone : thermal zone device : indicates which trip point the cooling devices is associated with in this thermal zone. : thermal cooling device

This function is usually called in the thermal zone device .unbind callback.

Definition at line 836 of file thermal_sys.c.