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

Go to the source code of this file.

Data Structures

struct  it87_sio_data
 
struct  it87_data
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRVNAME   "it87"
 
#define REG   0x2e /* The register to read/write */
 
#define DEV   0x07 /* Register: Logical device select */
 
#define VAL   0x2f /* The value to read/write */
 
#define PME   0x04 /* The device with the fan registers in it */
 
#define GPIO   0x07
 
#define DEVID   0x20 /* Register: Device ID */
 
#define DEVREV   0x22 /* Register: Device Revision */
 
#define IT8712F_DEVID   0x8712
 
#define IT8705F_DEVID   0x8705
 
#define IT8716F_DEVID   0x8716
 
#define IT8718F_DEVID   0x8718
 
#define IT8720F_DEVID   0x8720
 
#define IT8721F_DEVID   0x8721
 
#define IT8726F_DEVID   0x8726
 
#define IT8728F_DEVID   0x8728
 
#define IT8782F_DEVID   0x8782
 
#define IT8783E_DEVID   0x8783
 
#define IT87_ACT_REG   0x30
 
#define IT87_BASE_REG   0x60
 
#define IT87_SIO_GPIO1_REG   0x25
 
#define IT87_SIO_GPIO3_REG   0x27
 
#define IT87_SIO_GPIO5_REG   0x29
 
#define IT87_SIO_PINX1_REG   0x2a /* Pin selection */
 
#define IT87_SIO_PINX2_REG   0x2c /* Pin selection */
 
#define IT87_SIO_SPI_REG   0xef /* SPI function pin select */
 
#define IT87_SIO_VID_REG   0xfc /* VID value */
 
#define IT87_SIO_BEEP_PIN_REG   0xf6 /* Beep pin mapping */
 
#define IT87_EXTENT   8
 
#define IT87_EC_EXTENT   2
 
#define IT87_EC_OFFSET   5
 
#define IT87_ADDR_REG_OFFSET   0
 
#define IT87_DATA_REG_OFFSET   1
 
#define IT87_REG_CONFIG   0x00
 
#define IT87_REG_ALARM1   0x01
 
#define IT87_REG_ALARM2   0x02
 
#define IT87_REG_ALARM3   0x03
 
#define IT87_REG_VID   0x0a
 
#define IT87_REG_FAN_DIV   0x0b
 
#define IT87_REG_FAN_16BIT   0x0c
 
#define IT87_REG_FAN_MAIN_CTRL   0x13
 
#define IT87_REG_FAN_CTL   0x14
 
#define IT87_REG_PWM(nr)   (0x15 + (nr))
 
#define IT87_REG_PWM_DUTY(nr)   (0x63 + (nr) * 8)
 
#define IT87_REG_VIN(nr)   (0x20 + (nr))
 
#define IT87_REG_TEMP(nr)   (0x29 + (nr))
 
#define IT87_REG_VIN_MAX(nr)   (0x30 + (nr) * 2)
 
#define IT87_REG_VIN_MIN(nr)   (0x31 + (nr) * 2)
 
#define IT87_REG_TEMP_HIGH(nr)   (0x40 + (nr) * 2)
 
#define IT87_REG_TEMP_LOW(nr)   (0x41 + (nr) * 2)
 
#define IT87_REG_VIN_ENABLE   0x50
 
#define IT87_REG_TEMP_ENABLE   0x51
 
#define IT87_REG_TEMP_EXTRA   0x55
 
#define IT87_REG_BEEP_ENABLE   0x5c
 
#define IT87_REG_CHIPID   0x58
 
#define IT87_REG_AUTO_TEMP(nr, i)   (0x60 + (nr) * 8 + (i))
 
#define IT87_REG_AUTO_PWM(nr, i)   (0x65 + (nr) * 8 + (i))
 
#define FAN_FROM_REG(val, div)
 
#define FAN16_FROM_REG(val)
 
#define TEMP_TO_REG(val)
 
#define TEMP_FROM_REG(val)   ((val) * 1000)
 
#define DIV_FROM_REG(val)   (1 << (val))
 
