Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
amc6821.c File Reference
#include <linux/kernel.h>
#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>

Go to the source code of this file.

Data Structures

struct  amc6821_data
 

Macros

#define AMC6821_REG_DEV_ID   0x3D
 
#define AMC6821_REG_COMP_ID   0x3E
 
#define AMC6821_REG_CONF1   0x00
 
#define AMC6821_REG_CONF2   0x01
 
#define AMC6821_REG_CONF3   0x3F
 
#define AMC6821_REG_CONF4   0x04
 
#define AMC6821_REG_STAT1   0x02
 
#define AMC6821_REG_STAT2   0x03
 
#define AMC6821_REG_TDATA_LOW   0x08
 
#define AMC6821_REG_TDATA_HI   0x09
 
#define AMC6821_REG_LTEMP_HI   0x0A
 
#define AMC6821_REG_RTEMP_HI   0x0B
 
#define AMC6821_REG_LTEMP_LIMIT_MIN   0x15
 
#define AMC6821_REG_LTEMP_LIMIT_MAX   0x14
 
#define AMC6821_REG_RTEMP_LIMIT_MIN   0x19
 
#define AMC6821_REG_RTEMP_LIMIT_MAX   0x18
 
#define AMC6821_REG_LTEMP_CRIT   0x1B
 
#define AMC6821_REG_RTEMP_CRIT   0x1D
 
#define AMC6821_REG_PSV_TEMP   0x1C
 
#define AMC6821_REG_DCY   0x22
 
#define AMC6821_REG_LTEMP_FAN_CTRL   0x24
 
#define AMC6821_REG_RTEMP_FAN_CTRL   0x25
 
#define AMC6821_REG_DCY_LOW_TEMP   0x21
 
#define AMC6821_REG_TACH_LLIMITL   0x10
 
#define AMC6821_REG_TACH_LLIMITH   0x11
 
#define AMC6821_REG_TACH_HLIMITL   0x12
 
#define AMC6821_REG_TACH_HLIMITH   0x13
 
#define AMC6821_CONF1_START   0x01
 
#define AMC6821_CONF1_FAN_INT_EN   0x02
 
#define AMC6821_CONF1_FANIE   0x04
 
#define AMC6821_CONF1_PWMINV   0x08
 
#define AMC6821_CONF1_FAN_FAULT_EN   0x10
 
#define AMC6821_CONF1_FDRC0   0x20
 
#define AMC6821_CONF1_FDRC1   0x40
 
#define AMC6821_CONF1_THERMOVIE   0x80
 
#define AMC6821_CONF2_PWM_EN   0x01
 
#define AMC6821_CONF2_TACH_MODE   0x02
 
#define AMC6821_CONF2_TACH_EN   0x04
 
#define AMC6821_CONF2_RTFIE   0x08
 
#define AMC6821_CONF2_LTOIE   0x10
 
#define AMC6821_CONF2_RTOIE   0x20
 
#define AMC6821_CONF2_PSVIE   0x40
 
#define AMC6821_CONF2_RST   0x80
 
#define AMC6821_CONF3_THERM_FAN_EN   0x80
 
#define AMC6821_CONF3_REV_MASK   0x0F
 
#define AMC6821_CONF4_OVREN   0x10
 
#define AMC6821_CONF4_TACH_FAST   0x20
 
#define AMC6821_CONF4_PSPR   0x40
 
#define AMC6821_CONF4_MODE   0x80
 
#define AMC6821_STAT1_RPM_ALARM   0x01
 
#define AMC6821_STAT1_FANS   0x02
 
#define AMC6821_STAT1_RTH   0x04
 
#define AMC6821_STAT1_RTL   0x08
 
#define AMC6821_STAT1_R_THERM   0x10
 
#define AMC6821_STAT1_RTF   0x20
 
#define AMC6821_STAT1_LTH   0x40
 
#define AMC6821_STAT1_LTL   0x80
 
#define AMC6821_STAT2_RTC   0x08
 
#define AMC6821_STAT2_LTC   0x10
 
#define AMC6821_STAT2_LPSV   0x20
 
#define AMC6821_STAT2_L_THERM   0x40
 
#define AMC6821_STAT2_THERM_IN   0x80
 

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
}
 
