Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
lm93.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/delay.h>
#include <linux/jiffies.h>

Go to the source code of this file.

Data Structures

struct  block1_t
 
struct  lm93_data
 

Macros

#define LM93_REG_MFR_ID   0x3e
 
#define LM93_REG_VER   0x3f
 
#define LM93_REG_STATUS_CONTROL   0xe2
 
#define LM93_REG_CONFIG   0xe3
 
#define LM93_REG_SLEEP_CONTROL   0xe4
 
#define LM93_REG_HOST_ERROR_1   0x48
 
#define LM93_REG_IN(nr)   (0x56 + (nr))
 
#define LM93_REG_IN_MIN(nr)   (0x90 + (nr) * 2)
 
#define LM93_REG_IN_MAX(nr)   (0x91 + (nr) * 2)
 
#define LM93_REG_TEMP(nr)   (0x50 + (nr))
 
#define LM93_REG_TEMP_MIN(nr)   (0x78 + (nr) * 2)
 
#define LM93_REG_TEMP_MAX(nr)   (0x79 + (nr) * 2)
 
#define LM93_REG_BOOST(nr)   (0x80 + (nr))
 
#define LM93_REG_PROCHOT_CUR(nr)   (0x67 + (nr) * 2)
 
#define LM93_REG_PROCHOT_AVG(nr)   (0x68 + (nr) * 2)
 
#define LM93_REG_PROCHOT_MAX(nr)   (0xb0 + (nr))
 
#define LM93_REG_FAN(nr)   (0x6e + (nr) * 2)
 
#define LM93_REG_FAN_MIN(nr)   (0xb4 + (nr) * 2)
 
#define LM93_REG_PWM_CTL(nr, reg)   (0xc8 + (reg) + (nr) * 4)
 
#define LM93_PWM_CTL1   0x0
 
#define LM93_PWM_CTL2   0x1
 
#define LM93_PWM_CTL3   0x2
 
#define LM93_PWM_CTL4   0x3
 
#define LM93_REG_GPI   0x6b
 
#define LM93_REG_VID(nr)   (0x6c + (nr))
 
#define LM93_REG_VCCP_LIMIT_OFF(nr)   (0xb2 + (nr))
 
#define LM93_REG_BOOST_HYST_12   0xc0
 
#define LM93_REG_BOOST_HYST_34   0xc1
 
#define LM93_REG_BOOST_HYST(nr)   (0xc0 + (nr)/2)
 
#define LM93_REG_PWM_MIN_HYST_12   0xc3
 
#define LM93_REG_PWM_MIN_HYST_34   0xc4
 
#define LM93_REG_PWM_MIN_HYST(nr)   (0xc3 + (nr)/2)
 
#define LM93_REG_PROCHOT_OVERRIDE   0xc6
 
#define LM93_REG_PROCHOT_INTERVAL   0xc7
 
#define LM93_REG_TEMP_BASE(nr)   (0xd0 + (nr))
 
#define LM93_REG_TEMP_OFFSET(step)   (0xd4 + (step))
 
#define LM93_REG_PWM_RAMP_CTL   0xbf
 
#define LM93_REG_SFC1   0xbc
 
#define LM93_REG_SFC2   0xbd
 
#define LM93_REG_GPI_VID_CTL   0xbe
 
#define LM93_REG_SF_TACH_TO_PWM   0xe0
 
#define LM93_REG_GPI_ERR_MASK   0xec
 
#define LM93_REG_MISC_ERR_MASK   0xed
 
#define LM93_MFR_ID   0x73
 
#define LM93_MFR_ID_PROTOTYPE   0x72
 
#define LM94_MFR_ID_2   0x7a
 
#define LM94_MFR_ID   0x79
 
#define LM94_MFR_ID_PROTOTYPE   0x78
 
#define LM93_SMBUS_FUNC_FULL
 
#define LM93_SMBUS_FUNC_MIN
 
#define LM93_IN_MIN_FROM_REG(reg, vid)   LM93_IN_REL_FROM_REG((reg), 0, (vid))
 
#define LM93_IN_MAX_FROM_REG(reg, vid)   LM93_IN_REL_FROM_REG((reg), 1, (vid))
 
#define LM93_TEMP_MIN   (-128000)
 
#define LM93_TEMP_MAX   (127000)
 
#define LM93_TEMP_OFFSET_MIN   (0)
 
#define LM93_TEMP_OFFSET_MAX0   (150)
 
#define LM93_TEMP_OFFSET_MAX1   (75)
 
#define LM93_RAMP_MIN   0
 
#define LM93_RAMP_MAX   75
 
#define LM93_ALARM_IN1   0x00000001
 
#define LM93_ALARM_IN2   0x00000002
 
#define LM93_ALARM_IN3   0x00000004
 
