Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pc87427.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/err.h>
#include <linux/mutex.h>
#include <linux/sysfs.h>
#include <linux/ioport.h>
#include <linux/acpi.h>
#include <linux/io.h>

Go to the source code of this file.

Data Structures

struct  pc87427_data
 
struct  pc87427_sio_data
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define DRVNAME   "pc87427"
 
#define SIOREG_LDSEL   0x07 /* Logical device select */
 
#define SIOREG_DEVID   0x20 /* Device ID */
 
#define SIOREG_CF2   0x22 /* Configuration 2 */
 
#define SIOREG_CF3   0x23 /* Configuration 3 */
 
#define SIOREG_CF4   0x24 /* Configuration 4 */
 
#define SIOREG_CF5   0x25 /* Configuration 5 */
 
#define SIOREG_CFB   0x2B /* Configuration B */
 
#define SIOREG_CFC   0x2C /* Configuration C */
 
#define SIOREG_CFD   0x2D /* Configuration D */
 
#define SIOREG_ACT   0x30 /* Device activation */
 
#define SIOREG_MAP   0x50 /* I/O or memory mapping */
 
#define SIOREG_IOBASE   0x60 /* I/O base address */
 
#define LD_FAN   0
 
#define LD_IN   1
 
#define LD_TEMP   1
 
#define REGION_LENGTH   32
 
#define PC87427_REG_BANK   0x0f
 
#define BANK_FM(nr)   (nr)
 
#define BANK_FT(nr)   (0x08 + (nr))
 
#define BANK_FC(nr)   (0x10 + (nr) * 2)
 
#define BANK_TM(nr)   (nr)
 
#define BANK_VM(nr)   (0x08 + (nr))
 
#define PC87427_REG_FAN   0x12
 
#define PC87427_REG_FAN_MIN   0x14
 
#define PC87427_REG_FAN_STATUS   0x10
 
#define FAN_STATUS_STALL   (1 << 3)
 
#define FAN_STATUS_LOSPD   (1 << 1)
 
#define FAN_STATUS_MONEN   (1 << 0)
 
#define PC87427_REG_PWM_ENABLE   0x10
 
#define PC87427_REG_PWM_DUTY   0x12
 
#define PWM_ENABLE_MODE_MASK   (7 << 4)
 
#define PWM_ENABLE_CTLEN   (1 << 0)
 
#define PWM_MODE_MANUAL   (0 << 4)
 
#define PWM_MODE_AUTO   (1 << 4)
 
#define PWM_MODE_OFF   (2 << 4)
 
#define PWM_MODE_ON   (7 << 4)
 
#define PC87427_REG_TEMP_STATUS   0x10
 
#define PC87427_REG_TEMP   0x14
 
#define PC87427_REG_TEMP_MAX   0x18
 
#define PC87427_REG_TEMP_MIN   0x19
 
#define PC87427_REG_TEMP_CRIT   0x1a
 
#define PC87427_REG_TEMP_TYPE   0x1d
 
#define TEMP_STATUS_CHANEN   (1 << 0)
 
#define TEMP_STATUS_LOWFLG   (1 << 1)
 
#define TEMP_STATUS_HIGHFLG   (1 << 2)
 
#define TEMP_STATUS_CRITFLG   (1 << 3)
 
#define TEMP_STATUS_SENSERR   (1 << 5)
 
#define TEMP_TYPE_MASK   (3 << 5)
 
#define TEMP_TYPE_THERMISTOR   (1 << 5)
 
#define TEMP_TYPE_REMOTE_DIODE   (2 << 5)
 
#define TEMP_TYPE_LOCAL_DIODE   (3 << 5)
 

Functions

 module_param (force_id, ushort, 0)
 
 MODULE_PARM_DESC (force_id,"Override the detected device ID")
 
 MODULE_AUTHOR ("Jean Delvare <[email protected]>")
 
 MODULE_DESCRIPTION ("PC87427 hardware monitoring driver")
 
 MODULE_LICENSE ("GPL")
 
 module_init (pc87427_init)
 
 module_exit (pc87427_exit)
 

Macro Definition Documentation

#define BANK_FC (   nr)    (0x10 + (nr) * 2)

Definition at line 135 of file pc87427.c.

#define BANK_FM (   nr)    (nr)

Definition at line 133 of file pc87427.c.

#define BANK_FT (   nr)    (0x08 + (nr))

Definition at line 134 of file pc87427.c.

#define BANK_TM (   nr)    (nr)

Definition at line 136 of file pc87427.c.

#define BANK_VM (   nr)    (0x08 + (nr))

Definition at line 137 of file pc87427.c.

#define DRVNAME   "pc87427"

Definition at line 47 of file pc87427.c.

#define FAN_STATUS_LOSPD   (1 << 1)

Definition at line 175 of file pc87427.c.

#define FAN_STATUS_MONEN   (1 << 0)

Definition at line 176 of file pc87427.c.

#define FAN_STATUS_STALL   (1 << 3)

