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

Go to the source code of this file.

Data Structures

struct  pem_data
 

Macros

#define PEM_OPERATION   0x01
 
#define PEM_CLEAR_INFO_FLAGS   0x03
 
#define PEM_VOUT_COMMAND   0x21
 
#define PEM_VOUT_OV_FAULT_LIMIT   0x40
 
#define PEM_READ_DATA_STRING   0xd0
 
#define PEM_READ_INPUT_STRING   0xdc
 
#define PEM_READ_FIRMWARE_REV   0xdd
 
#define PEM_READ_RUN_TIMER   0xde
 
#define PEM_FAN_HI_SPEED   0xdf
 
#define PEM_FAN_NORMAL_SPEED   0xe0
 
#define PEM_READ_FAN_SPEED   0xe1
 
#define PEM_DATA_STATUS_2   0
 
#define PEM_DATA_STATUS_1   1
 
#define PEM_DATA_ALARM_2   2
 
#define PEM_DATA_ALARM_1   3
 
#define PEM_DATA_VOUT_LSB   4
 
#define PEM_DATA_VOUT_MSB   5
 
#define PEM_DATA_CURRENT   6
 
#define PEM_DATA_TEMP   7
 
#define PEM_DATA_TEMP_MAX   10
 
#define PEM_DATA_TEMP_CRIT   11
 
#define PEM_INPUT_VOLTAGE   0
 
#define PEM_INPUT_POWER_LSB   1
 
#define PEM_INPUT_POWER_MSB   2
 
#define PEM_FAN_ADJUSTMENT   0
 
#define PEM_FAN_FAN1   1
 
#define PEM_FAN_FAN2   2
 
#define PEM_FAN_FAN3   3
 
#define STS1_OUTPUT_ON   (1 << 0)
 
#define STS1_LEDS_FLASHING   (1 << 1)
 
#define STS1_EXT_FAULT   (1 << 2)
 
#define STS1_SERVICE_LED_ON   (1 << 3)
 
#define STS1_SHUTDOWN_OCCURRED   (1 << 4)
 
#define STS1_INT_FAULT   (1 << 5)
 
#define STS1_ISOLATION_TEST_OK   (1 << 6)
 
#define STS2_ENABLE_PIN_HI   (1 << 0)
 
#define STS2_DATA_OUT_RANGE   (1 << 1)
 
#define STS2_RESTARTED_OK   (1 << 1)
 
#define STS2_ISOLATION_TEST_FAIL   (1 << 3)
 
#define STS2_HIGH_POWER_CAP   (1 << 4)
 
#define STS2_INVALID_INSTR   (1 << 5)
 
#define STS2_WILL_RESTART   (1 << 6)
 
#define STS2_PEC_ERR   (1 << 7)
 
#define ALRM1_VIN_OUT_LIMIT   (1 << 0)
 
#define ALRM1_VOUT_OUT_LIMIT   (1 << 1)
 
#define ALRM1_OV_VOLT_SHUTDOWN   (1 << 2)
 
#define ALRM1_VIN_OVERCURRENT   (1 << 3)
 
#define ALRM1_TEMP_WARNING   (1 << 4)
 
#define ALRM1_TEMP_SHUTDOWN   (1 << 5)
 
#define ALRM1_PRIMARY_FAULT   (1 << 6)
 
#define ALRM1_POWER_LIMIT   (1 << 7)
 
#define ALRM2_5V_OUT_LIMIT   (1 << 1)
 
#define ALRM2_TEMP_FAULT   (1 << 2)
 
#define ALRM2_OV_LOW   (1 << 3)
 
#define ALRM2_DCDC_TEMP_HIGH   (1 << 4)
 
#define ALRM2_PRI_TEMP_HIGH   (1 << 5)
 
#define ALRM2_NO_PRIMARY   (1 << 6)
 
#define ALRM2_FAN_FAULT   (1 << 7)
 
