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

Go to the source code of this file.

Data Structures

struct  f75375_data
 

Macros

#define F75375_REG_CONFIG0   0x0
 
#define F75375_REG_CONFIG1   0x1
 
#define F75375_REG_CONFIG2   0x2
 
#define F75375_REG_CONFIG3   0x3
 
#define F75375_REG_ADDR   0x4
 
#define F75375_REG_INTR   0x31
 
#define F75375_CHIP_ID   0x5A
 
#define F75375_REG_VERSION   0x5C
 
#define F75375_REG_VENDOR   0x5D
 
#define F75375_REG_FAN_TIMER   0x60
 
#define F75375_REG_VOLT(nr)   (0x10 + (nr))
 
#define F75375_REG_VOLT_HIGH(nr)   (0x20 + (nr) * 2)
 
#define F75375_REG_VOLT_LOW(nr)   (0x21 + (nr) * 2)
 
#define F75375_REG_TEMP(nr)   (0x14 + (nr))
 
#define F75387_REG_TEMP11_LSB(nr)   (0x1a + (nr))
 
#define F75375_REG_TEMP_HIGH(nr)   (0x28 + (nr) * 2)
 
#define F75375_REG_TEMP_HYST(nr)   (0x29 + (nr) * 2)
 
#define F75375_REG_FAN(nr)   (0x16 + (nr) * 2)
 
#define F75375_REG_FAN_MIN(nr)   (0x2C + (nr) * 2)
 
#define F75375_REG_FAN_FULL(nr)   (0x70 + (nr) * 0x10)
 
#define F75375_REG_FAN_PWM_DUTY(nr)   (0x76 + (nr) * 0x10)
 
#define F75375_REG_FAN_PWM_CLOCK(nr)   (0x7D + (nr) * 0x10)
 
#define F75375_REG_FAN_EXP(nr)   (0x74 + (nr) * 0x10)
 
#define F75375_REG_FAN_B_TEMP(nr, step)   ((0xA0 + (nr) * 0x10) + (step))
 
#define F75375_REG_FAN_B_SPEED(nr, step)   ((0xA5 + (nr) * 0x10) + (step) * 2)
 
#define F75375_REG_PWM1_RAISE_DUTY   0x69
 
#define F75375_REG_PWM2_RAISE_DUTY   0x6A
 
#define F75375_REG_PWM1_DROP_DUTY   0x6B
 
#define F75375_REG_PWM2_DROP_DUTY   0x6C
 
#define F75375_FAN_CTRL_LINEAR(nr)   (4 + nr)
 
#define F75387_FAN_CTRL_LINEAR(nr)   (1 + ((nr) * 4))
 
#define FAN_CTRL_MODE(nr)   (4 + ((nr) * 2))
 
#define F75387_FAN_DUTY_MODE(nr)   (2 + ((nr) * 4))
 
#define F75387_FAN_MANU_MODE(nr)   ((nr) * 4)
 
#define VOLT_FROM_REG(val)   ((val) * 8)
 
#define VOLT_TO_REG(val)   ((val) / 8)
 
#define TEMP_FROM_REG(val)   ((val) * 1000)
 
#define TEMP_TO_REG(val)   ((val) / 1000)
 
#define TEMP11_FROM_REG(reg)   ((reg) / 32 * 125)
 
#define show_fan(thing)
 

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, f75375_id)
 
 show_fan (fan)
 
 show_fan (fan_min)
 
 show_fan (fan_max)
 
 show_fan (fan_target)
 
 module_i2c_driver (f75375_driver)
 
 MODULE_AUTHOR ("Riku Voipio")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_DESCRIPTION ("F75373/F75375/F75387 hardware monitoring driver")
 

Macro Definition Documentation

#define F75375_CHIP_ID   0x5A

Definition at line 55 of file f75375s.c.

#define F75375_FAN_CTRL_LINEAR (   nr)    (4 + nr)

Definition at line 85 of file f75375s.c.

#define F75375_REG_ADDR   0x4

Definition at line 53 of file f75375s.c.

#define F75375_REG_CONFIG0   0x0

Definition at line 49 of file f75375s.c.

#define F75375_REG_CONFIG1   0x1

Definition at line 50 of file f75375s.c.

#define F75375_REG_CONFIG2   0x2

Definition at line 51 of file f75375s.c.

#define F75375_REG_CONFIG3   0x3

Definition at line 52 of file f75375s.c.

#define F75375_REG_FAN (   nr)    (0x16 + (nr) * 2)

Definition at line 69 of file f75375s.c.

#define F75375_REG_FAN_B_SPEED (   nr,
  step 
)    ((0xA5 + (nr) * 0x10) + (step) * 2)

