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

Go to the source code of this file.

Data Structures

struct  lm63_data
 

Macros

#define LM63_REG_CONFIG1   0x03
 
#define LM63_REG_CONVRATE   0x04
 
#define LM63_REG_CONFIG2   0xBF
 
#define LM63_REG_CONFIG_FAN   0x4A
 
#define LM63_REG_TACH_COUNT_MSB   0x47
 
#define LM63_REG_TACH_COUNT_LSB   0x46
 
#define LM63_REG_TACH_LIMIT_MSB   0x49
 
#define LM63_REG_TACH_LIMIT_LSB   0x48
 
#define LM63_REG_PWM_VALUE   0x4C
 
#define LM63_REG_PWM_FREQ   0x4D
 
#define LM63_REG_LUT_TEMP_HYST   0x4F
 
#define LM63_REG_LUT_TEMP(nr)   (0x50 + 2 * (nr))
 
#define LM63_REG_LUT_PWM(nr)   (0x51 + 2 * (nr))
 
#define LM63_REG_LOCAL_TEMP   0x00
 
#define LM63_REG_LOCAL_HIGH   0x05
 
#define LM63_REG_REMOTE_TEMP_MSB   0x01
 
#define LM63_REG_REMOTE_TEMP_LSB   0x10
 
#define LM63_REG_REMOTE_OFFSET_MSB   0x11
 
#define LM63_REG_REMOTE_OFFSET_LSB   0x12
 
#define LM63_REG_REMOTE_HIGH_MSB   0x07
 
#define LM63_REG_REMOTE_HIGH_LSB   0x13
 
#define LM63_REG_REMOTE_LOW_MSB   0x08
 
#define LM63_REG_REMOTE_LOW_LSB   0x14
 
#define LM63_REG_REMOTE_TCRIT   0x19
 
#define LM63_REG_REMOTE_TCRIT_HYST   0x21
 
#define LM63_REG_ALERT_STATUS   0x02
 
#define LM63_REG_ALERT_MASK   0x16
 
#define LM63_REG_MAN_ID   0xFE
 
#define LM63_REG_CHIP_ID   0xFF
 
#define LM96163_REG_TRUTHERM   0x30
 
#define LM96163_REG_REMOTE_TEMP_U_MSB   0x31
 
#define LM96163_REG_REMOTE_TEMP_U_LSB   0x32
 
#define LM96163_REG_CONFIG_ENHANCED   0x45
 
#define LM63_MAX_CONVRATE   9
 
#define LM63_MAX_CONVRATE_HZ   32
 
#define LM96163_MAX_CONVRATE_HZ   26
 
#define FAN_FROM_REG(reg)
 
#define FAN_TO_REG(val)
 
#define TEMP8_FROM_REG(reg)   ((reg) * 1000)
 
#define TEMP8_TO_REG(val)
 
#define TEMP8U_TO_REG(val)
 
#define TEMP11_FROM_REG(reg)   ((reg) / 32 * 125)
 
#define TEMP11_TO_REG(val)
 
#define TEMP11U_TO_REG(val)
 
#define HYST_TO_REG(val)
 
#define UPDATE_INTERVAL(max, rate)   ((1000 << (LM63_MAX_CONVRATE - (rate))) / (max))
 

Enumerations