#define FIRMWARE_REV_LEN   4
 
#define DATA_STRING_LEN   9
 
#define INPUT_STRING_LEN   5 /* 4 for most devices */
 
#define FAN_SPEED_LEN   5
 

Functions

 MODULE_DEVICE_TABLE (i2c, pem_id)
 
 module_i2c_driver (pem_driver)
 
 MODULE_AUTHOR ("Guenter Roeck <[email protected]>")
 
 MODULE_DESCRIPTION ("Lineage CPL PEM hardware monitoring driver")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ALRM1_OV_VOLT_SHUTDOWN   (1 << 2)

Definition at line 107 of file lineage-pem.c.

#define ALRM1_POWER_LIMIT   (1 << 7)

Definition at line 112 of file lineage-pem.c.

#define ALRM1_PRIMARY_FAULT   (1 << 6)

Definition at line 111 of file lineage-pem.c.

#define ALRM1_TEMP_SHUTDOWN   (1 << 5)

Definition at line 110 of file lineage-pem.c.

#define ALRM1_TEMP_WARNING   (1 << 4)

Definition at line 109 of file lineage-pem.c.

#define ALRM1_VIN_OUT_LIMIT   (1 << 0)

Definition at line 105 of file lineage-pem.c.

#define ALRM1_VIN_OVERCURRENT   (1 << 3)

Definition at line 108 of file lineage-pem.c.

#define ALRM1_VOUT_OUT_LIMIT   (1 << 1)

Definition at line 106 of file lineage-pem.c.

#define ALRM2_5V_OUT_LIMIT   (1 << 1)

Definition at line 114 of file lineage-pem.c.

#define ALRM2_DCDC_TEMP_HIGH   (1 << 4)

Definition at line 117 of file lineage-pem.c.

#define ALRM2_FAN_FAULT   (1 << 7)

Definition at line 120 of file lineage-pem.c.

#define ALRM2_NO_PRIMARY   (1 << 6)

Definition at line 119 of file lineage-pem.c.

#define ALRM2_OV_LOW   (1 << 3)

Definition at line 116 of file lineage-pem.c.

#define ALRM2_PRI_TEMP_HIGH   (1 << 5)

Definition at line 118 of file lineage-pem.c.

#define ALRM2_TEMP_FAULT   (1 << 2)

Definition at line 115 of file lineage-pem.c.

#define DATA_STRING_LEN   9

Definition at line 123 of file lineage-pem.c.

#define FAN_SPEED_LEN   5

Definition at line 125 of file lineage-pem.c.

#define FIRMWARE_REV_LEN   4

Definition at line 122 of file lineage-pem.c.

#define INPUT_STRING_LEN   5 /* 4 for most devices */

Definition at line 124 of file lineage-pem.c.

#define PEM_CLEAR_INFO_FLAGS   0x03

Definition at line 50 of file lineage-pem.c.

#define PEM_DATA_ALARM_1   3

Definition at line 65 of file lineage-pem.c.

#define PEM_DATA_ALARM_2   2

Definition at line 64 of file lineage-pem.c.

#define PEM_DATA_CURRENT   6

Definition at line 68 of file lineage-pem.c.

#define PEM_DATA_STATUS_1   1

Definition at line 63 of file lineage-pem.c.

#define PEM_DATA_STATUS_2   0

Definition at line 62 of file lineage-pem.c.

#define PEM_DATA_TEMP   7

Definition at line 69 of file lineage-pem.c.

#define PEM_DATA_TEMP_CRIT   11

Definition at line 73 of file lineage-pem.c.

#define PEM_DATA_TEMP_MAX   10

Definition at line 72 of file lineage-pem.c.

#define PEM_DATA_VOUT_LSB   4

Definition at line 66 of file lineage-pem.c.

#define PEM_DATA_VOUT_MSB   5

Definition at line 67 of file lineage-pem.c.

