Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
max6650.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.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  max6650_data
 

Macros

#define MAX6650_REG_SPEED   0x00
 
#define MAX6650_REG_CONFIG   0x02
 
#define MAX6650_REG_GPIO_DEF   0x04
 
#define MAX6650_REG_DAC   0x06
 
#define MAX6650_REG_ALARM_EN   0x08
 
#define MAX6650_REG_ALARM   0x0A
 
#define MAX6650_REG_TACH0   0x0C
 
#define MAX6650_REG_TACH1   0x0E
 
#define MAX6650_REG_TACH2   0x10
 
#define MAX6650_REG_TACH3   0x12
 
#define MAX6650_REG_GPIO_STAT   0x14
 
#define MAX6650_REG_COUNT   0x16
 
#define MAX6650_CFG_V12   0x08
 
#define MAX6650_CFG_PRESCALER_MASK   0x07
 
#define MAX6650_CFG_PRESCALER_2   0x01
 
#define MAX6650_CFG_PRESCALER_4   0x02
 
#define MAX6650_CFG_PRESCALER_8   0x03
 
#define MAX6650_CFG_PRESCALER_16   0x04
 
#define MAX6650_CFG_MODE_MASK   0x30
 
#define MAX6650_CFG_MODE_ON   0x00
 
#define MAX6650_CFG_MODE_OFF   0x10
 
#define MAX6650_CFG_MODE_CLOSED_LOOP   0x20
 
#define MAX6650_CFG_MODE_OPEN_LOOP   0x30
 
#define MAX6650_COUNT_MASK   0x03
 
#define MAX6650_ALRM_MAX   0x01
 
#define MAX6650_ALRM_MIN   0x02
 
#define MAX6650_ALRM_TACH   0x04
 
#define MAX6650_ALRM_GPIO1   0x08
 
#define MAX6650_ALRM_GPIO2   0x10
 
#define FAN_RPM_MIN   240
 
#define FAN_RPM_MAX   30000
 
#define DIV_FROM_REG(reg)   (1 << (reg & 7))
 

Functions

 module_param (fan_voltage, int, S_IRUGO)
 
 module_param (prescaler, int, S_IRUGO)
 
 module_param (clock, int, S_IRUGO)
 
 MODULE_DEVICE_TABLE (i2c, max6650_id)
 
 module_i2c_driver (max6650_driver)
 
 MODULE_AUTHOR ("Hans J. Koch")
 
 MODULE_DESCRIPTION ("MAX6650 sensor driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DIV_FROM_REG (   reg)    (1 << (reg & 7))

Definition at line 106 of file max6650.c.

#define FAN_RPM_MAX   30000

Definition at line 104 of file max6650.c.

#define FAN_RPM_MIN   240

Definition at line 103 of file max6650.c.

#define MAX6650_ALRM_GPIO1   0x08

Definition at line 99 of file max6650.c.

#define MAX6650_ALRM_GPIO2   0x10

Definition at line 100 of file max6650.c.

#define MAX6650_ALRM_MAX   0x01

Definition at line 96 of file max6650.c.

#define MAX6650_ALRM_MIN   0x02

Definition at line 97 of file max6650.c.

#define MAX6650_ALRM_TACH   0x04

Definition at line 98 of file max6650.c.

#define MAX6650_CFG_MODE_CLOSED_LOOP   0x20

Definition at line 88 of file max6650.c.

#define MAX6650_CFG_MODE_MASK   0x30

Definition at line 85 of file max6650.c.

#define MAX6650_CFG_MODE_OFF   0x10

Definition at line 87 of file max6650.c.

#define MAX6650_CFG_MODE_ON   0x00

Definition at line 86 of file max6650.c.

#define MAX6650_CFG_MODE_OPEN_LOOP   0x30

Definition at line 89 of file max6650.c.

#define MAX6650_CFG_PRESCALER_16   0x04

Definition at line 84 of file max6650.c.

#define MAX6650_CFG_PRESCALER_2   0x01

Definition at line 81 of file max6650.c.

#define MAX6650_CFG_PRESCALER_4   0x02

Definition at line 82 of file max6650.c.

#define MAX6650_CFG_PRESCALER_8   0x03

Definition at line 83 of file max6650.c.

#define MAX6650_CFG_PRESCALER_MASK   0x07

Definition at line 80 of file max6650.c.

#define MAX6650_CFG_V12   0x08

Definition at line 79 of file max6650.c.

#define MAX6650_COUNT_MASK   0x03

Definition at line 90 of file max6650.c.

#define MAX6650_REG_ALARM   0x0A

Definition at line 67 of file max6650.c.

#define MAX6650_REG_ALARM_EN   0x08

Definition at line 66 of file max6650.c.

#define MAX6650_REG_CONFIG   0x02

Definition at line 63 of file max6650.c.

#define MAX6650_REG_COUNT   0x16

Definition at line 73 of file max6650.c.

#define MAX6650_REG_DAC   0x06

Definition at line 65 of file max6650.c.

#define MAX6650_REG_GPIO_DEF   0x04

Definition at line 64 of file max6650.c.

#define MAX6650_REG_GPIO_STAT   0x14

Definition at line 72 of file max6650.c.

#define MAX6650_REG_SPEED   0x00

Definition at line 62 of file max6650.c.

#define MAX6650_REG_TACH0   0x0C

Definition at line 68 of file max6650.c.

#define MAX6650_REG_TACH1   0x0E

Definition at line 69 of file max6650.c.

#define MAX6650_REG_TACH2   0x10

Definition at line 70 of file max6650.c.

#define MAX6650_REG_TACH3   0x12

Definition at line 71 of file max6650.c.

Function Documentation

MODULE_AUTHOR ( "Hans J. Koch"  )
MODULE_DESCRIPTION ( "MAX6650 sensor driver )
MODULE_DEVICE_TABLE ( i2c  ,
max6650_id   
)
module_i2c_driver ( max6650_driver  )
MODULE_LICENSE ( "GPL"  )
module_param ( fan_voltage  ,
int  ,
S_IRUGO   
)
module_param ( prescaler  ,
int  ,
S_IRUGO   
)
module_param ( clock  ,
int  ,
S_IRUGO   
)