enum  chips {
  ad7416, ad7417, ad7418, adm1021,
  adm1023, max1617, max1617a, thmc10,
  lm84, gl523sm, mc1066, adm1025,
  ne1619, adm1030, adm1031, adm9240,
  ds1780, lm81, adt7473, adt7475,
  adt7476, adt7490, amc6821, dme1737,
  sch5027, sch311x, sch5127, f71808e,
  f71808a, f71858fg, f71862fg, f71869,
  f71869a, f71882fg, f71889fg, f71889ed,
  f71889a, f8000, f81865f, f75373,
  f75375, f75387, fscpos, fscher,
  fscscy, fschrc, fschmd, fschds,
  fscsyl, gl518sm_r00, gl518sm_r80, it87,
  it8712, it8716, it8718, it8720,
  it8721, it8728, it8782, it8783,
  lm63, lm64, lm96163, lm78,
  lm79, lm83, lm82, any_chip,
  lm85b, lm85c, adm1027, adt7463,
  adt7468, emc6d100, emc6d102, emc6d103,
  emc6d103s, lm87, adm1024, lm90,
  adm1032, lm99, lm86, max6657,
  max6659, adt7461, max6680, max6646,
  w83l771, max6696, sa56004, g781,
  max1110, max1111, max1112, max1113,
  max16065, max16066, max16067, max16068,
  max16070, max16071, max1668, max1805,
  max1989, mcp3021, mcp3221, adm1075,
  adm1275, adm1276, lm25066, lm5064,
  lm5066, ltc2978, ltc3880, max34440,
  max34441, max34446, ucd9000, ucd90120,
  ucd90124, ucd9090, ucd90910, ucd9200,
  ucd9220, ucd9222, ucd9224, ucd9240,
  ucd9244, ucd9246, ucd9248, zl2004,
  zl2005, zl2006, zl2008, zl2105,
  zl2106, zl6100, zl6105, zl9101,
  zl9117, smm465, smm665, smm665c,
  smm764, smm766, smsc47m1, smsc47m2,
  thmc50, adm1022, tmp401, tmp411,
  tmp421, tmp422, tmp423, w83627hf,
  w83627thf, w83697hf, w83637hf, w83687thf,
  w83781d, w83782d, w83783s, as99127f,
  DC21040 = 0, DC21041 = 1, DC21140 = 2, DC21142 = 3,
  DC21143 = 3, LC82C168, MX98713, MX98715,
  MX98725, AX88140, PNIC2, COMET,
  COMPEX9881, I21145, DM910X, CONEXANT,
  TPS62360, TPS62361, TPS62362, TPS62363,
  sc18is602, sc18is602b, sc18is603, f71808fg,
  f71858fg, f71862fg, f71869, f71882fg,
  f71889fg
}
 

