Linux Kernel
3.7.1
|
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
#include <linux/i2c.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/mutex.h>
Go to the source code of this file.
Data Structures | |
struct | adm1031_data |
Macros | |
#define | ADM1031_REG_FAN_SPEED(nr) (0x08 + (nr)) |
#define | ADM1031_REG_FAN_DIV(nr) (0x20 + (nr)) |
#define | ADM1031_REG_PWM (0x22) |
#define | ADM1031_REG_FAN_MIN(nr) (0x10 + (nr)) |
#define | ADM1031_REG_FAN_FILTER (0x23) |
#define | ADM1031_REG_TEMP_OFFSET(nr) (0x0d + (nr)) |
#define | ADM1031_REG_TEMP_MAX(nr) (0x14 + 4 * (nr)) |
#define | ADM1031_REG_TEMP_MIN(nr) (0x15 + 4 * (nr)) |
#define | ADM1031_REG_TEMP_CRIT(nr) (0x16 + 4 * (nr)) |
#define | ADM1031_REG_TEMP(nr) (0x0a + (nr)) |
#define | ADM1031_REG_AUTO_TEMP(nr) (0x24 + (nr)) |
#define | ADM1031_REG_STATUS(nr) (0x2 + (nr)) |
#define | ADM1031_REG_CONF1 0x00 |
#define | ADM1031_REG_CONF2 0x01 |
#define | ADM1031_REG_EXT_TEMP 0x06 |
#define | ADM1031_CONF1_MONITOR_ENABLE 0x01 /* Monitoring enable */ |
#define | ADM1031_CONF1_PWM_INVERT 0x08 /* PWM Invert */ |
#define | ADM1031_CONF1_AUTO_MODE 0x80 /* Auto FAN */ |
#define | ADM1031_CONF2_PWM1_ENABLE 0x01 |
#define | ADM1031_CONF2_PWM2_ENABLE 0x02 |
#define | ADM1031_CONF2_TACH1_ENABLE 0x04 |
#define | ADM1031_CONF2_TACH2_ENABLE 0x08 |
#define | ADM1031_CONF2_TEMP_ENABLE(chan) (0x10 << (chan)) |
#define | ADM1031_UPDATE_RATE_MASK 0x1c |
#define | ADM1031_UPDATE_RATE_SHIFT 2 |
#define | TEMP_TO_REG(val) |
#define | TEMP_FROM_REG(val) ((val) * 1000) |
#define | TEMP_FROM_REG_EXT(val, ext) (TEMP_FROM_REG(val) + (ext) * 125) |
#define | TEMP_OFFSET_TO_REG(val) (TEMP_TO_REG(val) & 0x8f) |
#define | TEMP_OFFSET_FROM_REG(val) |
#define | FAN_FROM_REG(reg, div) |
#define | FAN_DIV_FROM_REG(reg) (1<<(((reg)&0xc0)>>6)) |
#define | PWM_TO_REG(val) (SENSORS_LIMIT((val), 0, 255) >> 4) |
#define | PWM_FROM_REG(val) ((val) << 4) |
#define | FAN_CHAN_FROM_REG(reg) (((reg) >> 5) & 7) |
#define | FAN_CHAN_TO_REG(val, reg) (((reg) & 0x1F) | (((val) << 5) & 0xe0)) |
#define | AUTO_TEMP_MIN_TO_REG(val, reg) ((((val) / 500) & 0xf8) | ((reg) & 0x7)) |
#define | AUTO_TEMP_RANGE_FROM_REG(reg) (5000 * (1 << ((reg) & 0x7))) |
#define | AUTO_TEMP_MIN_FROM_REG(reg) (1000 * ((((reg) >> 3) & 0x1f) << 2)) |
#define | AUTO_TEMP_MIN_FROM_REG_DEG(reg) ((((reg) >> 3) & 0x1f) << 2) |
#define | AUTO_TEMP_OFF_FROM_REG(reg) (AUTO_TEMP_MIN_FROM_REG(reg) - 5000) |
#define | AUTO_TEMP_MAX_FROM_REG(reg) |
#define | GET_FAN_AUTO_BITFIELD(data, idx) (*(data)->chan_select_table)[FAN_CHAN_FROM_REG((data)->conf1)][idx % 2] |
#define | auto_temp_reg(offset) |
#define | fan_offset(offset) |
#define | temp_reg(offset) |
Typedefs | |
typedef u8 | auto_chan_table_t [8][2] |
Functions | |
MODULE_DEVICE_TABLE (i2c, adm1031_id) | |
auto_temp_reg (1) | |
auto_temp_reg (2) | |
auto_temp_reg (3) | |
fan_offset (1) | |
fan_offset (2) | |
temp_reg (1) | |
temp_reg (2) | |
temp_reg (3) | |
module_i2c_driver (adm1031_driver) | |
MODULE_AUTHOR ("Alexandre d'Alton <[email protected]>") | |
MODULE_DESCRIPTION ("ADM1031/ADM1030 driver") | |
MODULE_LICENSE ("GPL") | |
#define ADM1031_CONF1_MONITOR_ENABLE 0x01 /* Monitoring enable */ |
#define AUTO_TEMP_MAX_FROM_REG | ( | reg | ) |
#define AUTO_TEMP_OFF_FROM_REG | ( | reg | ) | (AUTO_TEMP_MIN_FROM_REG(reg) - 5000) |
#define auto_temp_reg | ( | offset | ) |
#define fan_offset | ( | offset | ) |
#define TEMP_FROM_REG_EXT | ( | val, | |
ext | |||
) | (TEMP_FROM_REG(val) + (ext) * 125) |
#define TEMP_OFFSET_FROM_REG | ( | val | ) |
#define TEMP_OFFSET_TO_REG | ( | val | ) | (TEMP_TO_REG(val) & 0x8f) |
#define temp_reg | ( | offset | ) |
#define TEMP_TO_REG | ( | val | ) |
enum chips |
auto_temp_reg | ( | 1 | ) |
auto_temp_reg | ( | 2 | ) |
auto_temp_reg | ( | 3 | ) |
fan_offset | ( | 1 | ) |
fan_offset | ( | 2 | ) |
MODULE_AUTHOR | ( | "Alexandre d'Alton <[email protected]>" | ) |
MODULE_DESCRIPTION | ( | "ADM1031/ADM1030 driver" | ) |
MODULE_DEVICE_TABLE | ( | i2c | , |
adm1031_id | |||
) |
module_i2c_driver | ( | adm1031_driver | ) |
MODULE_LICENSE | ( | "GPL" | ) |
temp_reg | ( | 1 | ) |
temp_reg | ( | 2 | ) |
temp_reg | ( | 3 | ) |