#define LM93_ALARM_IN4   0x00000008
 
#define LM93_ALARM_IN5   0x00000010
 
#define LM93_ALARM_IN6   0x00000020
 
#define LM93_ALARM_IN7   0x00000040
 
#define LM93_ALARM_IN8   0x00000080
 
#define LM93_ALARM_IN9   0x00000100
 
#define LM93_ALARM_IN10   0x00000200
 
#define LM93_ALARM_IN11   0x00000400
 
#define LM93_ALARM_IN12   0x00000800
 
#define LM93_ALARM_IN13   0x00001000
 
#define LM93_ALARM_IN14   0x00002000
 
#define LM93_ALARM_IN15   0x00004000
 
#define LM93_ALARM_IN16   0x00008000
 
#define LM93_ALARM_FAN1   0x00010000
 
#define LM93_ALARM_FAN2   0x00020000
 
#define LM93_ALARM_FAN3   0x00040000
 
#define LM93_ALARM_FAN4   0x00080000
 
#define LM93_ALARM_PH1_ERR   0x00100000
 
#define LM93_ALARM_PH2_ERR   0x00200000
 
#define LM93_ALARM_SCSI1_ERR   0x00400000
 
#define LM93_ALARM_SCSI2_ERR   0x00800000
 
#define LM93_ALARM_DVDDP1_ERR   0x01000000
 
#define LM93_ALARM_DVDDP2_ERR   0x02000000
 
#define LM93_ALARM_D1_ERR   0x04000000
 
#define LM93_ALARM_D2_ERR   0x08000000
 
#define LM93_ALARM_TEMP1   0x10000000
 
#define LM93_ALARM_TEMP2   0x20000000
 
#define LM93_ALARM_TEMP3   0x40000000
 
#define MAX_RETRIES   5
 

Enumerations

enum  pwm_freq { LM93_PWM_MAP_HI_FREQ, LM93_PWM_MAP_LO_FREQ }
 

Functions

 module_param (disable_block, bool, 0)
 
 MODULE_PARM_DESC (disable_block,"Set to non-zero to disable SMBus block data transactions.")
 
 module_param (init, bool, 0)
 
 MODULE_PARM_DESC (init,"Set to non-zero to force chip initialization.")
 
 module_param_array (vccp_limit_type, int, NULL, 0)
 
 MODULE_PARM_DESC (vccp_limit_type,"Configures in7 and in8 limit modes.")
 
 module_param (vid_agtl, int, 0)
 
 MODULE_PARM_DESC (vid_agtl,"Configures VID pin input thresholds.")
 
 MODULE_DEVICE_TABLE (i2c, lm93_id)
 
 module_i2c_driver (lm93_driver)
 
 MODULE_AUTHOR ("Mark M. Hoffman <[email protected]>, ""Hans J. Koch <[email protected]>")
 
 MODULE_DESCRIPTION ("LM93 driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define LM93_ALARM_D1_ERR   0x04000000

Definition at line 779 of file lm93.c.

#define LM93_ALARM_D2_ERR   0x08000000

Definition at line 780 of file lm93.c.

#define LM93_ALARM_DVDDP1_ERR   0x01000000

Definition at line 777 of file lm93.c.

#define LM93_ALARM_DVDDP2_ERR   0x02000000

Definition at line 778 of file lm93.c.

#define LM93_ALARM_FAN1   0x00010000

Definition at line 769 of file lm93.c.

#define LM93_ALARM_FAN2   0x00020000

Definition at line 770 of file lm93.c.

#define LM93_ALARM_FAN3   0x00040000

Definition at line 771 of file lm93.c.

#define LM93_ALARM_FAN4   0x00080000

Definition at line 772 of file lm93.c.

#define LM93_ALARM_IN1   0x00000001

Definition at line 753 of file lm93.c.

#define LM93_ALARM_IN10   0x00000200

Definition at line 762 of file lm93.c.

#define LM93_ALARM_IN11   0x00000400

Definition at line 763 of file lm93.c.

#define LM93_ALARM_IN12   0x00000800

Definition at line 764 of file lm93.c.

#define LM93_ALARM_IN13   0x00001000

Definition at line 765 of file lm93.c.

#define LM93_ALARM_IN14   0x00002000

Definition at line 766 of file lm93.c.

#define LM93_ALARM_IN15   0x00004000

Definition at line 767 of file lm93.c.

#define LM93_ALARM_IN16   0x00008000

Definition at line 768 of file lm93.c.

#define LM93_ALARM_IN2   0x00000002

Definition at line 754 of file lm93.c.

#define LM93_ALARM_IN3   0x00000004

Definition at line 755 of file lm93.c.

#define LM93_ALARM_IN4   0x00000008

Definition at line 756 of file lm93.c.

#define LM93_ALARM_IN5   0x00000010

Definition at line 757 of file lm93.c.

#define LM93_ALARM_IN6   0x00000020

Definition at line 758 of file lm93.c.

#define LM93_ALARM_IN7   0x00000040

Definition at line 759 of file lm93.c.

#define LM93_ALARM_IN8   0x00000080

Definition at line 760 of file lm93.c.

#define LM93_ALARM_IN9   0x00000100

Definition at line 761 of file lm93.c.

#define LM93_ALARM_PH1_ERR   0x00100000

Definition at line 773 of file lm93.c.

#define LM93_ALARM_PH2_ERR   0x00200000

Definition at line 774 of file lm93.c.

#define LM93_ALARM_SCSI1_ERR   0x00400000

Definition at line 775 of file lm93.c.

#define LM93_ALARM_SCSI2_ERR   0x00800000

Definition at line 776 of file lm93.c.

#define LM93_ALARM_TEMP1   0x10000000

Definition at line 781 of file lm93.c.

#define LM93_ALARM_TEMP2   0x20000000

Definition at line 782 of file lm93.c.

#define LM93_ALARM_TEMP3   0x40000000

Definition at line 783 of file lm93.c.

#define LM93_IN_MAX_FROM_REG (   reg,
  vid 
)    LM93_IN_REL_FROM_REG((reg), 1, (vid))