#define PEM_FAN_ADJUSTMENT   0

Definition at line 81 of file lineage-pem.c.

#define PEM_FAN_FAN1   1

Definition at line 82 of file lineage-pem.c.

#define PEM_FAN_FAN2   2

Definition at line 83 of file lineage-pem.c.

#define PEM_FAN_FAN3   3

Definition at line 84 of file lineage-pem.c.

#define PEM_FAN_HI_SPEED   0xdf

Definition at line 57 of file lineage-pem.c.

#define PEM_FAN_NORMAL_SPEED   0xe0

Definition at line 58 of file lineage-pem.c.

#define PEM_INPUT_POWER_LSB   1

Definition at line 77 of file lineage-pem.c.

#define PEM_INPUT_POWER_MSB   2

Definition at line 78 of file lineage-pem.c.

#define PEM_INPUT_VOLTAGE   0

Definition at line 76 of file lineage-pem.c.

#define PEM_OPERATION   0x01

Definition at line 49 of file lineage-pem.c.

#define PEM_READ_DATA_STRING   0xd0

Definition at line 53 of file lineage-pem.c.

#define PEM_READ_FAN_SPEED   0xe1

Definition at line 59 of file lineage-pem.c.

#define PEM_READ_FIRMWARE_REV   0xdd

Definition at line 55 of file lineage-pem.c.

#define PEM_READ_INPUT_STRING   0xdc

Definition at line 54 of file lineage-pem.c.

#define PEM_READ_RUN_TIMER   0xde

Definition at line 56 of file lineage-pem.c.

#define PEM_VOUT_COMMAND   0x21

Definition at line 51 of file lineage-pem.c.

#define PEM_VOUT_OV_FAULT_LIMIT   0x40

Definition at line 52 of file lineage-pem.c.

#define STS1_EXT_FAULT   (1 << 2)

Definition at line 89 of file lineage-pem.c.

#define STS1_INT_FAULT   (1 << 5)

Definition at line 92 of file lineage-pem.c.

#define STS1_ISOLATION_TEST_OK   (1 << 6)

Definition at line 93 of file lineage-pem.c.

#define STS1_LEDS_FLASHING   (1 << 1)

Definition at line 88 of file lineage-pem.c.

#define STS1_OUTPUT_ON   (1 << 0)

Definition at line 87 of file lineage-pem.c.

#define STS1_SERVICE_LED_ON   (1 << 3)

Definition at line 90 of file lineage-pem.c.

#define STS1_SHUTDOWN_OCCURRED   (1 << 4)

Definition at line 91 of file lineage-pem.c.

#define STS2_DATA_OUT_RANGE   (1 << 1)

Definition at line 96 of file lineage-pem.c.

#define STS2_ENABLE_PIN_HI   (1 << 0)

Definition at line 95 of file lineage-pem.c.

#define STS2_HIGH_POWER_CAP   (1 << 4)

Definition at line 99 of file lineage-pem.c.

#define STS2_INVALID_INSTR   (1 << 5)

Definition at line 100 of file lineage-pem.c.

#define STS2_ISOLATION_TEST_FAIL   (1 << 3)

Definition at line 98 of file lineage-pem.c.

#define STS2_PEC_ERR   (1 << 7)

Definition at line 102 of file lineage-pem.c.

#define STS2_RESTARTED_OK   (1 << 1)

Definition at line 97 of file lineage-pem.c.

#define STS2_WILL_RESTART   (1 << 6)

Definition at line 101 of file lineage-pem.c.

Function Documentation

MODULE_AUTHOR ( "Guenter Roeck <[email protected]>"  )
MODULE_DESCRIPTION ( "Lineage CPL PEM hardware monitoring driver )
MODULE_DEVICE_TABLE ( i2c  ,
pem_id   
)
module_i2c_driver ( pem_driver  )
MODULE_LICENSE ( "GPL"  )