Functions

 MODULE_DEVICE_TABLE (i2c, lm63_id)
 
 module_i2c_driver (lm63_driver)
 
 MODULE_AUTHOR ("Jean Delvare <[email protected]>")
 
 MODULE_DESCRIPTION ("LM63 driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define FAN_FROM_REG (   reg)
Value:
((reg) == 0xFFFC || (reg) == 0 ? 0 : \
5400000 / (reg))

Definition at line 124 of file lm63.c.

#define FAN_TO_REG (   val)
Value:
((val) <= 82 ? 0xFFFC : \
(5400000 / (val)) & 0xFFFC)

Definition at line 126 of file lm63.c.

#define HYST_TO_REG (   val)
Value:
((val) <= 0 ? 0 : \
(val) >= 127000 ? 127 : \
((val) + 500) / 1000)

Definition at line 144 of file lm63.c.

#define LM63_MAX_CONVRATE   9

Definition at line 107 of file lm63.c.

#define LM63_MAX_CONVRATE_HZ   32

Definition at line 109 of file lm63.c.

#define LM63_REG_ALERT_MASK   0x16

Definition at line 97 of file lm63.c.

#define LM63_REG_ALERT_STATUS   0x02

Definition at line 96 of file lm63.c.

#define LM63_REG_CHIP_ID   0xFF

Definition at line 100 of file lm63.c.

#define LM63_REG_CONFIG1   0x03

Definition at line 66 of file lm63.c.

#define LM63_REG_CONFIG2   0xBF

Definition at line 68 of file lm63.c.

#define LM63_REG_CONFIG_FAN   0x4A

Definition at line 69 of file lm63.c.

#define LM63_REG_CONVRATE   0x04

Definition at line 67 of file lm63.c.

#define LM63_REG_LOCAL_HIGH   0x05

Definition at line 83 of file lm63.c.

#define LM63_REG_LOCAL_TEMP   0x00

Definition at line 82 of file lm63.c.

#define LM63_REG_LUT_PWM (   nr)    (0x51 + 2 * (nr))

Definition at line 80 of file lm63.c.

#define LM63_REG_LUT_TEMP (   nr)    (0x50 + 2 * (nr))

Definition at line 79 of file lm63.c.

#define LM63_REG_LUT_TEMP_HYST   0x4F

Definition at line 78 of file lm63.c.

#define LM63_REG_MAN_ID   0xFE

Definition at line 99 of file lm63.c.

#define LM63_REG_PWM_FREQ   0x4D

Definition at line 77 of file lm63.c.

#define LM63_REG_PWM_VALUE   0x4C

Definition at line 76 of file lm63.c.

#define LM63_REG_REMOTE_HIGH_LSB   0x13

Definition at line 90 of file lm63.c.

#define LM63_REG_REMOTE_HIGH_MSB   0x07

Definition at line 89 of file lm63.c.

#define LM63_REG_REMOTE_LOW_LSB   0x14

Definition at line 92 of file lm63.c.

#define LM63_REG_REMOTE_LOW_MSB   0x08

Definition at line 91 of file lm63.c.

#define LM63_REG_REMOTE_OFFSET_LSB   0x12

Definition at line 88 of file lm63.c.

#define LM63_REG_REMOTE_OFFSET_MSB   0x11

Definition at line 87 of file lm63.c.

#define LM63_REG_REMOTE_TCRIT   0x19

Definition at line 93 of file lm63.c.

#define LM63_REG_REMOTE_TCRIT_HYST   0x21

Definition at line 94 of file lm63.c.

#define LM63_REG_REMOTE_TEMP_LSB   0x10

Definition at line 86 of file lm63.c.

#define LM63_REG_REMOTE_TEMP_MSB   0x01

Definition at line 85 of file lm63.c.

#define LM63_REG_TACH_COUNT_LSB   0x46

Definition at line 72 of file lm63.c.

#define LM63_REG_TACH_COUNT_MSB   0x47

Definition at line 71 of file lm63.c.

#define LM63_REG_TACH_LIMIT_LSB   0x48

Definition at line 74 of file lm63.c.

#define LM63_REG_TACH_LIMIT_MSB   0x49

Definition at line 73 of file lm63.c.

#define LM96163_MAX_CONVRATE_HZ   26

Definition at line 110 of file lm63.c.

#define LM96163_REG_CONFIG_ENHANCED   0x45

Definition at line 105 of file lm63.c.

#define LM96163_REG_REMOTE_TEMP_U_LSB   0x32

Definition at line 104 of file lm63.c.

#define LM96163_REG_REMOTE_TEMP_U_MSB   0x31

Definition at line 103 of file lm63.c.

#define LM96163_REG_TRUTHERM   0x30

Definition at line 102 of file lm63.c.

#define TEMP11_FROM_REG (   reg)    ((reg) / 32 * 125)

Definition at line 136 of file lm63.c.

#define TEMP11_TO_REG (   val)
Value:
((val) <= -128000 ? 0x8000 : \
(val) >= 127875 ? 0x7FE0 : \
(val) < 0 ? ((val) - 62) / 125 * 32 : \
((val) + 62) / 125 * 32)

Definition at line 137 of file lm63.c.

#define TEMP11U_TO_REG (   val)
Value:
((val) <= 0 ? 0 : \
(val) >= 255875 ? 0xFFE0 : \
((val) + 62) / 125 * 32)

Definition at line 141 of file lm63.c.

#define TEMP8_FROM_REG (   reg)    ((reg) * 1000)

Definition at line 128 of file lm63.c.

#define TEMP8_TO_REG (   val)
Value:
((val) <= -128000 ? -128 : \
(val) >= 127000 ? 127 : \
(val) < 0 ? ((val) - 500) / 1000 : \
((val) + 500) / 1000)

Definition at line 129 of file lm63.c.

#define TEMP8U_TO_REG (   val)
Value:
((val) <= 0 ? 0 : \
(val) >= 255000 ? 255 : \
((val) + 500) / 1000)

Definition at line 133 of file lm63.c.

#define UPDATE_INTERVAL (   max,
  rate 
)    ((1000 << (LM63_MAX_CONVRATE - (rate))) / (max))