Definition at line 403 of file lm93.c.

#define LM93_IN_MIN_FROM_REG (   reg,
  vid 
)    LM93_IN_REL_FROM_REG((reg), 0, (vid))

Definition at line 402 of file lm93.c.

#define LM93_MFR_ID   0x73

Definition at line 136 of file lm93.c.

#define LM93_MFR_ID_PROTOTYPE   0x72

Definition at line 137 of file lm93.c.

#define LM93_PWM_CTL1   0x0

Definition at line 88 of file lm93.c.

#define LM93_PWM_CTL2   0x1

Definition at line 89 of file lm93.c.

#define LM93_PWM_CTL3   0x2

Definition at line 90 of file lm93.c.

#define LM93_PWM_CTL4   0x3

Definition at line 91 of file lm93.c.

#define LM93_RAMP_MAX   75

Definition at line 682 of file lm93.c.

#define LM93_RAMP_MIN   0

Definition at line 681 of file lm93.c.

#define LM93_REG_BOOST (   nr)    (0x80 + (nr))

Definition at line 75 of file lm93.c.

#define LM93_REG_BOOST_HYST (   nr)    (0xc0 + (nr)/2)

Definition at line 105 of file lm93.c.

#define LM93_REG_BOOST_HYST_12   0xc0

Definition at line 103 of file lm93.c.

#define LM93_REG_BOOST_HYST_34   0xc1

Definition at line 104 of file lm93.c.

#define LM93_REG_CONFIG   0xe3

Definition at line 58 of file lm93.c.

#define LM93_REG_FAN (   nr)    (0x6e + (nr) * 2)

Definition at line 83 of file lm93.c.

#define LM93_REG_FAN_MIN (   nr)    (0xb4 + (nr) * 2)

Definition at line 84 of file lm93.c.

#define LM93_REG_GPI   0x6b

Definition at line 94 of file lm93.c.

#define LM93_REG_GPI_ERR_MASK   0xec

Definition at line 132 of file lm93.c.

#define LM93_REG_GPI_VID_CTL   0xbe

Definition at line 128 of file lm93.c.

#define LM93_REG_HOST_ERROR_1   0x48

Definition at line 62 of file lm93.c.

#define LM93_REG_IN (   nr)    (0x56 + (nr))

Definition at line 65 of file lm93.c.

#define LM93_REG_IN_MAX (   nr)    (0x91 + (nr) * 2)

Definition at line 67 of file lm93.c.

#define LM93_REG_IN_MIN (   nr)    (0x90 + (nr) * 2)

Definition at line 66 of file lm93.c.

#define LM93_REG_MFR_ID   0x3e

Definition at line 55 of file lm93.c.

#define LM93_REG_MISC_ERR_MASK   0xed

Definition at line 133 of file lm93.c.

#define LM93_REG_PROCHOT_AVG (   nr)    (0x68 + (nr) * 2)

Definition at line 79 of file lm93.c.

#define LM93_REG_PROCHOT_CUR (   nr)    (0x67 + (nr) * 2)

Definition at line 78 of file lm93.c.

#define LM93_REG_PROCHOT_INTERVAL   0xc7

Definition at line 114 of file lm93.c.

#define LM93_REG_PROCHOT_MAX (   nr)    (0xb0 + (nr))

Definition at line 80 of file lm93.c.

#define LM93_REG_PROCHOT_OVERRIDE   0xc6

Definition at line 113 of file lm93.c.

