Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
thermal_sys.c File Reference
#include <linux/module.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/kdev_t.h>
#include <linux/idr.h>
#include <linux/thermal.h>
#include <linux/spinlock.h>
#include <linux/reboot.h>
#include <net/netlink.h>
#include <net/genetlink.h>

Go to the source code of this file.

Data Structures

struct  thermal_instance
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define THERMAL_NO_TARGET   -1UL
 
#define to_thermal_zone(_dev)   container_of(_dev, struct thermal_zone_device, device)
 
#define to_cooling_device(_dev)   container_of(_dev, struct thermal_cooling_device, device)
 

Functions

 MODULE_AUTHOR ("Zhang Rui")
 
 MODULE_DESCRIPTION ("Generic thermal management sysfs support")
 
 MODULE_LICENSE ("GPL")
 
int thermal_zone_bind_cooling_device (struct thermal_zone_device *tz, int trip, struct thermal_cooling_device *cdev, unsigned long upper, unsigned long lower)
 
 EXPORT_SYMBOL (thermal_zone_bind_cooling_device)
 
int thermal_zone_unbind_cooling_device (struct thermal_zone_device *tz, int trip, struct thermal_cooling_device *cdev)
 
 EXPORT_SYMBOL (thermal_zone_unbind_cooling_device)
 
struct thermal_cooling_devicethermal_cooling_device_register (char *type, void *devdata, const struct thermal_cooling_device_ops *ops)
 
 EXPORT_SYMBOL (thermal_cooling_device_register)
 
void thermal_cooling_device_unregister (struct thermal_cooling_device *cdev)
 
 EXPORT_SYMBOL (thermal_cooling_device_unregister)
 
void thermal_zone_device_update (struct thermal_zone_device *tz)
 
 EXPORT_SYMBOL (thermal_zone_device_update)
 
struct thermal_zone_devicethermal_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)
 
 EXPORT_SYMBOL (thermal_zone_device_register)
 
void thermal_zone_device_unregister (struct thermal_zone_device *tz)
 
 EXPORT_SYMBOL (thermal_zone_device_unregister)
 
 fs_initcall (thermal_init)
 
 module_exit (thermal_exit)
 

Macro Definition Documentation

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 26 of file thermal_sys.c.

#define THERMAL_NO_TARGET   -1UL

Definition at line 44 of file thermal_sys.c.

#define to_cooling_device (   _dev)    container_of(_dev, struct thermal_cooling_device, device)

Definition at line 363 of file thermal_sys.c.

#define to_thermal_zone (   _dev)    container_of(_dev, struct thermal_zone_device, device)

Definition at line 106 of file thermal_sys.c.

Function Documentation

EXPORT_SYMBOL ( thermal_zone_bind_cooling_device  )
EXPORT_SYMBOL ( thermal_cooling_device_register  )
EXPORT_SYMBOL ( thermal_cooling_device_unregister  )
EXPORT_SYMBOL ( thermal_zone_device_update  )
EXPORT_SYMBOL ( thermal_zone_device_register  )
EXPORT_SYMBOL ( thermal_zone_device_unregister  )
fs_initcall ( thermal_init  )
MODULE_AUTHOR ( "Zhang Rui"  )
MODULE_DESCRIPTION ( "Generic thermal management sysfs support )
module_exit ( thermal_exit  )
MODULE_LICENSE ( "GPL"  )
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.