Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
via686a.c File Reference
#include <linux/module.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/err.h>
#include <linux/init.h>
#include <linux/mutex.h>
#include <linux/sysfs.h>
#include <linux/acpi.h>
#include <linux/io.h>

Go to the source code of this file.

Data Structures

struct  via686a_data
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define VIA686A_EXTENT   0x80
 
#define VIA686A_BASE_REG   0x70
 
#define VIA686A_ENABLE_REG   0x74
 
#define VIA686A_REG_IN_MAX(nr)   (0x2b + ((nr) * 2))
 
#define VIA686A_REG_IN_MIN(nr)   (0x2c + ((nr) * 2))
 
#define VIA686A_REG_IN(nr)   (0x22 + (nr))
 
#define VIA686A_REG_FAN_MIN(nr)   (0x3a + (nr))
 
#define VIA686A_REG_FAN(nr)   (0x28 + (nr))
 
#define VIA686A_REG_TEMP_LOW1   0x4b
 
#define VIA686A_REG_TEMP_LOW23   0x49
 
#define VIA686A_REG_ALARM1   0x41
 
#define VIA686A_REG_ALARM2   0x42
 
#define VIA686A_REG_FANDIV   0x47
 
#define VIA686A_REG_CONFIG   0x40
 
#define VIA686A_REG_TEMP_MODE   0x4b
 
#define VIA686A_TEMP_MODE_MASK   0x3F
 
#define VIA686A_TEMP_MODE_CONTINUOUS   0x00
 
#define FAN_FROM_REG(val, div)
 
#define TEMP_FROM_REG(val)   ((long)tempLUT[val] * 100)
 
#define DIV_FROM_REG(val)   (1 << (val))
 
#define DIV_TO_REG(val)   ((val) == 8 ? 3 : (val) == 4 ? 2 : (val) == 1 ? 0 : 1)
 
#define show_in_offset(offset)
 
#define show_temp_offset(offset)
 
#define show_fan_offset(offset)
 

Functions

 module_param (force_addr, ushort, 0)
 
 MODULE_PARM_DESC (force_addr,"Initialize the base address of the sensors")
 
 show_in_offset (0)
 
 show_in_offset (1)
 
 show_in_offset (2)
 
 show_in_offset (3)
 
 show_in_offset (4)
 
 show_temp_offset (1)
 
 show_temp_offset (2)
 
 show_temp_offset (3)
 
 show_fan_offset (1)
 
 show_fan_offset (2)
 
 MODULE_DEVICE_TABLE (pci, via686a_pci_ids)
 
 MODULE_AUTHOR ("Kyösti Mälkki <[email protected]>, ""Mark Studebaker <[email protected]> ""and Bob Dougherty <[email protected]>")
 
 MODULE_DESCRIPTION ("VIA 686A Sensor device")
 
 MODULE_LICENSE ("GPL")
 
 module_init (sm_via686a_init)
 
 module_exit (sm_via686a_exit)
 

Macro Definition Documentation

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

Definition at line 312 of file via686a.c.

#define DIV_TO_REG (   val)    ((val) == 8 ? 3 : (val) == 4 ? 2 : (val) == 1 ? 0 : 1)

Definition at line 313 of file via686a.c.

#define FAN_FROM_REG (   val,
  div 
)
Value:
((val) == 0 ? 0 : (val) == 255 ? 0 : 1350000 / \
((val) * (div)))

Definition at line 182 of file via686a.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 34 of file via686a.c.

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

Definition at line 574 of file via686a.c.

#define show_in_offset (   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 423 of file via686a.c.

#define show_temp_offset (   offset)
Value:
show_temp, NULL, offset - 1); \
show_temp_over, set_temp_over, offset - 1); \
static SENSOR_DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR, \
show_temp_hyst, set_temp_hyst, offset - 1);

Definition at line 497 of file via686a.c.

#define TEMP_FROM_REG (   val)    ((long)tempLUT[val] * 100)

Definition at line 295 of file via686a.c.

#define VIA686A_BASE_REG   0x70

Definition at line 71 of file via686a.c.

#define VIA686A_ENABLE_REG   0x74

Definition at line 72 of file via686a.c.

#define VIA686A_EXTENT   0x80

Definition at line 70 of file via686a.c.

#define VIA686A_REG_ALARM1   0x41

Definition at line 93 of file via686a.c.

#define VIA686A_REG_ALARM2   0x42

Definition at line 94 of file via686a.c.

#define VIA686A_REG_CONFIG   0x40

Definition at line 96 of file via686a.c.

#define VIA686A_REG_FAN (   nr)    (0x28 + (nr))

Definition at line 82 of file via686a.c.

#define VIA686A_REG_FAN_MIN (   nr)    (0x3a + (nr))

Definition at line 81 of file via686a.c.

#define VIA686A_REG_FANDIV   0x47

Definition at line 95 of file via686a.c.

#define VIA686A_REG_IN (   nr)    (0x22 + (nr))

Definition at line 78 of file via686a.c.

#define VIA686A_REG_IN_MAX (   nr)    (0x2b + ((nr) * 2))

Definition at line 76 of file via686a.c.

#define VIA686A_REG_IN_MIN (   nr)    (0x2c + ((nr) * 2))

Definition at line 77 of file via686a.c.

#define VIA686A_REG_TEMP_LOW1   0x4b

Definition at line 89 of file via686a.c.

#define VIA686A_REG_TEMP_LOW23   0x49

Definition at line 91 of file via686a.c.

#define VIA686A_REG_TEMP_MODE   0x4b

Definition at line 105 of file via686a.c.

#define VIA686A_TEMP_MODE_CONTINUOUS   0x00

Definition at line 108 of file via686a.c.

#define VIA686A_TEMP_MODE_MASK   0x3F

Definition at line 107 of file via686a.c.

Function Documentation

MODULE_AUTHOR ( "Kyösti Mälkki <[email protected] ,
""Mark Studebaker< mdsxyz123 @yahoo.com >""and Bob Dougherty< bobd @stanford.edu >"   
)
MODULE_DESCRIPTION ( "VIA 686A Sensor device"  )
MODULE_DEVICE_TABLE ( pci  ,
via686a_pci_ids   
)
module_exit ( sm_via686a_exit  )
module_init ( sm_via686a_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( force_addr  ,
ushort  ,
 
)
MODULE_PARM_DESC ( force_addr  ,
"Initialize the base address of the sensors  
)
show_fan_offset ( )
show_fan_offset ( )
show_in_offset ( )

Definition at line 220 of file smsc47m192.c.

show_in_offset ( )
show_in_offset ( )
show_in_offset ( )
show_in_offset ( )
show_temp_offset ( )
show_temp_offset ( )
show_temp_offset ( )