Definition at line 174 of file pc87427.c.

#define LD_FAN   0

Definition at line 105 of file pc87427.c.

#define LD_IN   1

Definition at line 106 of file pc87427.c.

#define LD_TEMP   1

Definition at line 107 of file pc87427.c.

#define PC87427_REG_BANK   0x0f

Definition at line 132 of file pc87427.c.

#define PC87427_REG_FAN   0x12

Definition at line 170 of file pc87427.c.

#define PC87427_REG_FAN_MIN   0x14

Definition at line 171 of file pc87427.c.

#define PC87427_REG_FAN_STATUS   0x10

Definition at line 172 of file pc87427.c.

#define PC87427_REG_PWM_DUTY   0x12

Definition at line 223 of file pc87427.c.

#define PC87427_REG_PWM_ENABLE   0x10

Definition at line 222 of file pc87427.c.

#define PC87427_REG_TEMP   0x14

Definition at line 280 of file pc87427.c.

#define PC87427_REG_TEMP_CRIT   0x1a

Definition at line 283 of file pc87427.c.

#define PC87427_REG_TEMP_MAX   0x18

Definition at line 281 of file pc87427.c.

#define PC87427_REG_TEMP_MIN   0x19

Definition at line 282 of file pc87427.c.

#define PC87427_REG_TEMP_STATUS   0x10

Definition at line 279 of file pc87427.c.

#define PC87427_REG_TEMP_TYPE   0x1d

Definition at line 284 of file pc87427.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 25 of file pc87427.c.

#define PWM_ENABLE_CTLEN   (1 << 0)

Definition at line 226 of file pc87427.c.

#define PWM_ENABLE_MODE_MASK   (7 << 4)

Definition at line 225 of file pc87427.c.

#define PWM_MODE_AUTO   (1 << 4)

Definition at line 229 of file pc87427.c.

#define PWM_MODE_MANUAL   (0 << 4)

Definition at line 228 of file pc87427.c.

#define PWM_MODE_OFF   (2 << 4)

Definition at line 230 of file pc87427.c.

#define PWM_MODE_ON   (7 << 4)

Definition at line 231 of file pc87427.c.

#define REGION_LENGTH   32

Definition at line 131 of file pc87427.c.

#define SIOREG_ACT   0x30 /* Device activation */

Definition at line 99 of file pc87427.c.

#define SIOREG_CF2   0x22 /* Configuration 2 */

Definition at line 92 of file pc87427.c.

#define SIOREG_CF3   0x23 /* Configuration 3 */

Definition at line 93 of file pc87427.c.

#define SIOREG_CF4   0x24 /* Configuration 4 */

Definition at line 94 of file pc87427.c.

#define SIOREG_CF5   0x25 /* Configuration 5 */

Definition at line 95 of file pc87427.c.

#define SIOREG_CFB   0x2B /* Configuration B */

Definition at line 96 of file pc87427.c.

#define SIOREG_CFC   0x2C /* Configuration C */

Definition at line 97 of file pc87427.c.

#define SIOREG_CFD   0x2D /* Configuration D */

Definition at line 98 of file pc87427.c.

#define SIOREG_DEVID   0x20 /* Device ID */

Definition at line 91 of file pc87427.c.

#define SIOREG_IOBASE   0x60 /* I/O base address */

Definition at line 101 of file pc87427.c.

#define SIOREG_LDSEL   0x07 /* Logical device select */

Definition at line 90 of file pc87427.c.

#define SIOREG_MAP   0x50 /* I/O or memory mapping */

Definition at line 100 of file pc87427.c.

#define TEMP_STATUS_CHANEN   (1 << 0)

Definition at line 286 of file pc87427.c.

#define TEMP_STATUS_CRITFLG   (1 << 3)

Definition at line 289 of file pc87427.c.

#define TEMP_STATUS_HIGHFLG   (1 << 2)

Definition at line 288 of file pc87427.c.

#define TEMP_STATUS_LOWFLG   (1 << 1)

Definition at line 287 of file pc87427.c.

#define TEMP_STATUS_SENSERR   (1 << 5)

Definition at line 290 of file pc87427.c.

#define TEMP_TYPE_LOCAL_DIODE   (3 << 5)

Definition at line 295 of file pc87427.c.

#define TEMP_TYPE_MASK   (3 << 5)

Definition at line 291 of file pc87427.c.

#define TEMP_TYPE_REMOTE_DIODE   (2 << 5)

Definition at line 294 of file pc87427.c.

#define TEMP_TYPE_THERMISTOR   (1 << 5)

Definition at line 293 of file pc87427.c.

Function Documentation

MODULE_AUTHOR ( "Jean Delvare <[email protected]>"  )
MODULE_DESCRIPTION ( "PC87427 hardware monitoring driver )
module_exit ( pc87427_exit  )
module_init ( pc87427_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( force_id  ,
ushort  ,
 
)
MODULE_PARM_DESC ( force_id  ,
"Override the detected device ID  
)