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

Go to the source code of this file.

Data Structures

struct  abituguru_data
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define ABIT_UGURU_ALARM_BANK   0x20 /* 1x 3 bytes */
 
#define ABIT_UGURU_SENSOR_BANK1   0x21 /* 16x volt and temp */
 
#define ABIT_UGURU_FAN_PWM   0x24 /* 3x 5 bytes */
 
#define ABIT_UGURU_SENSOR_BANK2   0x26 /* fans */
 
#define ABIT_UGURU_MAX_BANK1_SENSORS   16
 
#define ABIT_UGURU_MAX_BANK2_SENSORS   6
 
#define ABIT_UGURU_MAX_PWMS   5
 
#define ABIT_UGURU_TEMP_HIGH_ALARM_ENABLE   0x01 /* temp over warn */
 
#define ABIT_UGURU_VOLT_HIGH_ALARM_ENABLE   0x02 /* volt over max */
 
#define ABIT_UGURU_VOLT_LOW_ALARM_ENABLE   0x04 /* volt under min */
 
#define ABIT_UGURU_TEMP_HIGH_ALARM_FLAG   0x10 /* temp is over warn */
 
#define ABIT_UGURU_VOLT_HIGH_ALARM_FLAG   0x20 /* volt is over max */
 
#define ABIT_UGURU_VOLT_LOW_ALARM_FLAG   0x40 /* volt is under min */
 
#define ABIT_UGURU_FAN_LOW_ALARM_ENABLE   0x01 /* fan under min */
 
#define ABIT_UGURU_BEEP_ENABLE   0x08 /* beep if alarm */
 
#define ABIT_UGURU_SHUTDOWN_ENABLE   0x80 /* shutdown if alarm */
 
#define ABIT_UGURU_FAN_PWM_ENABLE   0x80 /* enable speed control */
 
#define ABIT_UGURU_FAN_MAX   15300 /* RPM */
 
#define ABIT_UGURU_IN_SENSOR   0
 
#define ABIT_UGURU_TEMP_SENSOR   1
 
#define ABIT_UGURU_NC   2
 
#define ABIT_UGURU_WAIT_TIMEOUT   125
 
#define ABIT_UGURU_WAIT_TIMEOUT_SLEEP   5
 
#define ABIT_UGURU_READY_TIMEOUT   5
 
#define ABIT_UGURU_MAX_RETRIES   3
 
#define ABIT_UGURU_RETRY_DELAY   (HZ/5)
 
#define ABIT_UGURU_MAX_TIMEOUTS   2
 
#define ABIT_UGURU_NAME   "abituguru"
 
#define ABIT_UGURU_DEBUG(level, format, arg...)
 
#define ABITUGURU_IN_NAMES_LENGTH   (11 + 2 * 9 + 2 * 15 + 2 * 22 + 10 + 14)
 
#define ABITUGURU_TEMP_NAMES_LENGTH   (13 + 11 + 12 + 13 + 20 + 12 + 16)
 
#define ABITUGURU_FAN_NAMES_LENGTH   (11 + 9 + 11 + 18 + 10 + 14)
 
#define ABITUGURU_PWM_NAMES_LENGTH   (12 + 24 + 2 * 21 + 2 * 22)
 
#define ABITUGURU_SYSFS_NAMES_LENGTH
 
#define ABIT_UGURU_BASE   0x00E0
 
#define ABIT_UGURU_CMD   0x00
 
#define ABIT_UGURU_DATA   0x04
 
#define ABIT_UGURU_REGION_LENGTH   5
 
#define ABIT_UGURU_STATUS_WRITE   0x00 /* Ready to be written */
 
#define ABIT_UGURU_STATUS_READ   0x01 /* Ready to be read */
 
#define ABIT_UGURU_STATUS_INPUT   0x08 /* More input */
 
#define ABIT_UGURU_STATUS_READY   0x09 /* Ready to be written */
 
#define ABIT_UGURU_PM   NULL
 

