0001
0002 #ifndef __LOONGSON_HWMON_H_
0003 #define __LOONGSON_HWMON_H_
0004
0005 #include <linux/types.h>
0006
0007 #define MIN_TEMP 0
0008 #define MAX_TEMP 255
0009 #define NOT_VALID_TEMP 999
0010
0011 typedef int (*get_temp_fun)(int);
0012 extern int loongson3_cpu_temp(int);
0013
0014
0015 enum fan_control_mode {
0016 FAN_FULL_MODE = 0,
0017 FAN_MANUAL_MODE = 1,
0018 FAN_AUTO_MODE = 2,
0019 FAN_MODE_END
0020 };
0021
0022 struct temp_range {
0023 u8 low;
0024 u8 high;
0025 u8 level;
0026 };
0027
0028 #define CONSTANT_SPEED_POLICY 0
0029 #define STEP_SPEED_POLICY 1
0030 #define KERNEL_HELPER_POLICY 2
0031
0032 #define MAX_STEP_NUM 16
0033 #define MAX_FAN_LEVEL 255
0034
0035
0036 struct loongson_fan_policy {
0037 u8 type;
0038
0039
0040 u8 percent;
0041
0042
0043 u8 adjust_period;
0044
0045
0046 get_temp_fun depend_temp;
0047
0048
0049 u8 up_step_num;
0050 u8 down_step_num;
0051 struct temp_range up_step[MAX_STEP_NUM];
0052 struct temp_range down_step[MAX_STEP_NUM];
0053 struct delayed_work work;
0054 };
0055
0056 #endif