Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
max6639.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>
#include <linux/mutex.h>
#include <linux/i2c/max6639.h>

Go to the source code of this file.

Data Structures

struct  max6639_data
 

Macros

#define MAX6639_REG_TEMP(ch)   (0x00 + (ch))
 
#define MAX6639_REG_STATUS   0x02
 
#define MAX6639_REG_OUTPUT_MASK   0x03
 
#define MAX6639_REG_GCONFIG   0x04
 
#define MAX6639_REG_TEMP_EXT(ch)   (0x05 + (ch))
 
#define MAX6639_REG_ALERT_LIMIT(ch)   (0x08 + (ch))
 
#define MAX6639_REG_OT_LIMIT(ch)   (0x0A + (ch))
 
#define MAX6639_REG_THERM_LIMIT(ch)   (0x0C + (ch))
 
#define MAX6639_REG_FAN_CONFIG1(ch)   (0x10 + (ch) * 4)
 
#define MAX6639_REG_FAN_CONFIG2a(ch)   (0x11 + (ch) * 4)
 
#define MAX6639_REG_FAN_CONFIG2b(ch)   (0x12 + (ch) * 4)
 
#define MAX6639_REG_FAN_CONFIG3(ch)   (0x13 + (ch) * 4)
 
#define MAX6639_REG_FAN_CNT(ch)   (0x20 + (ch))
 
#define MAX6639_REG_TARGET_CNT(ch)   (0x22 + (ch))
 
#define MAX6639_REG_FAN_PPR(ch)   (0x24 + (ch))
 
#define MAX6639_REG_TARGTDUTY(ch)   (0x26 + (ch))
 
#define MAX6639_REG_FAN_START_TEMP(ch)   (0x28 + (ch))
 
#define MAX6639_REG_DEVID   0x3D
 
#define MAX6639_REG_MANUID   0x3E
 
#define MAX6639_REG_DEVREV   0x3F
 
#define MAX6639_GCONFIG_STANDBY   0x80
 
#define MAX6639_GCONFIG_POR   0x40
 
#define MAX6639_GCONFIG_DISABLE_TIMEOUT   0x20
 
#define MAX6639_GCONFIG_CH2_LOCAL   0x10
 
#define MAX6639_GCONFIG_PWM_FREQ_HI   0x08
 
#define MAX6639_FAN_CONFIG1_PWM   0x80
 
#define MAX6639_FAN_CONFIG3_THERM_FULL_SPEED   0x40
 
#define FAN_FROM_REG(val, rpm_range)
 
#define TEMP_LIMIT_TO_REG(val)   SENSORS_LIMIT((val) / 1000, 0, 255)
 

Functions

 MODULE_DEVICE_TABLE (i2c, max6639_id)
 
 module_i2c_driver (max6639_driver)
 
 MODULE_AUTHOR ("Roland Stigge <[email protected]>")
 
 MODULE_DESCRIPTION ("max6639 driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define FAN_FROM_REG (   val,
  rpm_range 
)
Value:
((val) == 0 || (val) == 255 ? \
0 : (rpm_ranges[rpm_range] * 30) / (val))

Definition at line 75 of file max6639.c.

#define MAX6639_FAN_CONFIG1_PWM   0x80

Definition at line 69 of file max6639.c.

#define MAX6639_FAN_CONFIG3_THERM_FULL_SPEED   0x40

Definition at line 71 of file max6639.c.

#define MAX6639_GCONFIG_CH2_LOCAL   0x10

Definition at line 66 of file max6639.c.

#define MAX6639_GCONFIG_DISABLE_TIMEOUT   0x20

Definition at line 65 of file max6639.c.

#define MAX6639_GCONFIG_POR   0x40

Definition at line 64 of file max6639.c.

#define MAX6639_GCONFIG_PWM_FREQ_HI   0x08

Definition at line 67 of file max6639.c.

#define MAX6639_GCONFIG_STANDBY   0x80

Definition at line 63 of file max6639.c.

#define MAX6639_REG_ALERT_LIMIT (   ch)    (0x08 + (ch))

Definition at line 46 of file max6639.c.

#define MAX6639_REG_DEVID   0x3D

Definition at line 58 of file max6639.c.

#define MAX6639_REG_DEVREV   0x3F

Definition at line 60 of file max6639.c.

#define MAX6639_REG_FAN_CNT (   ch)    (0x20 + (ch))

Definition at line 53 of file max6639.c.

#define MAX6639_REG_FAN_CONFIG1 (   ch)    (0x10 + (ch) * 4)

Definition at line 49 of file max6639.c.

#define MAX6639_REG_FAN_CONFIG2a (   ch)    (0x11 + (ch) * 4)

Definition at line 50 of file max6639.c.

#define MAX6639_REG_FAN_CONFIG2b (   ch)    (0x12 + (ch) * 4)

Definition at line 51 of file max6639.c.

#define MAX6639_REG_FAN_CONFIG3 (   ch)    (0x13 + (ch) * 4)

Definition at line 52 of file max6639.c.

#define MAX6639_REG_FAN_PPR (   ch)    (0x24 + (ch))

Definition at line 55 of file max6639.c.

#define MAX6639_REG_FAN_START_TEMP (   ch)    (0x28 + (ch))

Definition at line 57 of file max6639.c.

#define MAX6639_REG_GCONFIG   0x04

Definition at line 44 of file max6639.c.

#define MAX6639_REG_MANUID   0x3E

Definition at line 59 of file max6639.c.

#define MAX6639_REG_OT_LIMIT (   ch)    (0x0A + (ch))

Definition at line 47 of file max6639.c.

#define MAX6639_REG_OUTPUT_MASK   0x03

Definition at line 43 of file max6639.c.

#define MAX6639_REG_STATUS   0x02

Definition at line 42 of file max6639.c.

#define MAX6639_REG_TARGET_CNT (   ch)    (0x22 + (ch))

Definition at line 54 of file max6639.c.

#define MAX6639_REG_TARGTDUTY (   ch)    (0x26 + (ch))

Definition at line 56 of file max6639.c.

#define MAX6639_REG_TEMP (   ch)    (0x00 + (ch))

Definition at line 41 of file max6639.c.

#define MAX6639_REG_TEMP_EXT (   ch)    (0x05 + (ch))

Definition at line 45 of file max6639.c.

#define MAX6639_REG_THERM_LIMIT (   ch)    (0x0C + (ch))

Definition at line 48 of file max6639.c.

#define TEMP_LIMIT_TO_REG (   val)    SENSORS_LIMIT((val) / 1000, 0, 255)

Definition at line 77 of file max6639.c.

Function Documentation

MODULE_AUTHOR ( "Roland Stigge <[email protected]>"  )
MODULE_DESCRIPTION ( "max6639 driver )
MODULE_DEVICE_TABLE ( i2c  ,
max6639_id   
)
module_i2c_driver ( max6639_driver  )
MODULE_LICENSE ( "GPL"  )