#define show_in_offset(offset)
 
#define limit_in_offset(offset)
 
#define show_temp_offset(offset)
 
#define show_sensor_offset(offset)
 
#define show_fan_offset(offset)
 
#define show_pwm_offset(offset)
 
#define show_fan16_offset(offset)
 

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_param (force_id, ushort, 0)
 
 MODULE_PARM_DESC (force_id,"Override the detected device ID")
 
 show_in_offset (0)
 
 limit_in_offset (0)
 
 show_in_offset (1)
 
 limit_in_offset (1)
 
 show_in_offset (2)
 
 limit_in_offset (2)
 
 show_in_offset (3)
 
 limit_in_offset (3)
 
 show_in_offset (4)
 
 limit_in_offset (4)
 
 show_in_offset (5)
 
 limit_in_offset (5)
 
 show_in_offset (6)
 
 limit_in_offset (6)
 
 show_in_offset (7)
 
 limit_in_offset (7)
 
 show_in_offset (8)
 
 show_temp_offset (1)
 
 show_temp_offset (2)
 
 show_temp_offset (3)
 
 show_sensor_offset (1)
 
 show_sensor_offset (2)
 
 show_sensor_offset (3)
 
 show_fan_offset (1)
 
 show_fan_offset (2)
 
 show_fan_offset (3)
 
 show_pwm_offset (1)
 
 show_pwm_offset (2)
 
 show_pwm_offset (3)
 
 show_fan16_offset (1)
 
 show_fan16_offset (2)
 
 show_fan16_offset (3)
 
 show_fan16_offset (4)
 
 show_fan16_offset (5)
 
 MODULE_AUTHOR ("Chris Gauthron, ""Jean Delvare <[email protected]>")
 
 MODULE_DESCRIPTION ("IT8705F/IT871xF/IT872xF hardware monitoring driver")
 
 module_param (update_vbat, bool, 0)
 
 MODULE_PARM_DESC (update_vbat,"Update vbat if set else return powerup value")
 
 module_param (fix_pwm_polarity, bool, 0)
 
 MODULE_PARM_DESC (fix_pwm_polarity,"Force PWM polarity to active high (DANGEROUS)")
 
 MODULE_LICENSE ("GPL")
 
 module_init (sm_it87_init)
 
 module_exit (sm_it87_exit)
 

Macro Definition Documentation

#define DEV   0x07 /* Register: Logical device select */

Definition at line 74 of file it87.c.

#define DEVID   0x20 /* Register: Device ID */

Definition at line 81 of file it87.c.

#define DEVREV   0x22 /* Register: Device Revision */

Definition at line 82 of file it87.c.

#define DIV_FROM_REG (   val)    (1 << (val))

Definition at line 388 of file it87.c.

#define DRVNAME   "it87"

Definition at line 62 of file it87.c.

#define FAN16_FROM_REG (   val)
Value:
((val) == 0 ? -1 : (val) == 0xffff ? 0 : \
1350000 / ((val) * 2))

Definition at line 357 of file it87.c.

#define FAN_FROM_REG (   val,
  div 
)
Value:
((val) == 0 ? -1 : (val) == 255 ? 0 : \
1350000 / ((val) * (div)))

Definition at line 354 of file it87.c.

#define GPIO   0x07

Definition at line 79 of file it87.c.

#define IT8705F_DEVID   0x8705

Definition at line 136 of file it87.c.

#define IT8712F_DEVID   0x8712

Definition at line 135 of file it87.c.

#define IT8716F_DEVID   0x8716

Definition at line 137 of file it87.c.

#define IT8718F_DEVID   0x8718

Definition at line 138 of file it87.c.

#define IT8720F_DEVID   0x8720

Definition at line 139 of file it87.c.

#define IT8721F_DEVID   0x8721

Definition at line 140 of file it87.c.

#define IT8726F_DEVID   0x8726

Definition at line 141 of file it87.c.

#define IT8728F_DEVID   0x8728

Definition at line 142 of file it87.c.

#define IT8782F_DEVID   0x8782

Definition at line 143 of file it87.c.

