Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
adt7475.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/hwmon-vid.h>
#include <linux/err.h>
#include <linux/jiffies.h>

Go to the source code of this file.

Data Structures

struct  adt7475_data
 

Macros

#define INPUT   0
 
#define MIN   1
 
#define MAX   2
 
#define CONTROL   3
 
#define OFFSET   3
 
#define AUTOMIN   4
 
#define THERM   5
 
#define HYSTERSIS   6
 
#define ALARM   9
 
#define FAULT   10
 
#define REG_DEVREV2   0x12 /* ADT7490 only */
 
#define REG_VTT   0x1E /* ADT7490 only */
 
#define REG_EXTEND3   0x1F /* ADT7490 only */
 
#define REG_VOLTAGE_BASE   0x20
 
#define REG_TEMP_BASE   0x25
 
#define REG_TACH_BASE   0x28
 
#define REG_PWM_BASE   0x30
 
#define REG_PWM_MAX_BASE   0x38
 
#define REG_DEVID   0x3D
 
#define REG_VENDID   0x3E
 
#define REG_DEVID2   0x3F
 
#define REG_STATUS1   0x41
 
#define REG_STATUS2   0x42
 
#define REG_VID   0x43 /* ADT7476 only */
 
#define REG_VOLTAGE_MIN_BASE   0x44
 
#define REG_VOLTAGE_MAX_BASE   0x45
 
#define REG_TEMP_MIN_BASE   0x4E
 
#define REG_TEMP_MAX_BASE   0x4F
 
#define REG_TACH_MIN_BASE   0x54
 
#define REG_PWM_CONFIG_BASE   0x5C
 
#define REG_TEMP_TRANGE_BASE   0x5F
 
#define REG_PWM_MIN_BASE   0x64
 
#define REG_TEMP_TMIN_BASE   0x67
 
#define REG_TEMP_THERM_BASE   0x6A
 
#define REG_REMOTE1_HYSTERSIS   0x6D
 
#define REG_REMOTE2_HYSTERSIS   0x6E
 
#define REG_TEMP_OFFSET_BASE   0x70
 
#define REG_CONFIG2   0x73
 
#define REG_EXTEND1   0x76
 
#define REG_EXTEND2   0x77
 
#define REG_CONFIG3   0x78
 
#define REG_CONFIG5   0x7C
 
#define REG_CONFIG4   0x7D
 
#define REG_STATUS4   0x81 /* ADT7490 only */
 
#define REG_VTT_MIN   0x84 /* ADT7490 only */
 
#define REG_VTT_MAX   0x86 /* ADT7490 only */
 
#define VID_VIDSEL   0x80 /* ADT7476 only */
 
#define CONFIG2_ATTN   0x20
 
#define CONFIG3_SMBALERT   0x01
 
#define CONFIG3_THERM   0x02
 
#define CONFIG4_PINFUNC   0x03
 
#define CONFIG4_MAXDUTY   0x08
 
#define CONFIG4_ATTN_IN10   0x30
 
#define CONFIG4_ATTN_IN43   0xC0
 
#define CONFIG5_TWOSCOMP   0x01
 
#define CONFIG5_TEMPOFFSET   0x02
 
#define CONFIG5_VIDGPIO   0x10 /* ADT7476 only */
 
#define ADT7475_VOLTAGE_COUNT   5 /* Not counting Vtt */
 
#define ADT7475_TEMP_COUNT   3
 
#define ADT7475_TACH_COUNT   4
 
#define ADT7475_PWM_COUNT   3
 
#define adt7475_read(reg)   i2c_smbus_read_byte_data(client, (reg))
 
#define TACH_REG(idx)   (REG_TACH_BASE + ((idx) * 2))
 
#define TACH_MIN_REG(idx)   (REG_TACH_MIN_BASE + ((idx) * 2))
 
#define PWM_REG(idx)   (REG_PWM_BASE + (idx))
 
#define PWM_MAX_REG(idx)   (REG_PWM_MAX_BASE + (idx))
 
#define PWM_MIN_REG(idx)   (REG_PWM_MIN_BASE + (idx))
 
#define PWM_CONFIG_REG(idx)   (REG_PWM_CONFIG_BASE + (idx))
 
#define VOLTAGE_REG(idx)   (REG_VOLTAGE_BASE + (idx))
 
#define VOLTAGE_MIN_REG(idx)   (REG_VOLTAGE_MIN_BASE + ((idx) * 2))
 
#define VOLTAGE_MAX_REG(idx)   (REG_VOLTAGE_MAX_BASE + ((idx) * 2))
 
#define TEMP_REG(idx)   (REG_TEMP_BASE + (idx))
 
#define TEMP_MIN_REG(idx)   (REG_TEMP_MIN_BASE + ((idx) * 2))
 