Definition at line 77 of file f75375s.c.

#define F75375_REG_FAN_B_TEMP (   nr,
  step 
)    ((0xA0 + (nr) * 0x10) + (step))

Definition at line 76 of file f75375s.c.

#define F75375_REG_FAN_EXP (   nr)    (0x74 + (nr) * 0x10)

Definition at line 75 of file f75375s.c.

#define F75375_REG_FAN_FULL (   nr)    (0x70 + (nr) * 0x10)

Definition at line 71 of file f75375s.c.

#define F75375_REG_FAN_MIN (   nr)    (0x2C + (nr) * 2)

Definition at line 70 of file f75375s.c.

#define F75375_REG_FAN_PWM_CLOCK (   nr)    (0x7D + (nr) * 0x10)

Definition at line 73 of file f75375s.c.

#define F75375_REG_FAN_PWM_DUTY (   nr)    (0x76 + (nr) * 0x10)

Definition at line 72 of file f75375s.c.

#define F75375_REG_FAN_TIMER   0x60

Definition at line 58 of file f75375s.c.

#define F75375_REG_INTR   0x31

Definition at line 54 of file f75375s.c.

#define F75375_REG_PWM1_DROP_DUTY   0x6B

Definition at line 82 of file f75375s.c.

#define F75375_REG_PWM1_RAISE_DUTY   0x69

Definition at line 80 of file f75375s.c.

#define F75375_REG_PWM2_DROP_DUTY   0x6C

Definition at line 83 of file f75375s.c.

#define F75375_REG_PWM2_RAISE_DUTY   0x6A

Definition at line 81 of file f75375s.c.

#define F75375_REG_TEMP (   nr)    (0x14 + (nr))

Definition at line 64 of file f75375s.c.

#define F75375_REG_TEMP_HIGH (   nr)    (0x28 + (nr) * 2)

Definition at line 66 of file f75375s.c.

#define F75375_REG_TEMP_HYST (   nr)    (0x29 + (nr) * 2)

Definition at line 67 of file f75375s.c.

#define F75375_REG_VENDOR   0x5D

Definition at line 57 of file f75375s.c.

#define F75375_REG_VERSION   0x5C

Definition at line 56 of file f75375s.c.

#define F75375_REG_VOLT (   nr)    (0x10 + (nr))

Definition at line 60 of file f75375s.c.

#define F75375_REG_VOLT_HIGH (   nr)    (0x20 + (nr) * 2)

Definition at line 61 of file f75375s.c.

#define F75375_REG_VOLT_LOW (   nr)    (0x21 + (nr) * 2)

Definition at line 62 of file f75375s.c.

#define F75387_FAN_CTRL_LINEAR (   nr)    (1 + ((nr) * 4))

Definition at line 86 of file f75375s.c.

#define F75387_FAN_DUTY_MODE (   nr)    (2 + ((nr) * 4))

Definition at line 88 of file f75375s.c.

#define F75387_FAN_MANU_MODE (   nr)    ((nr) * 4)

Definition at line 89 of file f75375s.c.

#define F75387_REG_TEMP11_LSB (   nr)    (0x1a + (nr))

Definition at line 65 of file f75375s.c.

#define FAN_CTRL_MODE (   nr)    (4 + ((nr) * 2))

Definition at line 87 of file f75375s.c.

#define show_fan (   thing)
Value:
static ssize_t show_##thing(struct device *dev, struct device_attribute *attr, \
char *buf)\
{\
int nr = to_sensor_dev_attr(attr)->index;\
struct f75375_data *data = f75375_update_device(dev); \
return sprintf(buf, "%d\n", rpm_from_reg(data->thing[nr])); \
}

Definition at line 658 of file f75375s.c.

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

Definition at line 589 of file f75375s.c.

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

Definition at line 587 of file f75375s.c.

#define TEMP_TO_REG (   val)    ((val) / 1000)

Definition at line 588 of file f75375s.c.

#define VOLT_FROM_REG (   val)    ((val) * 8)

Definition at line 519 of file f75375s.c.

#define VOLT_TO_REG (   val)    ((val) / 8)

Definition at line 520 of file f75375s.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 46 of file f75375s.c.

Function Documentation

MODULE_AUTHOR ( "Riku Voipio"  )
MODULE_DESCRIPTION ( "F75373/F75375/F75387 hardware monitoring driver )
MODULE_DEVICE_TABLE ( i2c  ,
f75375_id   
)
module_i2c_driver ( f75375_driver  )
MODULE_LICENSE ( "GPL"  )
show_fan ( fan  )
show_fan ( fan_min  )
show_fan ( fan_max  )
show_fan ( fan_target  )