#define IT8783E_DEVID   0x8783

Definition at line 144 of file it87.c.

#define IT87_ACT_REG   0x30

Definition at line 145 of file it87.c.

#define IT87_ADDR_REG_OFFSET   0

Definition at line 176 of file it87.c.

#define IT87_BASE_REG   0x60

Definition at line 146 of file it87.c.

#define IT87_DATA_REG_OFFSET   1

Definition at line 177 of file it87.c.

#define IT87_EC_EXTENT   2

Definition at line 170 of file it87.c.

#define IT87_EC_OFFSET   5

Definition at line 173 of file it87.c.

#define IT87_EXTENT   8

Definition at line 167 of file it87.c.

#define IT87_REG_ALARM1   0x01

Definition at line 183 of file it87.c.

#define IT87_REG_ALARM2   0x02

Definition at line 184 of file it87.c.

#define IT87_REG_ALARM3   0x03

Definition at line 185 of file it87.c.

#define IT87_REG_AUTO_PWM (   nr,
  i 
)    (0x65 + (nr) * 8 + (i))

Definition at line 227 of file it87.c.

#define IT87_REG_AUTO_TEMP (   nr,
  i 
)    (0x60 + (nr) * 8 + (i))

Definition at line 226 of file it87.c.

#define IT87_REG_BEEP_ENABLE   0x5c

Definition at line 222 of file it87.c.

#define IT87_REG_CHIPID   0x58

Definition at line 224 of file it87.c.

#define IT87_REG_CONFIG   0x00

Definition at line 181 of file it87.c.

#define IT87_REG_FAN_16BIT   0x0c

Definition at line 198 of file it87.c.

#define IT87_REG_FAN_CTL   0x14

Definition at line 207 of file it87.c.

#define IT87_REG_FAN_DIV   0x0b

Definition at line 197 of file it87.c.

#define IT87_REG_FAN_MAIN_CTRL   0x13

Definition at line 206 of file it87.c.

#define IT87_REG_PWM (   nr)    (0x15 + (nr))

Definition at line 208 of file it87.c.

#define IT87_REG_PWM_DUTY (   nr)    (0x63 + (nr) * 8)

Definition at line 209 of file it87.c.

#define IT87_REG_TEMP (   nr)    (0x29 + (nr))

Definition at line 212 of file it87.c.

#define IT87_REG_TEMP_ENABLE   0x51

Definition at line 220 of file it87.c.

#define IT87_REG_TEMP_EXTRA   0x55

Definition at line 221 of file it87.c.

#define IT87_REG_TEMP_HIGH (   nr)    (0x40 + (nr) * 2)

Definition at line 216 of file it87.c.

#define IT87_REG_TEMP_LOW (   nr)    (0x41 + (nr) * 2)

Definition at line 217 of file it87.c.

#define IT87_REG_VID   0x0a

Definition at line 191 of file it87.c.

#define IT87_REG_VIN (   nr)    (0x20 + (nr))

Definition at line 211 of file it87.c.

#define IT87_REG_VIN_ENABLE   0x50

Definition at line 219 of file it87.c.

#define IT87_REG_VIN_MAX (   nr)    (0x30 + (nr) * 2)

Definition at line 214 of file it87.c.

#define IT87_REG_VIN_MIN (   nr)    (0x31 + (nr) * 2)

Definition at line 215 of file it87.c.

#define IT87_SIO_BEEP_PIN_REG   0xf6 /* Beep pin mapping */

Definition at line 156 of file it87.c.

#define IT87_SIO_GPIO1_REG   0x25

Definition at line 149 of file it87.c.

#define IT87_SIO_GPIO3_REG   0x27

Definition at line 150 of file it87.c.

#define IT87_SIO_GPIO5_REG   0x29

Definition at line 151 of file it87.c.

#define IT87_SIO_PINX1_REG   0x2a /* Pin selection */

Definition at line 152 of file it87.c.

#define IT87_SIO_PINX2_REG   0x2c /* Pin selection */

Definition at line 153 of file it87.c.

#define IT87_SIO_SPI_REG   0xef /* SPI function pin select */