Functions

 module_param (force, bool, 0)
 
 MODULE_PARM_DESC (force,"Set to one to force detection.")
 
 module_param_array (bank1_types, int, NULL, 0)
 
 MODULE_PARM_DESC (bank1_types,"Bank1 sensortype autodetection override:\n"" -1 autodetect\n"" 0 volt sensor\n"" 1 temp sensor\n"" 2 not connected")
 
 module_param (fan_sensors, int, 0)
 
 MODULE_PARM_DESC (fan_sensors,"Number of fan sensors on the uGuru ""(0 = autodetect)")
 
 module_param (pwms, int, 0)
 
 MODULE_PARM_DESC (pwms,"Number of PWMs on the uGuru ""(0 = autodetect)")
 
 module_param (verbose, int, 0644)
 
 MODULE_PARM_DESC (verbose,"How verbose should the driver be? (0-3):\n"" 0 normal output\n"" 1 + verbose error reporting\n"" 2 + sensors type probing info\n"" 3 + retryable error reporting")
 
 MODULE_AUTHOR ("Hans de Goede <[email protected]>")
 
 MODULE_DESCRIPTION ("Abit uGuru Sensor device")
 
 MODULE_LICENSE ("GPL")
 
 module_init (abituguru_init)
 
 module_exit (abituguru_exit)
 

Macro Definition Documentation

#define ABIT_UGURU_ALARM_BANK   0x20 /* 1x 3 bytes */

Definition at line 41 of file abituguru.c.

#define ABIT_UGURU_BASE   0x00E0

Definition at line 136 of file abituguru.c.

#define ABIT_UGURU_BEEP_ENABLE   0x08 /* beep if alarm */

Definition at line 65 of file abituguru.c.

#define ABIT_UGURU_CMD   0x00

Definition at line 138 of file abituguru.c.

#define ABIT_UGURU_DATA   0x04

Definition at line 140 of file abituguru.c.

#define ABIT_UGURU_DEBUG (   level,
  format,
  arg... 
)
Value:
if (level <= verbose) \

Definition at line 99 of file abituguru.c.

#define ABIT_UGURU_FAN_LOW_ALARM_ENABLE   0x01 /* fan under min */

Definition at line 63 of file abituguru.c.

#define ABIT_UGURU_FAN_MAX   15300 /* RPM */

Definition at line 70 of file abituguru.c.

#define ABIT_UGURU_FAN_PWM   0x24 /* 3x 5 bytes */

Definition at line 43 of file abituguru.c.

#define ABIT_UGURU_FAN_PWM_ENABLE   0x80 /* enable speed control */

Definition at line 68 of file abituguru.c.

#define ABIT_UGURU_IN_SENSOR   0

Definition at line 72 of file abituguru.c.

#define ABIT_UGURU_MAX_BANK1_SENSORS   16

Definition at line 46 of file abituguru.c.

#define ABIT_UGURU_MAX_BANK2_SENSORS   6

Definition at line 52 of file abituguru.c.

#define ABIT_UGURU_MAX_PWMS   5

Definition at line 54 of file abituguru.c.

#define ABIT_UGURU_MAX_RETRIES   3

Definition at line 93 of file abituguru.c.

#define ABIT_UGURU_MAX_TIMEOUTS   2

Definition at line 96 of file abituguru.c.

#define ABIT_UGURU_NAME   "abituguru"

Definition at line 98 of file abituguru.c.

#define ABIT_UGURU_NC   2

Definition at line 74 of file abituguru.c.

#define ABIT_UGURU_PM   NULL

Definition at line 1538 of file abituguru.c.

#define ABIT_UGURU_READY_TIMEOUT   5

Definition at line 91 of file abituguru.c.

#define ABIT_UGURU_REGION_LENGTH   5

Definition at line 141 of file abituguru.c.

#define ABIT_UGURU_RETRY_DELAY   (HZ/5)

Definition at line 94 of file abituguru.c.

#define ABIT_UGURU_SENSOR_BANK1   0x21 /* 16x volt and temp */

Definition at line 42 of file abituguru.c.

#define ABIT_UGURU_SENSOR_BANK2   0x26 /* fans */

Definition at line 44 of file abituguru.c.

#define ABIT_UGURU_SHUTDOWN_ENABLE   0x80 /* shutdown if alarm */

Definition at line 66 of file abituguru.c.

#define ABIT_UGURU_STATUS_INPUT   0x08 /* More input */

Definition at line 145 of file abituguru.c.

#define ABIT_UGURU_STATUS_READ   0x01 /* Ready to be read */