#define LM93_REG_PWM_CTL (   nr,
  reg 
)    (0xc8 + (reg) + (nr) * 4)

Definition at line 87 of file lm93.c.

#define LM93_REG_PWM_MIN_HYST (   nr)    (0xc3 + (nr)/2)

Definition at line 110 of file lm93.c.

#define LM93_REG_PWM_MIN_HYST_12   0xc3

Definition at line 108 of file lm93.c.

#define LM93_REG_PWM_MIN_HYST_34   0xc4

Definition at line 109 of file lm93.c.

#define LM93_REG_PWM_RAMP_CTL   0xbf

Definition at line 123 of file lm93.c.

#define LM93_REG_SF_TACH_TO_PWM   0xe0

Definition at line 129 of file lm93.c.

#define LM93_REG_SFC1   0xbc

Definition at line 126 of file lm93.c.

#define LM93_REG_SFC2   0xbd

Definition at line 127 of file lm93.c.

#define LM93_REG_SLEEP_CONTROL   0xe4

Definition at line 59 of file lm93.c.

#define LM93_REG_STATUS_CONTROL   0xe2

Definition at line 57 of file lm93.c.

#define LM93_REG_TEMP (   nr)    (0x50 + (nr))

Definition at line 70 of file lm93.c.

#define LM93_REG_TEMP_BASE (   nr)    (0xd0 + (nr))

Definition at line 117 of file lm93.c.

#define LM93_REG_TEMP_MAX (   nr)    (0x79 + (nr) * 2)

Definition at line 72 of file lm93.c.

#define LM93_REG_TEMP_MIN (   nr)    (0x78 + (nr) * 2)

Definition at line 71 of file lm93.c.

#define LM93_REG_TEMP_OFFSET (   step)    (0xd4 + (step))

Definition at line 120 of file lm93.c.

#define LM93_REG_VCCP_LIMIT_OFF (   nr)    (0xb2 + (nr))

Definition at line 100 of file lm93.c.

#define LM93_REG_VER   0x3f

Definition at line 56 of file lm93.c.

#define LM93_REG_VID (   nr)    (0x6c + (nr))

Definition at line 97 of file lm93.c.

#define LM93_SMBUS_FUNC_FULL
Value:
I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA)

Definition at line 145 of file lm93.c.

#define LM93_SMBUS_FUNC_MIN
Value:
I2C_FUNC_SMBUS_WORD_DATA)

Definition at line 147 of file lm93.c.

#define LM93_TEMP_MAX   (127000)

Definition at line 432 of file lm93.c.

#define LM93_TEMP_MIN   (-128000)

Definition at line 431 of file lm93.c.

#define LM93_TEMP_OFFSET_MAX0   (150)

Definition at line 463 of file lm93.c.

#define LM93_TEMP_OFFSET_MAX1   (75)

Definition at line 464 of file lm93.c.

#define LM93_TEMP_OFFSET_MIN   (0)

Definition at line 462 of file lm93.c.

#define LM94_MFR_ID   0x79

Definition at line 141 of file lm93.c.

#define LM94_MFR_ID_2   0x7a

Definition at line 140 of file lm93.c.

#define LM94_MFR_ID_PROTOTYPE   0x78

Definition at line 142 of file lm93.c.

#define MAX_RETRIES   5

Definition at line 809 of file lm93.c.

Enumeration Type Documentation

enum pwm_freq
Enumerator:
LM93_PWM_MAP_HI_FREQ 
LM93_PWM_MAP_LO_FREQ 

Definition at line 564 of file lm93.c.

Function Documentation

MODULE_AUTHOR ( "Mark M. Hoffman <[email protected] ,
""Hans J.Koch< hjk @hansjkoch.de >"   
)
MODULE_DESCRIPTION ( "LM93 driver )
MODULE_DEVICE_TABLE ( i2c  ,
lm93_id   
)
module_i2c_driver ( lm93_driver  )
MODULE_LICENSE ( "GPL"  )
module_param ( disable_block  ,
bool  ,
 
)
module_param ( init  ,
bool  ,
 
)
module_param ( vid_agtl  ,
int  ,
 
)
module_param_array ( vccp_limit_type  ,
int  ,
NULL  ,
 
)
MODULE_PARM_DESC ( disable_block  ,
"Set to non-zero to disable SMBus block data transactions."   
)
MODULE_PARM_DESC ( init  ,
"Set to non-zero to force chip initialization."   
)
MODULE_PARM_DESC ( vccp_limit_type  ,
"Configures in7 and in8 limit modes."   
)
MODULE_PARM_DESC ( vid_agtl  ,
"Configures VID pin input thresholds."   
)

Variable Documentation

Definition at line 176 of file lm93.c.

u8 len

Definition at line 176 of file lm93.c.