#define TEMP_MAX_REG(idx)   (REG_TEMP_MAX_BASE + ((idx) * 2))
 
#define TEMP_TMIN_REG(idx)   (REG_TEMP_TMIN_BASE + (idx))
 
#define TEMP_THERM_REG(idx)   (REG_TEMP_THERM_BASE + (idx))
 
#define TEMP_OFFSET_REG(idx)   (REG_TEMP_OFFSET_BASE + (idx))
 
#define TEMP_TRANGE_REG(idx)   (REG_TEMP_TRANGE_BASE + (idx))
 

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, adt7475_id)
 
 module_i2c_driver (adt7475_driver)
 
 MODULE_AUTHOR ("Advanced Micro Devices, Inc")
 
 MODULE_DESCRIPTION ("adt7475 driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ADT7475_PWM_COUNT   3

Definition at line 123 of file adt7475.c.

#define adt7475_read (   reg)    i2c_smbus_read_byte_data(client, (reg))

Definition at line 127 of file adt7475.c.

#define ADT7475_TACH_COUNT   4

Definition at line 122 of file adt7475.c.

#define ADT7475_TEMP_COUNT   3

Definition at line 121 of file adt7475.c.

#define ADT7475_VOLTAGE_COUNT   5 /* Not counting Vtt */

Definition at line 120 of file adt7475.c.

#define ALARM   9

Definition at line 41 of file adt7475.c.

#define AUTOMIN   4

Definition at line 32 of file adt7475.c.

#define CONFIG2_ATTN   0x20

Definition at line 104 of file adt7475.c.

#define CONFIG3_SMBALERT   0x01

Definition at line 106 of file adt7475.c.

#define CONFIG3_THERM   0x02

Definition at line 107 of file adt7475.c.

#define CONFIG4_ATTN_IN10   0x30

Definition at line 111 of file adt7475.c.

#define CONFIG4_ATTN_IN43   0xC0

Definition at line 112 of file adt7475.c.

#define CONFIG4_MAXDUTY   0x08

Definition at line 110 of file adt7475.c.

#define CONFIG4_PINFUNC   0x03

Definition at line 109 of file adt7475.c.

#define CONFIG5_TEMPOFFSET   0x02

Definition at line 115 of file adt7475.c.

#define CONFIG5_TWOSCOMP   0x01

Definition at line 114 of file adt7475.c.

#define CONFIG5_VIDGPIO   0x10 /* ADT7476 only */

Definition at line 116 of file adt7475.c.

#define CONTROL   3

Definition at line 30 of file adt7475.c.

#define FAULT   10

Definition at line 42 of file adt7475.c.

#define HYSTERSIS   6

Definition at line 34 of file adt7475.c.

#define INPUT   0

Definition at line 27 of file adt7475.c.

#define MAX   2

Definition at line 29 of file adt7475.c.

#define MIN   1

Definition at line 28 of file adt7475.c.

#define OFFSET   3

Definition at line 31 of file adt7475.c.

#define PWM_CONFIG_REG (   idx)    (REG_PWM_CONFIG_BASE + (idx))

Definition at line 137 of file adt7475.c.

#define PWM_MAX_REG (   idx)    (REG_PWM_MAX_BASE + (idx))

Definition at line 135 of file adt7475.c.

#define PWM_MIN_REG (   idx)    (REG_PWM_MIN_BASE + (idx))

Definition at line 136 of file adt7475.c.

#define PWM_REG (   idx)    (REG_PWM_BASE + (idx))

Definition at line 134 of file adt7475.c.

#define REG_CONFIG2   0x73

Definition at line 88 of file adt7475.c.

#define REG_CONFIG3   0x78

Definition at line 93 of file adt7475.c.

#define REG_CONFIG4   0x7D

Definition at line 95 of file adt7475.c.

#define REG_CONFIG5   0x7C

Definition at line 94 of file adt7475.c.

#define REG_DEVID   0x3D

Definition at line 57 of file adt7475.c.

#define REG_DEVID2   0x3F

Definition at line 59 of file adt7475.c.

#define REG_DEVREV2   0x12 /* ADT7490 only */

Definition at line 46 of file adt7475.c.

#define REG_EXTEND1   0x76

Definition at line 90 of file adt7475.c.

#define REG_EXTEND2   0x77

Definition at line 91 of file adt7475.c.

#define REG_EXTEND3   0x1F /* ADT7490 only */

Definition at line 49 of file adt7475.c.

#define REG_PWM_BASE   0x30

Definition at line 54 of file adt7475.c.

#define REG_PWM_CONFIG_BASE   0x5C

Definition at line 74 of file adt7475.c.

#define REG_PWM_MAX_BASE   0x38

Definition at line 55 of file adt7475.c.

#define REG_PWM_MIN_BASE   0x64

Definition at line 78 of file adt7475.c.

#define REG_REMOTE1_HYSTERSIS   0x6D

Definition at line 83 of file adt7475.c.

#define REG_REMOTE2_HYSTERSIS   0x6E

Definition at line 84 of file adt7475.c.

#define REG_STATUS1   0x41

Definition at line 61 of file adt7475.c.

#define REG_STATUS2   0x42

Definition at line 62 of file adt7475.c.

#define REG_STATUS4   0x81 /* ADT7490 only */

Definition at line 97 of file adt7475.c.

#define REG_TACH_BASE   0x28

Definition at line 53 of file adt7475.c.

#define REG_TACH_MIN_BASE   0x54

Definition at line 72 of file adt7475.c.

#define REG_TEMP_BASE   0x25

Definition at line 52 of file adt7475.c.

#define REG_TEMP_MAX_BASE   0x4F

Definition at line 70 of file adt7475.c.

#define REG_TEMP_MIN_BASE   0x4E

Definition at line 69 of file adt7475.c.

#define REG_TEMP_OFFSET_BASE   0x70

Definition at line 86 of file adt7475.c.

#define REG_TEMP_THERM_BASE   0x6A

Definition at line 81 of file adt7475.c.

#define REG_TEMP_TMIN_BASE   0x67

Definition at line 80 of file adt7475.c.

#define REG_TEMP_TRANGE_BASE   0x5F

Definition at line 76 of file adt7475.c.

#define REG_VENDID   0x3E

Definition at line 58 of file adt7475.c.

#define REG_VID   0x43 /* ADT7476 only */

Definition at line 64 of file adt7475.c.

#define REG_VOLTAGE_BASE   0x20

Definition at line 51 of file adt7475.c.

#define REG_VOLTAGE_MAX_BASE   0x45

Definition at line 67 of file adt7475.c.

#define REG_VOLTAGE_MIN_BASE   0x44

Definition at line 66 of file adt7475.c.

#define REG_VTT   0x1E /* ADT7490 only */

Definition at line 48 of file adt7475.c.

#define REG_VTT_MAX   0x86 /* ADT7490 only */

Definition at line 100 of file adt7475.c.

#define REG_VTT_MIN   0x84 /* ADT7490 only */

Definition at line 99 of file adt7475.c.

#define TACH_MIN_REG (   idx)    (REG_TACH_MIN_BASE + ((idx) * 2))

Definition at line 132 of file adt7475.c.

#define TACH_REG (   idx)    (REG_TACH_BASE + ((idx) * 2))

Definition at line 131 of file adt7475.c.

#define TEMP_MAX_REG (   idx)    (REG_TEMP_MAX_BASE + ((idx) * 2))

Definition at line 145 of file adt7475.c.

#define TEMP_MIN_REG (   idx)    (REG_TEMP_MIN_BASE + ((idx) * 2))

Definition at line 144 of file adt7475.c.

#define TEMP_OFFSET_REG (   idx)    (REG_TEMP_OFFSET_BASE + (idx))

Definition at line 148 of file adt7475.c.

#define TEMP_REG (   idx)    (REG_TEMP_BASE + (idx))

Definition at line 143 of file adt7475.c.

#define TEMP_THERM_REG (   idx)    (REG_TEMP_THERM_BASE + (idx))

Definition at line 147 of file adt7475.c.

#define TEMP_TMIN_REG (   idx)    (REG_TEMP_TMIN_BASE + (idx))

Definition at line 146 of file adt7475.c.

#define TEMP_TRANGE_REG (   idx)    (REG_TEMP_TRANGE_BASE + (idx))

Definition at line 149 of file adt7475.c.

#define THERM   5

Definition at line 33 of file adt7475.c.

#define VID_VIDSEL   0x80 /* ADT7476 only */

Definition at line 102 of file adt7475.c.

#define VOLTAGE_MAX_REG (   idx)    (REG_VOLTAGE_MAX_BASE + ((idx) * 2))

Definition at line 141 of file adt7475.c.

#define VOLTAGE_MIN_REG (   idx)    (REG_VOLTAGE_MIN_BASE + ((idx) * 2))

Definition at line 140 of file adt7475.c.

#define VOLTAGE_REG (   idx)    (REG_VOLTAGE_BASE + (idx))

Definition at line 139 of file adt7475.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 153 of file adt7475.c.

Function Documentation

MODULE_AUTHOR ( "Advanced Micro  Devices,
Inc"   
)
MODULE_DESCRIPTION ( "adt7475 driver )
MODULE_DEVICE_TABLE ( i2c  ,
adt7475_id   
)
module_i2c_driver ( adt7475_driver  )
MODULE_LICENSE ( "GPL"  )