Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ultra45_env.c File Reference
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/io.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>

Go to the source code of this file.

Data Structures

struct  env
 

Macros

#define DRV_MODULE_VERSION   "0.1"
 
#define REG_CMD   0x00UL
 
#define REG_CMD_RESET   0x80
 
#define REG_CMD_ESTAR   0x01
 
#define REG_STAT   0x01UL
 
#define REG_STAT_FWVER   0xf0
 
#define REG_STAT_TGOOD   0x08
 
#define REG_STAT_STALE   0x04
 
#define REG_STAT_BUSY   0x02
 
#define REG_STAT_FAULT   0x01
 
#define REG_DATA   0x40UL
 
#define REG_ADDR   0x41UL
 
#define REG_SIZE   0x42UL
 
#define IREG_FAN0   0x00
 
#define IREG_FAN1   0x01
 
#define IREG_FAN2   0x02
 
#define IREG_FAN3   0x03
 
#define IREG_FAN4   0x04
 
#define IREG_FAN5   0x05
 
#define IREG_LCL_TEMP   0x06
 
#define IREG_RMT1_TEMP   0x07
 
#define IREG_RMT2_TEMP   0x08
 
#define IREG_RMT3_TEMP   0x09
 
#define IREG_LM95221_TEMP   0x0a
 
#define IREG_FIRE_TEMP   0x0b
 
#define IREG_LSI1064_TEMP   0x0c
 
#define IREG_FRONT_TEMP   0x0d
 
#define IREG_FAN_STAT   0x0e
 
#define IREG_VCORE0   0x0f
 
#define IREG_VCORE1   0x10
 
#define IREG_VMEM0   0x11
 
#define IREG_VMEM1   0x12
 
#define IREG_PSU_TEMP   0x13
 
#define FAN_PERIOD_TO_RPM(x)   ((90000 * 60) / (x))
 
#define FAN_RPM_TO_PERIOD   FAN_PERIOD_TO_RPM
 
#define FAN_PERIOD_INVALID   (0xff << 8)
 
#define FAN_DATA_VALID(x)   ((x) && (x) != FAN_PERIOD_INVALID)
 
#define fan(index)
 

Functions

 MODULE_AUTHOR ("David S. Miller ([email protected])")
 
 MODULE_DESCRIPTION ("Ultra45 environmental monitor driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (DRV_MODULE_VERSION)
 
 fan (0)
 
 fan (1)
 
 fan (2)
 
 fan (3)
 
 fan (4)
 
 MODULE_DEVICE_TABLE (of, env_match)
 
 module_platform_driver (env_driver)
 

Macro Definition Documentation

#define DRV_MODULE_VERSION   "0.1"

Definition at line 17 of file ultra45_env.c.

#define fan (   index)
Value:
show_fan_speed, set_fan_speed, index); \
static SENSOR_DEVICE_ATTR(fan##index##_fault, S_IRUGO, \
show_fan_fault, NULL, index)

Definition at line 147 of file ultra45_env.c.

#define FAN_DATA_VALID (   x)    ((x) && (x) != FAN_PERIOD_INVALID)

Definition at line 94 of file ultra45_env.c.

#define FAN_PERIOD_INVALID   (0xff << 8)

Definition at line 93 of file ultra45_env.c.

#define FAN_PERIOD_TO_RPM (   x)    ((90000 * 60) / (x))

Definition at line 91 of file ultra45_env.c.

#define FAN_RPM_TO_PERIOD   FAN_PERIOD_TO_RPM

Definition at line 92 of file ultra45_env.c.

#define IREG_FAN0   0x00

Definition at line 39 of file ultra45_env.c.

#define IREG_FAN1   0x01

Definition at line 40 of file ultra45_env.c.

#define IREG_FAN2   0x02

Definition at line 41 of file ultra45_env.c.

#define IREG_FAN3   0x03

Definition at line 42 of file ultra45_env.c.

#define IREG_FAN4   0x04

Definition at line 43 of file ultra45_env.c.

#define IREG_FAN5   0x05

Definition at line 44 of file ultra45_env.c.

#define IREG_FAN_STAT   0x0e

Definition at line 53 of file ultra45_env.c.

#define IREG_FIRE_TEMP   0x0b

Definition at line 50 of file ultra45_env.c.

#define IREG_FRONT_TEMP   0x0d

Definition at line 52 of file ultra45_env.c.

#define IREG_LCL_TEMP   0x06

Definition at line 45 of file ultra45_env.c.

#define IREG_LM95221_TEMP   0x0a

Definition at line 49 of file ultra45_env.c.

#define IREG_LSI1064_TEMP   0x0c

Definition at line 51 of file ultra45_env.c.

#define IREG_PSU_TEMP   0x13

Definition at line 58 of file ultra45_env.c.

#define IREG_RMT1_TEMP   0x07

Definition at line 46 of file ultra45_env.c.

#define IREG_RMT2_TEMP   0x08

Definition at line 47 of file ultra45_env.c.

#define IREG_RMT3_TEMP   0x09

Definition at line 48 of file ultra45_env.c.

#define IREG_VCORE0   0x0f

Definition at line 54 of file ultra45_env.c.

#define IREG_VCORE1   0x10

Definition at line 55 of file ultra45_env.c.

#define IREG_VMEM0   0x11

Definition at line 56 of file ultra45_env.c.

#define IREG_VMEM1   0x12

Definition at line 57 of file ultra45_env.c.

#define REG_ADDR   0x41UL

Definition at line 35 of file ultra45_env.c.

#define REG_CMD   0x00UL

Definition at line 25 of file ultra45_env.c.

#define REG_CMD_ESTAR   0x01

Definition at line 27 of file ultra45_env.c.

#define REG_CMD_RESET   0x80

Definition at line 26 of file ultra45_env.c.

#define REG_DATA   0x40UL

Definition at line 34 of file ultra45_env.c.

#define REG_SIZE   0x42UL

Definition at line 36 of file ultra45_env.c.

#define REG_STAT   0x01UL

Definition at line 28 of file ultra45_env.c.

#define REG_STAT_BUSY   0x02

Definition at line 32 of file ultra45_env.c.

#define REG_STAT_FAULT   0x01

Definition at line 33 of file ultra45_env.c.

#define REG_STAT_FWVER   0xf0

Definition at line 29 of file ultra45_env.c.

#define REG_STAT_STALE   0x04

Definition at line 31 of file ultra45_env.c.

#define REG_STAT_TGOOD   0x08

Definition at line 30 of file ultra45_env.c.

Function Documentation

fan ( )
fan ( )
fan ( )
fan ( )
fan ( )
MODULE_AUTHOR ( "David S. Miller ([email protected])"  )
MODULE_DESCRIPTION ( "Ultra45 environmental monitor driver )
MODULE_DEVICE_TABLE ( of  ,
env_match   
)
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( env_driver  )
MODULE_VERSION ( DRV_MODULE_VERSION  )