enum  {
  IDX_TEMP1_INPUT = 0, IDX_TEMP1_MIN, IDX_TEMP1_MAX, IDX_TEMP1_CRIT,
  IDX_TEMP2_INPUT, IDX_TEMP2_MIN, IDX_TEMP2_MAX, IDX_TEMP2_CRIT,
  TEMP_IDX_LEN
}
 
enum  { IDX_FAN1_INPUT = 0, IDX_FAN1_MIN, IDX_FAN1_MAX, FAN1_IDX_LEN }
 

Functions

 module_param (pwminv, int, S_IRUGO)
 
 module_param (init, int, S_IRUGO)
 
 MODULE_DEVICE_TABLE (i2c, amc6821_id)
 
 module_i2c_driver (amc6821_driver)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("T. Mertelj <[email protected]>")
 
 MODULE_DESCRIPTION ("Texas Instruments amc6821 hwmon driver")
 

Macro Definition Documentation

#define AMC6821_CONF1_FAN_FAULT_EN   0x10

Definition at line 92 of file amc6821.c.

#define AMC6821_CONF1_FAN_INT_EN   0x02

Definition at line 89 of file amc6821.c.

#define AMC6821_CONF1_FANIE   0x04

Definition at line 90 of file amc6821.c.

#define AMC6821_CONF1_FDRC0   0x20

Definition at line 93 of file amc6821.c.

#define AMC6821_CONF1_FDRC1   0x40

Definition at line 94 of file amc6821.c.

#define AMC6821_CONF1_PWMINV   0x08

Definition at line 91 of file amc6821.c.

#define AMC6821_CONF1_START   0x01

Definition at line 88 of file amc6821.c.

#define AMC6821_CONF1_THERMOVIE   0x80

Definition at line 95 of file amc6821.c.

#define AMC6821_CONF2_LTOIE   0x10

Definition at line 101 of file amc6821.c.

#define AMC6821_CONF2_PSVIE   0x40

Definition at line 103 of file amc6821.c.

#define AMC6821_CONF2_PWM_EN   0x01

Definition at line 97 of file amc6821.c.

#define AMC6821_CONF2_RST   0x80

Definition at line 104 of file amc6821.c.

#define AMC6821_CONF2_RTFIE   0x08

Definition at line 100 of file amc6821.c.

#define AMC6821_CONF2_RTOIE   0x20

Definition at line 102 of file amc6821.c.

#define AMC6821_CONF2_TACH_EN   0x04

Definition at line 99 of file amc6821.c.

#define AMC6821_CONF2_TACH_MODE   0x02

Definition at line 98 of file amc6821.c.

#define AMC6821_CONF3_REV_MASK   0x0F

Definition at line 107 of file amc6821.c.

#define AMC6821_CONF3_THERM_FAN_EN   0x80

Definition at line 106 of file amc6821.c.

#define AMC6821_CONF4_MODE   0x80

Definition at line 112 of file amc6821.c.

#define AMC6821_CONF4_OVREN   0x10

Definition at line 109 of file amc6821.c.

#define AMC6821_CONF4_PSPR   0x40

Definition at line 111 of file amc6821.c.

#define AMC6821_CONF4_TACH_FAST   0x20

Definition at line 110 of file amc6821.c.

#define AMC6821_REG_COMP_ID   0x3E

Definition at line 60 of file amc6821.c.

#define AMC6821_REG_CONF1   0x00

Definition at line 61 of file amc6821.c.

#define AMC6821_REG_CONF2   0x01

Definition at line 62 of file amc6821.c.

#define AMC6821_REG_CONF3   0x3F

Definition at line 63 of file amc6821.c.

#define AMC6821_REG_CONF4   0x04

Definition at line 64 of file amc6821.c.

#define AMC6821_REG_DCY   0x22

Definition at line 78 of file amc6821.c.

#define AMC6821_REG_DCY_LOW_TEMP   0x21

Definition at line 81 of file amc6821.c.

#define AMC6821_REG_DEV_ID   0x3D

Definition at line 59 of file amc6821.c.

#define AMC6821_REG_LTEMP_CRIT   0x1B

Definition at line 75 of file amc6821.c.

#define AMC6821_REG_LTEMP_FAN_CTRL   0x24

Definition at line 79 of file amc6821.c.

#define AMC6821_REG_LTEMP_HI   0x0A