Definition at line 154 of file it87.c.

#define IT87_SIO_VID_REG   0xfc /* VID value */

Definition at line 155 of file it87.c.

#define limit_in_offset (   offset)
Value:
show_in_min, set_in_min, offset); \
show_in_max, set_in_max, offset);

Definition at line 522 of file it87.c.

#define PME   0x04 /* The device with the fan registers in it */

Definition at line 76 of file it87.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 44 of file it87.c.

#define REG   0x2e /* The register to read/write */

Definition at line 73 of file it87.c.

#define show_fan16_offset (   offset)
Value:
static struct sensor_device_attribute sensor_dev_attr_fan##offset##_input16 \
= SENSOR_ATTR(fan##offset##_input, S_IRUGO, \
show_fan16, NULL, offset - 1); \
static struct sensor_device_attribute sensor_dev_attr_fan##offset##_min16 \
show_fan16_min, set_fan16_min, offset - 1)

Definition at line 1194 of file it87.c.

#define show_fan_offset (   offset)
Value:
static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, \
show_fan, NULL, offset - 1); \
show_fan_min, set_fan_min, offset - 1); \
show_fan_div, set_fan_div, offset - 1);

Definition at line 1095 of file it87.c.

#define show_in_offset (   offset)
Value:

Definition at line 518 of file it87.c.

#define show_pwm_offset (   offset)

Definition at line 1107 of file it87.c.

#define show_sensor_offset (   offset)
Value:
show_sensor, set_sensor, offset - 1);

Definition at line 672 of file it87.c.

#define show_temp_offset (   offset)
Value:
show_temp, NULL, offset - 1); \
show_temp_max, set_temp_max, offset - 1); \
show_temp_min, set_temp_min, offset - 1);

Definition at line 610 of file it87.c.

#define TEMP_FROM_REG (   val)    ((val) * 1000)

Definition at line 362 of file it87.c.

#define TEMP_TO_REG (   val)
Value:
(SENSORS_LIMIT(((val) < 0 ? (((val) - 500) / 1000) : \
((val) + 500) / 1000), -128, 127))

Definition at line 360 of file it87.c.

#define VAL   0x2f /* The value to read/write */

Definition at line 75 of file it87.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 64 of file it87.c.

Function Documentation

limit_in_offset ( )
limit_in_offset ( )
limit_in_offset ( )
limit_in_offset ( )
limit_in_offset ( )
limit_in_offset ( )
limit_in_offset ( )
limit_in_offset ( )
MODULE_AUTHOR ( "Chris  Gauthron,
""Jean Delvare< khali @linux-fr.org >"   
)
MODULE_DESCRIPTION ( "IT8705F/IT871xF/IT872xF hardware monitoring driver )
module_exit ( sm_it87_exit  )
module_init ( sm_it87_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( force_id  ,
ushort  ,
 
)
module_param ( update_vbat  ,
bool  ,
 
)
module_param ( fix_pwm_polarity  ,
bool  ,
 
)
MODULE_PARM_DESC ( force_id  ,
"Override the detected device ID  
)
MODULE_PARM_DESC ( update_vbat  ,
"Update vbat if set else return powerup value  
)
MODULE_PARM_DESC ( fix_pwm_polarity  ,
"Force PWM polarity to active high (DANGEROUS)"   
)
show_fan16_offset ( )
show_fan16_offset ( )
show_fan16_offset ( )
show_fan16_offset ( )
show_fan16_offset ( )
show_fan_offset ( )
show_fan_offset ( )
show_fan_offset ( )
show_in_offset ( )

Definition at line 220 of file smsc47m192.c.

show_in_offset ( )
show_in_offset ( )
show_in_offset ( )
show_in_offset ( )
show_in_offset ( )
show_in_offset ( )
show_in_offset ( )
show_in_offset ( )
show_pwm_offset ( )
show_pwm_offset ( )
show_pwm_offset ( )
show_sensor_offset ( )
show_sensor_offset ( )
show_sensor_offset ( )
show_temp_offset ( )
show_temp_offset ( )
show_temp_offset ( )