Definition at line 148 of file lm63.c.

Enumeration Type Documentation

enum chips
Enumerator:
ad7416 
ad7417 
ad7418 
adm1021 
adm1023 
max1617 
max1617a 
thmc10 
lm84 
gl523sm 
mc1066 
adm1025 
ne1619 
adm1030 
adm1031 
adm9240 
ds1780 
lm81 
adt7473 
adt7475 
adt7476 
adt7490 
amc6821 
dme1737 
sch5027 
sch311x 
sch5127 
f71808e 
f71808a 
f71858fg 
f71862fg 
f71869 
f71869a 
f71882fg 
f71889fg 
f71889ed 
f71889a 
f8000 
f81865f 
f75373 
f75375 
f75387 
fscpos 
fscher 
fscscy 
fschrc 
fschmd 
fschds 
fscsyl 
gl518sm_r00 
gl518sm_r80 
it87 
it8712 
it8716 
it8718 
it8720 
it8721 
it8728 
it8782 
it8783 
lm63 
lm64 
lm96163 
lm78 
lm79 
lm83 
lm82 
any_chip 
lm85b 
lm85c 
adm1027 
adt7463 
adt7468 
emc6d100 
emc6d102 
emc6d103 
emc6d103s 
lm87 
adm1024 
lm90 
adm1032 
lm99 
lm86 
max6657 
max6659 
adt7461 
max6680 
max6646 
w83l771 
max6696 
sa56004 
g781 
max1110 
max1111 
max1112 
max1113 
max16065 
max16066 
max16067 
max16068 
max16070 
max16071 
max1668 
max1805 
max1989 
mcp3021 
mcp3221 
adm1075 
adm1275 
adm1276 
lm25066 
lm5064 
lm5066 
ltc2978 
ltc3880 
max34440 
max34441 
max34446 
ucd9000 
ucd90120 
ucd90124 
ucd9090 
ucd90910 
ucd9200 
ucd9220 
ucd9222 
ucd9224 
ucd9240 
ucd9244 
ucd9246 
ucd9248 
zl2004 
zl2005 
zl2006 
zl2008 
zl2105 
zl2106 
zl6100 
zl6105 
zl9101 
zl9117 
smm465 
smm665 
smm665c 
smm764 
smm766 
smsc47m1 
smsc47m2 
thmc50 
adm1022 
tmp401 
tmp411 
tmp421 
tmp422 
tmp423 
w83627hf 
w83627thf 
w83697hf 
w83637hf 
w83687thf 
w83781d 
w83782d 
w83783s 
as99127f 
DC21040 
DC21041 
DC21140 
DC21142 
DC21143 
LC82C168 
MX98713 
MX98715 
MX98725 
AX88140 
PNIC2 
COMET 
COMPEX9881 
I21145 
DM910X 
CONEXANT 
TPS62360 
TPS62361 
TPS62362 
TPS62363 
sc18is602 
sc18is602b 
sc18is603 
f71808fg 
f71858fg 
f71862fg 
f71869 
f71882fg 
f71889fg 

Definition at line 151 of file lm63.c.

Function Documentation

MODULE_AUTHOR ( "Jean Delvare <[email protected]>"  )
MODULE_DESCRIPTION ( "LM63 driver )
MODULE_DEVICE_TABLE ( i2c  ,
lm63_id   
)
module_i2c_driver ( lm63_driver  )
MODULE_LICENSE ( "GPL"  )