Linux Kernel
3.7.1
|
#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/acpi.h>
#include <linux/io.h>
Go to the source code of this file.
Data Structures | |
struct | pc87360_data |
Macros | |
#define | pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
#define | DEV 0x07 /* Register: Logical device select */ |
#define | DEVID 0x20 /* Register: Device ID */ |
#define | ACT 0x30 /* Register: Device activation */ |
#define | BASE 0x60 /* Register: Base address */ |
#define | FSCM 0x09 /* Logical device: fans */ |
#define | VLM 0x0d /* Logical device: voltages */ |
#define | TMS 0x0e /* Logical device: temperatures */ |
#define | LDNI_MAX 3 |
#define | LD_FAN 0 |
#define | LD_IN 1 |
#define | LD_TEMP 2 |
#define | PC87360_EXTENT 0x10 |
#define | PC87365_REG_BANK 0x09 |
#define | NO_BANK 0xff |
#define | PC87360_REG_PRESCALE(nr) (0x00 + 2 * (nr)) |
#define | PC87360_REG_PWM(nr) (0x01 + 2 * (nr)) |
#define | PC87360_REG_FAN_MIN(nr) (0x06 + 3 * (nr)) |
#define | PC87360_REG_FAN(nr) (0x07 + 3 * (nr)) |
#define | PC87360_REG_FAN_STATUS(nr) (0x08 + 3 * (nr)) |
#define | FAN_FROM_REG(val, div) |
#define | FAN_TO_REG(val, div) |
#define | FAN_DIV_FROM_REG(val) (1 << (((val) >> 5) & 0x03)) |
#define | FAN_STATUS_FROM_REG(val) ((val) & 0x07) |
#define | FAN_CONFIG_MONITOR(val, nr) (((val) >> (2 + (nr) * 3)) & 1) |
#define | FAN_CONFIG_CONTROL(val, nr) (((val) >> (3 + (nr) * 3)) & 1) |
#define | FAN_CONFIG_INVERT(val, nr) (((val) >> (4 + (nr) * 3)) & 1) |
#define | PWM_FROM_REG(val, inv) ((inv) ? 255 - (val) : (val)) |
#define | PC87365_REG_IN_CONVRATE 0x07 |
#define | PC87365_REG_IN_CONFIG 0x08 |
#define | PC87365_REG_IN 0x0B |
#define | PC87365_REG_IN_MIN 0x0D |
#define | PC87365_REG_IN_MAX 0x0C |
#define | PC87365_REG_IN_STATUS 0x0A |
#define | PC87365_REG_IN_ALARMS1 0x00 |
#define | PC87365_REG_IN_ALARMS2 0x01 |
#define | PC87365_REG_VID 0x06 |
#define | IN_FROM_REG(val, ref) (((val) * (ref) + 128) / 256) |
#define | IN_TO_REG(val, ref) |
#define | PC87365_REG_TEMP_CONFIG 0x08 |
#define | PC87365_REG_TEMP 0x0B |
#define | PC87365_REG_TEMP_MIN 0x0D |
#define | PC87365_REG_TEMP_MAX 0x0C |
#define | PC87365_REG_TEMP_CRIT 0x0E |
#define | PC87365_REG_TEMP_STATUS 0x0A |
#define | PC87365_REG_TEMP_ALARMS 0x00 |
#define | TEMP_FROM_REG(val) ((val) * 1000) |
#define | TEMP_TO_REG(val) |
#define | FAN_UNIT_ATTRS(X) |
#define | CHAN_ALM_MIN 0x02 /* min limit crossed */ |
#define | CHAN_ALM_MAX 0x04 /* max limit exceeded */ |
#define | TEMP_ALM_CRIT 0x08 /* temp crit exceeded (temp only) */ |
#define | VIN_UNIT_ATTRS(X) |
#define | THERM_UNIT_ATTRS(X) |
#define | TEMP_FAULT 0x40 /* open diode */ |
#define | TEMP_UNIT_ATTRS(X) |
#define | CHAN_CNVRTD 0x80 /* new data ready */ |
#define | CHAN_ENA 0x01 /* enabled channel (temp or vin) */ |
#define | CHAN_ALM_ENA 0x10 /* propagate to alarms-reg ?? (chk val!) */ |
#define | CHAN_READY (CHAN_ENA|CHAN_CNVRTD) /* sample ready mask */ |
#define | TEMP_OTS_OE 0x20 /* OTS Output Enable */ |
#define | VIN_RW1C_MASK (CHAN_READY|CHAN_ALM_MAX|CHAN_ALM_MIN) /* 0x87 */ |
#define | TEMP_RW1C_MASK (VIN_RW1C_MASK|TEMP_ALM_CRIT|TEMP_FAULT) /* 0xCF */ |
Functions | |
module_param (init, int, 0) | |
MODULE_PARM_DESC (init,"Chip initialization level:\n"" 0: None\n""*1: Forcibly enable internal voltage and temperature channels, except in9\n"" 2: Forcibly enable all voltage and temperature channels, except in9\n"" 3: Forcibly enable all voltage and temperature channels, including in9") | |
module_param (force_id, ushort, 0) | |
MODULE_PARM_DESC (force_id,"Override the detected device ID") | |
MODULE_AUTHOR ("Jean Delvare <[email protected]>") | |
MODULE_DESCRIPTION ("PC8736x hardware monitor") | |
MODULE_LICENSE ("GPL") | |
module_init (pc87360_init) | |
module_exit (pc87360_exit) | |
#define CHAN_ALM_ENA 0x10 /* propagate to alarms-reg ?? (chk val!) */ |
#define CHAN_ENA 0x01 /* enabled channel (temp or vin) */ |
#define CHAN_READY (CHAN_ENA|CHAN_CNVRTD) /* sample ready mask */ |
#define FAN_UNIT_ATTRS | ( | X | ) |
#define IN_TO_REG | ( | val, | |
ref | |||
) |
#define TEMP_ALM_CRIT 0x08 /* temp crit exceeded (temp only) */ |
#define TEMP_RW1C_MASK (VIN_RW1C_MASK|TEMP_ALM_CRIT|TEMP_FAULT) /* 0xCF */ |
#define TEMP_TO_REG | ( | val | ) |
#define TEMP_UNIT_ATTRS | ( | X | ) |
#define THERM_UNIT_ATTRS | ( | X | ) |
#define VIN_RW1C_MASK (CHAN_READY|CHAN_ALM_MAX|CHAN_ALM_MIN) /* 0x87 */ |
#define VIN_UNIT_ATTRS | ( | X | ) |
MODULE_AUTHOR | ( | "Jean Delvare <[email protected]>" | ) |
MODULE_DESCRIPTION | ( | "PC8736x hardware monitor" | ) |
module_exit | ( | pc87360_exit | ) |
module_init | ( | pc87360_init | ) |
MODULE_LICENSE | ( | "GPL" | ) |
module_param | ( | force_id | , |
ushort | , | ||
0 | |||
) |
MODULE_PARM_DESC | ( | init | , |
"Chip initialization level:\n"" 0: None\n""*1: Forcibly enable internal voltage and temperature | channels, | ||
except in9\n""2:Forcibly enable all voltage and temperature | channels, | ||
except in9\n""3:Forcibly enable all voltage and temperature | channels, | ||
including in9" | |||
) |