Definition at line 69 of file amc6821.c.

#define AMC6821_REG_LTEMP_LIMIT_MAX   0x14

Definition at line 72 of file amc6821.c.

#define AMC6821_REG_LTEMP_LIMIT_MIN   0x15

Definition at line 71 of file amc6821.c.

#define AMC6821_REG_PSV_TEMP   0x1C

Definition at line 77 of file amc6821.c.

#define AMC6821_REG_RTEMP_CRIT   0x1D

Definition at line 76 of file amc6821.c.

#define AMC6821_REG_RTEMP_FAN_CTRL   0x25

Definition at line 80 of file amc6821.c.

#define AMC6821_REG_RTEMP_HI   0x0B

Definition at line 70 of file amc6821.c.

#define AMC6821_REG_RTEMP_LIMIT_MAX   0x18

Definition at line 74 of file amc6821.c.

#define AMC6821_REG_RTEMP_LIMIT_MIN   0x19

Definition at line 73 of file amc6821.c.

#define AMC6821_REG_STAT1   0x02

Definition at line 65 of file amc6821.c.

#define AMC6821_REG_STAT2   0x03

Definition at line 66 of file amc6821.c.

#define AMC6821_REG_TACH_HLIMITH   0x13

Definition at line 86 of file amc6821.c.

#define AMC6821_REG_TACH_HLIMITL   0x12

Definition at line 85 of file amc6821.c.

#define AMC6821_REG_TACH_LLIMITH   0x11

Definition at line 84 of file amc6821.c.

#define AMC6821_REG_TACH_LLIMITL   0x10

Definition at line 83 of file amc6821.c.

#define AMC6821_REG_TDATA_HI   0x09

Definition at line 68 of file amc6821.c.

#define AMC6821_REG_TDATA_LOW   0x08

Definition at line 67 of file amc6821.c.

#define AMC6821_STAT1_FANS   0x02

Definition at line 115 of file amc6821.c.

#define AMC6821_STAT1_LTH   0x40

Definition at line 120 of file amc6821.c.

#define AMC6821_STAT1_LTL   0x80

Definition at line 121 of file amc6821.c.

#define AMC6821_STAT1_R_THERM   0x10

Definition at line 118 of file amc6821.c.

#define AMC6821_STAT1_RPM_ALARM   0x01

Definition at line 114 of file amc6821.c.

#define AMC6821_STAT1_RTF   0x20

Definition at line 119 of file amc6821.c.

#define AMC6821_STAT1_RTH   0x04

Definition at line 116 of file amc6821.c.

#define AMC6821_STAT1_RTL   0x08

Definition at line 117 of file amc6821.c.

#define AMC6821_STAT2_L_THERM   0x40

Definition at line 126 of file amc6821.c.

#define AMC6821_STAT2_LPSV   0x20

Definition at line 125 of file amc6821.c.

#define AMC6821_STAT2_LTC   0x10

Definition at line 124 of file amc6821.c.

#define AMC6821_STAT2_RTC   0x08

Definition at line 123 of file amc6821.c.

#define AMC6821_STAT2_THERM_IN   0x80

Definition at line 127 of file amc6821.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
IDX_TEMP1_INPUT 
IDX_TEMP1_MIN 
IDX_TEMP1_MAX 
IDX_TEMP1_CRIT 
IDX_TEMP2_INPUT 
IDX_TEMP2_MIN 
IDX_TEMP2_MAX 
IDX_TEMP2_CRIT 
TEMP_IDX_LEN 

Definition at line 129 of file amc6821.c.

anonymous enum
Enumerator:
IDX_FAN1_INPUT 
IDX_FAN1_MIN 
IDX_FAN1_MAX 
FAN1_IDX_LEN 

Definition at line 143 of file amc6821.c.

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 57 of file amc6821.c.

Function Documentation

MODULE_AUTHOR ( "T. Mertelj <[email protected]>"  )
MODULE_DESCRIPTION ( "Texas Instruments amc6821 hwmon driver )
MODULE_DEVICE_TABLE ( i2c  ,
amc6821_id   
)
module_i2c_driver ( amc6821_driver  )
MODULE_LICENSE ( "GPL"  )
module_param ( pwminv  ,
int  ,
S_IRUGO   
)
module_param ( init  ,
int  ,
S_IRUGO   
)