1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #define LM_POST_RAM 0x00
24 #define LM_VALUE_RAM 0x20
25 #define LM_FAN1 0x28
26 #define LM_FAN2 0x29
27 #define LM_FAN3 0x2a
28
29 #define LM_CONFIG 0x40
30 #define LM_ISR1 0x41
31 #define LM_ISR2 0x42
32 #define LM_SMI1 0x43
33 #define LM_SMI2 0x44
34 #define LM_NMI1 0x45
35 #define LM_NMI2 0x46
36 #define LM_VIDFAN 0x47
37 #define LM_SBUSADDR 0x48
38 #define LM_CHIPID 0x49
39
40
41
42 #define LM_CHIPID_LM78 0x00
43 #define LM_CHIPID_LM78J 0x40
44 #define LM_CHIPID_LM79 0xC0
45 #define LM_CHIPID_LM81 0x80
46 #define LM_CHIPID_MASK 0xfe
47
48
49
50
51
52
53
54
55
56
57
58 #define WB_T23ADDR 0x4a
59 #define WB_PIN 0x4b
60 #define WB_BANKSEL 0x4e
61 #define WB_VENDID 0x4f
62
63
64 #define WB_BANK0_CHIPID 0x58
65 #define WB_BANK0_FAN45 0x5c
66 #define WB_BANK0_VBAT 0x5d
67 #define WB_BANK0_FAN4 0xba
68 #define WB_BANK0_FAN5 0xbb
69
70 #define WB_BANK0_CONFIG 0x18
71
72
73 #define WB_BANK1_T2H 0x50
74 #define WB_BANK1_T2L 0x51
75
76
77 #define WB_BANK2_T3H 0x50
78 #define WB_BANK2_T3L 0x51
79
80
81 #define WB_BANK4_T1OFF 0x54
82 #define WB_BANK4_T2OFF 0x55
83 #define WB_BANK4_T3OFF 0x56
84
85
86 #define WB_BANK5_5VSB 0x50
87 #define WB_BANK5_VBAT 0x51
88
89
90 #define WB_BANKSEL_B0 0x00
91 #define WB_BANKSEL_B1 0x01
92 #define WB_BANKSEL_B2 0x02
93 #define WB_BANKSEL_B3 0x03
94 #define WB_BANKSEL_B4 0x04
95 #define WB_BANKSEL_B5 0x05
96 #define WB_BANKSEL_HBAC 0x80
97
98
99 #define WB_VENDID_WINBOND 0x5ca3
100 #define WB_VENDID_ASUS 0x12c3
101
102
103 #define WB_CHIPID_W83781D 0x10
104 #define WB_CHIPID_W83781D_2 0x11
105 #define WB_CHIPID_W83627HF 0x21
106 #define WB_CHIPID_AS99127F 0x31
107 #define WB_CHIPID_W83782D 0x30
108 #define WB_CHIPID_W83783S 0x40
109 #define WB_CHIPID_W83697HF 0x60
110 #define WB_CHIPID_W83791D 0x71
111 #define WB_CHIPID_W83791SD 0x72
112 #define WB_CHIPID_W83792D 0x7a
113 #define WB_CHIPID_W83637HF 0x80
114 #define WB_CHIPID_W83627EHF_A 0x88
115 #define WB_CHIPID_W83627THF 0x90
116 #define WB_CHIPID_W83627EHF 0xa1
117 #define WB_CHIPID_W83627DHG 0xc1
118
119
120 #define WB_CONFIG_VMR9 0x01
121
122
123 #define WB_VREF 3600
124 #define WB_W83627EHF_VREF 2048
125
126 #define WB_MAX_SENSORS 19
127
128 struct lm_softc;
129
130 struct lm_sensor {
131 char *desc;
132 enum sensor_type type;
133 u_int8_t bank;
134 u_int8_t reg;
135 void (*refresh)(struct lm_softc *, int);
136 int rfact;
137 };
138
139 struct lm_softc {
140 struct device sc_dev;
141
142 struct ksensor sensors[WB_MAX_SENSORS];
143 struct ksensordev sensordev;
144 struct sensor_task *sensortask;
145 struct lm_sensor *lm_sensors;
146 u_int numsensors;
147 void (*refresh_sensor_data) (struct lm_softc *);
148
149 u_int8_t (*lm_readreg)(struct lm_softc *, int);
150 void (*lm_writereg)(struct lm_softc *, int, int);
151
152 u_int8_t sbusaddr;
153 u_int8_t chipid;
154 u_int8_t vrm9;
155 };
156
157 void lm_attach(struct lm_softc *);
158 int lm_detach(struct lm_softc *);