Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
vt8231.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/jiffies.h>
#include <linux/platform_device.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/hwmon-vid.h>
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/acpi.h>
#include <linux/io.h>

Go to the source code of this file.

Data Structures

struct  vt8231_data
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define VT8231_EXTENT   0x80
 
#define VT8231_BASE_REG   0x70
 
#define VT8231_ENABLE_REG   0x74
 
#define VT8231_REG_FAN_MIN(nr)   (0x3b + (nr))
 
#define VT8231_REG_FAN(nr)   (0x29 + (nr))
 
#define VT8231_REG_TEMP_LOW01   0x49
 
#define VT8231_REG_TEMP_LOW25   0x4d
 
#define TEMP_FROM_REG(reg)   (((253 * 4 - (reg)) * 550 + 105) / 210)
 
#define TEMP_MAXMIN_FROM_REG(reg)   (((253 - (reg)) * 2200 + 105) / 210)
 
#define TEMP_MAXMIN_TO_REG(val)   (253 - ((val) * 210 + 1100) / 2200)
 
#define VT8231_REG_CONFIG   0x40
 
#define VT8231_REG_ALARM1   0x41
 
#define VT8231_REG_ALARM2   0x42
 
#define VT8231_REG_FANDIV   0x47
 
#define VT8231_REG_UCH_CONFIG   0x4a
 
#define VT8231_REG_TEMP1_CONFIG   0x4b
 
#define VT8231_REG_TEMP2_CONFIG   0x4c
 
#define ISTEMP(i, ch_config)
 
#define ISVOLT(i, ch_config)
 
#define DIV_FROM_REG(val)   (1 << (val))
 
#define FAN_FROM_REG(val, div)   ((val) == 0 ? 0 : 1310720 / ((val) * (div)))
 
#define define_voltage_sysfs(offset)
 
#define define_temperature_sysfs(offset)
 
#define define_fan_sysfs(offset)
 

Functions

 module_param (force_addr, int, 0)
 
 MODULE_PARM_DESC (force_addr,"Initialize the base address of the sensors")
 
 define_voltage_sysfs (0)
 
 define_voltage_sysfs (1)
 
 define_voltage_sysfs (2)
 
 define_voltage_sysfs (3)
 
 define_voltage_sysfs (4)
 
 define_temperature_sysfs (2)
 
 define_temperature_sysfs (3)
 
 define_temperature_sysfs (4)
 
 define_temperature_sysfs (5)
 
 define_temperature_sysfs (6)
 
 define_fan_sysfs (1)
 
 define_fan_sysfs (2)
 
 MODULE_DEVICE_TABLE (pci, vt8231_pci_ids)
 
 MODULE_AUTHOR ("Roger Lucas <[email protected]>")
 
 MODULE_DESCRIPTION ("VT8231 sensors")
 
 MODULE_LICENSE ("GPL")
 
 module_init (sm_vt8231_init)
 
 module_exit (sm_vt8231_exit)
 

Macro Definition Documentation

#define define_fan_sysfs (   offset)
Value:
static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, \
show_fan, NULL, offset - 1); \
show_fan_div, set_fan_div, offset - 1); \
show_fan_min, set_fan_min, offset - 1)

Definition at line 593 of file vt8231.c.

#define define_temperature_sysfs (   offset)
Value:
show_temp, NULL, offset - 1); \
show_temp_max, set_temp_max, offset - 1); \
static SENSOR_DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR, \
show_temp_min, set_temp_min, offset - 1)

Definition at line 476 of file vt8231.c.

#define define_voltage_sysfs (   offset)
Value:
static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO, \
show_in_min, set_in_min, offset); \
show_in_max, set_in_max, offset)

Definition at line 331 of file vt8231.c.

#define DIV_FROM_REG (   val)    (1 << (val))

Definition at line 124 of file vt8231.c.

#define FAN_FROM_REG (   val,
  div 
)    ((val) == 0 ? 0 : 1310720 / ((val) * (div)))

Definition at line 153 of file vt8231.c.

#define ISTEMP (   i,
  ch_config 
)
Value:
((i) == 0 ? 1 : \
((ch_config) >> ((i)+1)) & 0x01)

Definition at line 118 of file vt8231.c.

#define ISVOLT (   i,
  ch_config 
)
Value:
((i) == 5 ? 1 : \
!(((ch_config) >> ((i)+2)) & 0x01))

Definition at line 121 of file vt8231.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 28 of file vt8231.c.

#define TEMP_FROM_REG (   reg)    (((253 * 4 - (reg)) * 550 + 105) / 210)

Definition at line 102 of file vt8231.c.

#define TEMP_MAXMIN_FROM_REG (   reg)    (((253 - (reg)) * 2200 + 105) / 210)

Definition at line 103 of file vt8231.c.

#define TEMP_MAXMIN_TO_REG (   val)    (253 - ((val) * 210 + 1100) / 2200)

Definition at line 104 of file vt8231.c.

#define VT8231_BASE_REG   0x70

Definition at line 51 of file vt8231.c.

#define VT8231_ENABLE_REG   0x74

Definition at line 52 of file vt8231.c.

#define VT8231_EXTENT   0x80

Definition at line 50 of file vt8231.c.

#define VT8231_REG_ALARM1   0x41

Definition at line 107 of file vt8231.c.

#define VT8231_REG_ALARM2   0x42

Definition at line 108 of file vt8231.c.

#define VT8231_REG_CONFIG   0x40

Definition at line 106 of file vt8231.c.

#define VT8231_REG_FAN (   nr)    (0x29 + (nr))

Definition at line 78 of file vt8231.c.

#define VT8231_REG_FAN_MIN (   nr)    (0x3b + (nr))

Definition at line 77 of file vt8231.c.

#define VT8231_REG_FANDIV   0x47

Definition at line 109 of file vt8231.c.

#define VT8231_REG_TEMP1_CONFIG   0x4b

Definition at line 111 of file vt8231.c.

#define VT8231_REG_TEMP2_CONFIG   0x4c

Definition at line 112 of file vt8231.c.

#define VT8231_REG_TEMP_LOW01   0x49

Definition at line 95 of file vt8231.c.

#define VT8231_REG_TEMP_LOW25   0x4d

Definition at line 96 of file vt8231.c.

#define VT8231_REG_UCH_CONFIG   0x4a

Definition at line 110 of file vt8231.c.

Function Documentation

define_fan_sysfs ( )
define_fan_sysfs ( )
define_temperature_sysfs ( )
define_temperature_sysfs ( )
define_temperature_sysfs ( )
define_temperature_sysfs ( )
define_temperature_sysfs ( )
define_voltage_sysfs ( )
define_voltage_sysfs ( )
define_voltage_sysfs ( )
define_voltage_sysfs ( )
define_voltage_sysfs ( )
MODULE_AUTHOR ( "Roger Lucas <[email protected]>"  )
MODULE_DESCRIPTION ( "VT8231 sensors )
MODULE_DEVICE_TABLE ( pci  ,
vt8231_pci_ids   
)
module_exit ( sm_vt8231_exit  )
module_init ( sm_vt8231_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( force_addr  ,
int  ,
 
)
MODULE_PARM_DESC ( force_addr  ,
"Initialize the base address of the sensors  
)