Definition at line 144 of file abituguru.c.

#define ABIT_UGURU_STATUS_READY   0x09 /* Ready to be written */

Definition at line 146 of file abituguru.c.

#define ABIT_UGURU_STATUS_WRITE   0x00 /* Ready to be written */

Definition at line 143 of file abituguru.c.

#define ABIT_UGURU_TEMP_HIGH_ALARM_ENABLE   0x01 /* temp over warn */

Definition at line 56 of file abituguru.c.

#define ABIT_UGURU_TEMP_HIGH_ALARM_FLAG   0x10 /* temp is over warn */

Definition at line 59 of file abituguru.c.

#define ABIT_UGURU_TEMP_SENSOR   1

Definition at line 73 of file abituguru.c.

#define ABIT_UGURU_VOLT_HIGH_ALARM_ENABLE   0x02 /* volt over max */

Definition at line 57 of file abituguru.c.

#define ABIT_UGURU_VOLT_HIGH_ALARM_FLAG   0x20 /* volt is over max */

Definition at line 60 of file abituguru.c.

#define ABIT_UGURU_VOLT_LOW_ALARM_ENABLE   0x04 /* volt under min */

Definition at line 58 of file abituguru.c.

#define ABIT_UGURU_VOLT_LOW_ALARM_FLAG   0x40 /* volt is under min */

Definition at line 61 of file abituguru.c.

#define ABIT_UGURU_WAIT_TIMEOUT   125

Definition at line 80 of file abituguru.c.

#define ABIT_UGURU_WAIT_TIMEOUT_SLEEP   5

Definition at line 86 of file abituguru.c.

#define ABITUGURU_FAN_NAMES_LENGTH   (11 + 9 + 11 + 18 + 10 + 14)

Definition at line 117 of file abituguru.c.

#define ABITUGURU_IN_NAMES_LENGTH   (11 + 2 * 9 + 2 * 15 + 2 * 22 + 10 + 14)

Definition at line 107 of file abituguru.c.

#define ABITUGURU_PWM_NAMES_LENGTH   (12 + 24 + 2 * 21 + 2 * 22)

Definition at line 122 of file abituguru.c.

#define ABITUGURU_SYSFS_NAMES_LENGTH
Value:
( \
ABIT_UGURU_MAX_BANK1_SENSORS * ABITUGURU_IN_NAMES_LENGTH + \
ABIT_UGURU_MAX_BANK2_SENSORS * ABITUGURU_FAN_NAMES_LENGTH + \
ABIT_UGURU_MAX_PWMS * ABITUGURU_PWM_NAMES_LENGTH)

Definition at line 124 of file abituguru.c.

#define ABITUGURU_TEMP_NAMES_LENGTH   (13 + 11 + 12 + 13 + 20 + 12 + 16)

Definition at line 112 of file abituguru.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 24 of file abituguru.c.

Function Documentation

MODULE_AUTHOR ( "Hans de Goede <[email protected]>"  )
MODULE_DESCRIPTION ( "Abit uGuru Sensor device )
module_exit ( abituguru_exit  )
module_init ( abituguru_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( force  ,
bool  ,
 
)
module_param ( fan_sensors  ,
int  ,
 
)
module_param ( pwms  ,
int  ,
 
)
module_param ( verbose  ,
int  ,
0644   
)
module_param_array ( bank1_types  ,
int  ,
NULL  ,
 
)
MODULE_PARM_DESC ( force  ,
"Set to one to force detection."   
)
MODULE_PARM_DESC ( bank1_types  ,
"Bank1 sensortype autodetection override:\n"" -1 autodetect\n"" 0 volt sensor\n"" 1 temp sensor\n"" 2 not connected"   
)
MODULE_PARM_DESC ( fan_sensors  ,
"Number of fan sensors on the uGuru ""(0 = autodetect)"   
)
MODULE_PARM_DESC ( pwms  ,
"Number of PWMs on the uGuru ""(0 = autodetect)"   
)
MODULE_PARM_DESC ( verbose  ,
"How verbose should the driver be? (0-3):\n"" 0 normal output\n"" 1 + verbose error reporting\n"" 2 + sensors type probing info\n"" 3 + retryable error reporting"   
)