aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorPeter Feuerer <peter@piie.net>2014-11-28 09:20:48 -0500
committerDarren Hart <dvhart@linux.intel.com>2014-12-04 06:24:55 -0500
commit5ef6578c025af36e23d46bb6d734af891a085377 (patch)
tree08be860cc14f46a273ba95461fff76ba8eb648e9 /drivers/platform
parente4da91427fbe1dd425478d49fdabeb217945f776 (diff)
acerhdf: Adding support for "manual mode"
Some Acer models require an additional command to turn off the fan after bios mode has been enabled. Adding new section in bios table to allow support for those models, by writing an extra "manual mode" register. Cc: platform-driver-x86@vger.kernel.org Cc: Darren Hart <dvhart@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andreas Mohr <andi@lisas.de> Acked-by: Borislav Petkov <bp@suse.de> Signed-off-by: Peter Feuerer <peter@piie.net> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/acerhdf.c186
1 files changed, 102 insertions, 84 deletions
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index f94467c05225..2c58f106bc6d 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -50,7 +50,7 @@
50 */ 50 */
51#undef START_IN_KERNEL_MODE 51#undef START_IN_KERNEL_MODE
52 52
53#define DRV_VER "0.5.26" 53#define DRV_VER "0.5.29"
54 54
55/* 55/*
56 * According to the Atom N270 datasheet, 56 * According to the Atom N270 datasheet,
@@ -119,6 +119,17 @@ struct fancmd {
119 u8 cmd_auto; 119 u8 cmd_auto;
120}; 120};
121 121
122struct manualcmd {
123 u8 mreg;
124 u8 moff;
125};
126
127/* default register and command to disable fan in manual mode */
128static const struct manualcmd mcmd = {
129 .mreg = 0x94,
130 .moff = 0xff,
131};
132
122/* BIOS settings */ 133/* BIOS settings */
123struct bios_settings_t { 134struct bios_settings_t {
124 const char *vendor; 135 const char *vendor;
@@ -127,105 +138,106 @@ struct bios_settings_t {
127 unsigned char fanreg; 138 unsigned char fanreg;
128 unsigned char tempreg; 139 unsigned char tempreg;
129 struct fancmd cmd; 140 struct fancmd cmd;
141 int mcmd_enable;
130}; 142};
131 143
132/* Register addresses and values for different BIOS versions */ 144/* Register addresses and values for different BIOS versions */
133static const struct bios_settings_t bios_tbl[] = { 145static const struct bios_settings_t bios_tbl[] = {
134 /* AOA110 */ 146 /* AOA110 */
135 {"Acer", "AOA110", "v0.3109", 0x55, 0x58, {0x1f, 0x00} }, 147 {"Acer", "AOA110", "v0.3109", 0x55, 0x58, {0x1f, 0x00}, 0},
136 {"Acer", "AOA110", "v0.3114", 0x55, 0x58, {0x1f, 0x00} }, 148 {"Acer", "AOA110", "v0.3114", 0x55, 0x58, {0x1f, 0x00}, 0},
137 {"Acer", "AOA110", "v0.3301", 0x55, 0x58, {0xaf, 0x00} }, 149 {"Acer", "AOA110", "v0.3301", 0x55, 0x58, {0xaf, 0x00}, 0},
138 {"Acer", "AOA110", "v0.3304", 0x55, 0x58, {0xaf, 0x00} }, 150 {"Acer", "AOA110", "v0.3304", 0x55, 0x58, {0xaf, 0x00}, 0},
139 {"Acer", "AOA110", "v0.3305", 0x55, 0x58, {0xaf, 0x00} }, 151 {"Acer", "AOA110", "v0.3305", 0x55, 0x58, {0xaf, 0x00}, 0},
140 {"Acer", "AOA110", "v0.3307", 0x55, 0x58, {0xaf, 0x00} }, 152 {"Acer", "AOA110", "v0.3307", 0x55, 0x58, {0xaf, 0x00}, 0},
141 {"Acer", "AOA110", "v0.3308", 0x55, 0x58, {0x21, 0x00} }, 153 {"Acer", "AOA110", "v0.3308", 0x55, 0x58, {0x21, 0x00}, 0},
142 {"Acer", "AOA110", "v0.3309", 0x55, 0x58, {0x21, 0x00} }, 154 {"Acer", "AOA110", "v0.3309", 0x55, 0x58, {0x21, 0x00}, 0},
143 {"Acer", "AOA110", "v0.3310", 0x55, 0x58, {0x21, 0x00} }, 155 {"Acer", "AOA110", "v0.3310", 0x55, 0x58, {0x21, 0x00}, 0},
144 /* AOA150 */ 156 /* AOA150 */
145 {"Acer", "AOA150", "v0.3114", 0x55, 0x58, {0x1f, 0x00} }, 157 {"Acer", "AOA150", "v0.3114", 0x55, 0x58, {0x1f, 0x00}, 0},
146 {"Acer", "AOA150", "v0.3301", 0x55, 0x58, {0x20, 0x00} }, 158 {"Acer", "AOA150", "v0.3301", 0x55, 0x58, {0x20, 0x00}, 0},
147 {"Acer", "AOA150", "v0.3304", 0x55, 0x58, {0x20, 0x00} }, 159 {"Acer", "AOA150", "v0.3304", 0x55, 0x58, {0x20, 0x00}, 0},
148 {"Acer", "AOA150", "v0.3305", 0x55, 0x58, {0x20, 0x00} }, 160 {"Acer", "AOA150", "v0.3305", 0x55, 0x58, {0x20, 0x00}, 0},
149 {"Acer", "AOA150", "v0.3307", 0x55, 0x58, {0x20, 0x00} }, 161 {"Acer", "AOA150", "v0.3307", 0x55, 0x58, {0x20, 0x00}, 0},
150 {"Acer", "AOA150", "v0.3308", 0x55, 0x58, {0x20, 0x00} }, 162 {"Acer", "AOA150", "v0.3308", 0x55, 0x58, {0x20, 0x00}, 0},
151 {"Acer", "AOA150", "v0.3309", 0x55, 0x58, {0x20, 0x00} }, 163 {"Acer", "AOA150", "v0.3309", 0x55, 0x58, {0x20, 0x00}, 0},
152 {"Acer", "AOA150", "v0.3310", 0x55, 0x58, {0x20, 0x00} }, 164 {"Acer", "AOA150", "v0.3310", 0x55, 0x58, {0x20, 0x00}, 0},
153 /* LT1005u */ 165 /* LT1005u */
154 {"Acer", "LT-10Q", "v0.3310", 0x55, 0x58, {0x20, 0x00} }, 166 {"Acer", "LT-10Q", "v0.3310", 0x55, 0x58, {0x20, 0x00}, 0},
155 /* Acer 1410 */ 167 /* Acer 1410 */
156 {"Acer", "Aspire 1410", "v0.3108", 0x55, 0x58, {0x9e, 0x00} }, 168 {"Acer", "Aspire 1410", "v0.3108", 0x55, 0x58, {0x9e, 0x00}, 0},
157 {"Acer", "Aspire 1410", "v0.3113", 0x55, 0x58, {0x9e, 0x00} }, 169 {"Acer", "Aspire 1410", "v0.3113", 0x55, 0x58, {0x9e, 0x00}, 0},
158 {"Acer", "Aspire 1410", "v0.3115", 0x55, 0x58, {0x9e, 0x00} }, 170 {"Acer", "Aspire 1410", "v0.3115", 0x55, 0x58, {0x9e, 0x00}, 0},
159 {"Acer", "Aspire 1410", "v0.3117", 0x55, 0x58, {0x9e, 0x00} }, 171 {"Acer", "Aspire 1410", "v0.3117", 0x55, 0x58, {0x9e, 0x00}, 0},
160 {"Acer", "Aspire 1410", "v0.3119", 0x55, 0x58, {0x9e, 0x00} }, 172 {"Acer", "Aspire 1410", "v0.3119", 0x55, 0x58, {0x9e, 0x00}, 0},
161 {"Acer", "Aspire 1410", "v0.3120", 0x55, 0x58, {0x9e, 0x00} }, 173 {"Acer", "Aspire 1410", "v0.3120", 0x55, 0x58, {0x9e, 0x00}, 0},
162 {"Acer", "Aspire 1410", "v1.3204", 0x55, 0x58, {0x9e, 0x00} }, 174 {"Acer", "Aspire 1410", "v1.3204", 0x55, 0x58, {0x9e, 0x00}, 0},
163 {"Acer", "Aspire 1410", "v1.3303", 0x55, 0x58, {0x9e, 0x00} }, 175 {"Acer", "Aspire 1410", "v1.3303", 0x55, 0x58, {0x9e, 0x00}, 0},
164 {"Acer", "Aspire 1410", "v1.3308", 0x55, 0x58, {0x9e, 0x00} }, 176 {"Acer", "Aspire 1410", "v1.3308", 0x55, 0x58, {0x9e, 0x00}, 0},
165 {"Acer", "Aspire 1410", "v1.3310", 0x55, 0x58, {0x9e, 0x00} }, 177 {"Acer", "Aspire 1410", "v1.3310", 0x55, 0x58, {0x9e, 0x00}, 0},
166 {"Acer", "Aspire 1410", "v1.3314", 0x55, 0x58, {0x9e, 0x00} }, 178 {"Acer", "Aspire 1410", "v1.3314", 0x55, 0x58, {0x9e, 0x00}, 0},
167 /* Acer 1810xx */ 179 /* Acer 1810xx */
168 {"Acer", "Aspire 1810TZ", "v0.3108", 0x55, 0x58, {0x9e, 0x00} }, 180 {"Acer", "Aspire 1810TZ", "v0.3108", 0x55, 0x58, {0x9e, 0x00}, 0},
169 {"Acer", "Aspire 1810T", "v0.3108", 0x55, 0x58, {0x9e, 0x00} }, 181 {"Acer", "Aspire 1810T", "v0.3108", 0x55, 0x58, {0x9e, 0x00}, 0},
170 {"Acer", "Aspire 1810TZ", "v0.3113", 0x55, 0x58, {0x9e, 0x00} }, 182 {"Acer", "Aspire 1810TZ", "v0.3113", 0x55, 0x58, {0x9e, 0x00}, 0},
171 {"Acer", "Aspire 1810T", "v0.3113", 0x55, 0x58, {0x9e, 0x00} }, 183 {"Acer", "Aspire 1810T", "v0.3113", 0x55, 0x58, {0x9e, 0x00}, 0},
172 {"Acer", "Aspire 1810TZ", "v0.3115", 0x55, 0x58, {0x9e, 0x00} }, 184 {"Acer", "Aspire 1810TZ", "v0.3115", 0x55, 0x58, {0x9e, 0x00}, 0},
173 {"Acer", "Aspire 1810T", "v0.3115", 0x55, 0x58, {0x9e, 0x00} }, 185 {"Acer", "Aspire 1810T", "v0.3115", 0x55, 0x58, {0x9e, 0x00}, 0},
174 {"Acer", "Aspire 1810TZ", "v0.3117", 0x55, 0x58, {0x9e, 0x00} }, 186 {"Acer", "Aspire 1810TZ", "v0.3117", 0x55, 0x58, {0x9e, 0x00}, 0},
175 {"Acer", "Aspire 1810T", "v0.3117", 0x55, 0x58, {0x9e, 0x00} }, 187 {"Acer", "Aspire 1810T", "v0.3117", 0x55, 0x58, {0x9e, 0x00}, 0},
176 {"Acer", "Aspire 1810TZ", "v0.3119", 0x55, 0x58, {0x9e, 0x00} }, 188 {"Acer", "Aspire 1810TZ", "v0.3119", 0x55, 0x58, {0x9e, 0x00}, 0},
177 {"Acer", "Aspire 1810T", "v0.3119", 0x55, 0x58, {0x9e, 0x00} }, 189 {"Acer", "Aspire 1810T", "v0.3119", 0x55, 0x58, {0x9e, 0x00}, 0},
178 {"Acer", "Aspire 1810TZ", "v0.3120", 0x55, 0x58, {0x9e, 0x00} }, 190 {"Acer", "Aspire 1810TZ", "v0.3120", 0x55, 0x58, {0x9e, 0x00}, 0},
179 {"Acer", "Aspire 1810T", "v0.3120", 0x55, 0x58, {0x9e, 0x00} }, 191 {"Acer", "Aspire 1810T", "v0.3120", 0x55, 0x58, {0x9e, 0x00}, 0},
180 {"Acer", "Aspire 1810TZ", "v1.3204", 0x55, 0x58, {0x9e, 0x00} }, 192 {"Acer", "Aspire 1810TZ", "v1.3204", 0x55, 0x58, {0x9e, 0x00}, 0},
181 {"Acer", "Aspire 1810T", "v1.3204", 0x55, 0x58, {0x9e, 0x00} }, 193 {"Acer", "Aspire 1810T", "v1.3204", 0x55, 0x58, {0x9e, 0x00}, 0},
182 {"Acer", "Aspire 1810TZ", "v1.3303", 0x55, 0x58, {0x9e, 0x00} }, 194 {"Acer", "Aspire 1810TZ", "v1.3303", 0x55, 0x58, {0x9e, 0x00}, 0},
183 {"Acer", "Aspire 1810T", "v1.3303", 0x55, 0x58, {0x9e, 0x00} }, 195 {"Acer", "Aspire 1810T", "v1.3303", 0x55, 0x58, {0x9e, 0x00}, 0},
184 {"Acer", "Aspire 1810TZ", "v1.3308", 0x55, 0x58, {0x9e, 0x00} }, 196 {"Acer", "Aspire 1810TZ", "v1.3308", 0x55, 0x58, {0x9e, 0x00}, 0},
185 {"Acer", "Aspire 1810T", "v1.3308", 0x55, 0x58, {0x9e, 0x00} }, 197 {"Acer", "Aspire 1810T", "v1.3308", 0x55, 0x58, {0x9e, 0x00}, 0},
186 {"Acer", "Aspire 1810TZ", "v1.3310", 0x55, 0x58, {0x9e, 0x00} }, 198 {"Acer", "Aspire 1810TZ", "v1.3310", 0x55, 0x58, {0x9e, 0x00}, 0},
187 {"Acer", "Aspire 1810T", "v1.3310", 0x55, 0x58, {0x9e, 0x00} }, 199 {"Acer", "Aspire 1810T", "v1.3310", 0x55, 0x58, {0x9e, 0x00}, 0},
188 {"Acer", "Aspire 1810TZ", "v1.3314", 0x55, 0x58, {0x9e, 0x00} }, 200 {"Acer", "Aspire 1810TZ", "v1.3314", 0x55, 0x58, {0x9e, 0x00}, 0},
189 {"Acer", "Aspire 1810T", "v1.3314", 0x55, 0x58, {0x9e, 0x00} }, 201 {"Acer", "Aspire 1810T", "v1.3314", 0x55, 0x58, {0x9e, 0x00}, 0},
190 /* Acer 531 */ 202 /* Acer 531 */
191 {"Acer", "AO531h", "v0.3104", 0x55, 0x58, {0x20, 0x00} }, 203 {"Acer", "AO531h", "v0.3104", 0x55, 0x58, {0x20, 0x00}, 0},
192 {"Acer", "AO531h", "v0.3201", 0x55, 0x58, {0x20, 0x00} }, 204 {"Acer", "AO531h", "v0.3201", 0x55, 0x58, {0x20, 0x00}, 0},
193 {"Acer", "AO531h", "v0.3304", 0x55, 0x58, {0x20, 0x00} }, 205 {"Acer", "AO531h", "v0.3304", 0x55, 0x58, {0x20, 0x00}, 0},
194 /* Acer 751 */ 206 /* Acer 751 */
195 {"Acer", "AO751h", "V0.3212", 0x55, 0x58, {0x21, 0x00} }, 207 {"Acer", "AO751h", "V0.3212", 0x55, 0x58, {0x21, 0x00}, 0},
196 /* Acer 1825 */ 208 /* Acer 1825 */
197 {"Acer", "Aspire 1825PTZ", "V1.3118", 0x55, 0x58, {0x9e, 0x00} }, 209 {"Acer", "Aspire 1825PTZ", "V1.3118", 0x55, 0x58, {0x9e, 0x00}, 0},
198 {"Acer", "Aspire 1825PTZ", "V1.3127", 0x55, 0x58, {0x9e, 0x00} }, 210 {"Acer", "Aspire 1825PTZ", "V1.3127", 0x55, 0x58, {0x9e, 0x00}, 0},
199 /* Acer TravelMate 7730 */ 211 /* Acer TravelMate 7730 */
200 {"Acer", "TravelMate 7730G", "v0.3509", 0x55, 0x58, {0xaf, 0x00} }, 212 {"Acer", "TravelMate 7730G", "v0.3509", 0x55, 0x58, {0xaf, 0x00}, 0},
201 /* Gateway */ 213 /* Gateway */
202 {"Gateway", "AOA110", "v0.3103", 0x55, 0x58, {0x21, 0x00} }, 214 {"Gateway", "AOA110", "v0.3103", 0x55, 0x58, {0x21, 0x00}, 0},
203 {"Gateway", "AOA150", "v0.3103", 0x55, 0x58, {0x20, 0x00} }, 215 {"Gateway", "AOA150", "v0.3103", 0x55, 0x58, {0x20, 0x00}, 0},
204 {"Gateway", "LT31", "v1.3103", 0x55, 0x58, {0x9e, 0x00} }, 216 {"Gateway", "LT31", "v1.3103", 0x55, 0x58, {0x9e, 0x00}, 0},
205 {"Gateway", "LT31", "v1.3201", 0x55, 0x58, {0x9e, 0x00} }, 217 {"Gateway", "LT31", "v1.3201", 0x55, 0x58, {0x9e, 0x00}, 0},
206 {"Gateway", "LT31", "v1.3302", 0x55, 0x58, {0x9e, 0x00} }, 218 {"Gateway", "LT31", "v1.3302", 0x55, 0x58, {0x9e, 0x00}, 0},
207 {"Gateway", "LT31", "v1.3303t", 0x55, 0x58, {0x9e, 0x00} }, 219 {"Gateway", "LT31", "v1.3303t", 0x55, 0x58, {0x9e, 0x00}, 0},
208 /* Packard Bell */ 220 /* Packard Bell */
209 {"Packard Bell", "DOA150", "v0.3104", 0x55, 0x58, {0x21, 0x00} }, 221 {"Packard Bell", "DOA150", "v0.3104", 0x55, 0x58, {0x21, 0x00}, 0},
210 {"Packard Bell", "DOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00} }, 222 {"Packard Bell", "DOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00}, 0},
211 {"Packard Bell", "AOA110", "v0.3105", 0x55, 0x58, {0x21, 0x00} }, 223 {"Packard Bell", "AOA110", "v0.3105", 0x55, 0x58, {0x21, 0x00}, 0},
212 {"Packard Bell", "AOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00} }, 224 {"Packard Bell", "AOA150", "v0.3105", 0x55, 0x58, {0x20, 0x00}, 0},
213 {"Packard Bell", "ENBFT", "V1.3118", 0x55, 0x58, {0x9e, 0x00} }, 225 {"Packard Bell", "ENBFT", "V1.3118", 0x55, 0x58, {0x9e, 0x00}, 0},
214 {"Packard Bell", "ENBFT", "V1.3127", 0x55, 0x58, {0x9e, 0x00} }, 226 {"Packard Bell", "ENBFT", "V1.3127", 0x55, 0x58, {0x9e, 0x00}, 0},
215 {"Packard Bell", "DOTMU", "v1.3303", 0x55, 0x58, {0x9e, 0x00} }, 227 {"Packard Bell", "DOTMU", "v1.3303", 0x55, 0x58, {0x9e, 0x00}, 0},
216 {"Packard Bell", "DOTMU", "v0.3120", 0x55, 0x58, {0x9e, 0x00} }, 228 {"Packard Bell", "DOTMU", "v0.3120", 0x55, 0x58, {0x9e, 0x00}, 0},
217 {"Packard Bell", "DOTMU", "v0.3108", 0x55, 0x58, {0x9e, 0x00} }, 229 {"Packard Bell", "DOTMU", "v0.3108", 0x55, 0x58, {0x9e, 0x00}, 0},
218 {"Packard Bell", "DOTMU", "v0.3113", 0x55, 0x58, {0x9e, 0x00} }, 230 {"Packard Bell", "DOTMU", "v0.3113", 0x55, 0x58, {0x9e, 0x00}, 0},
219 {"Packard Bell", "DOTMU", "v0.3115", 0x55, 0x58, {0x9e, 0x00} }, 231 {"Packard Bell", "DOTMU", "v0.3115", 0x55, 0x58, {0x9e, 0x00}, 0},
220 {"Packard Bell", "DOTMU", "v0.3117", 0x55, 0x58, {0x9e, 0x00} }, 232 {"Packard Bell", "DOTMU", "v0.3117", 0x55, 0x58, {0x9e, 0x00}, 0},
221 {"Packard Bell", "DOTMU", "v0.3119", 0x55, 0x58, {0x9e, 0x00} }, 233 {"Packard Bell", "DOTMU", "v0.3119", 0x55, 0x58, {0x9e, 0x00}, 0},
222 {"Packard Bell", "DOTMU", "v1.3204", 0x55, 0x58, {0x9e, 0x00} }, 234 {"Packard Bell", "DOTMU", "v1.3204", 0x55, 0x58, {0x9e, 0x00}, 0},
223 {"Packard Bell", "DOTMA", "v1.3201", 0x55, 0x58, {0x9e, 0x00} }, 235 {"Packard Bell", "DOTMA", "v1.3201", 0x55, 0x58, {0x9e, 0x00}, 0},
224 {"Packard Bell", "DOTMA", "v1.3302", 0x55, 0x58, {0x9e, 0x00} }, 236 {"Packard Bell", "DOTMA", "v1.3302", 0x55, 0x58, {0x9e, 0x00}, 0},
225 {"Packard Bell", "DOTMA", "v1.3303t", 0x55, 0x58, {0x9e, 0x00} }, 237 {"Packard Bell", "DOTMA", "v1.3303t", 0x55, 0x58, {0x9e, 0x00}, 0},
226 {"Packard Bell", "DOTVR46", "v1.3308", 0x55, 0x58, {0x9e, 0x00} }, 238 {"Packard Bell", "DOTVR46", "v1.3308", 0x55, 0x58, {0x9e, 0x00}, 0},
227 /* pewpew-terminator */ 239 /* pewpew-terminator */
228 {"", "", "", 0, 0, {0, 0} } 240 {"", "", "", 0, 0, {0, 0}, 0}
229}; 241};
230 242
231static const struct bios_settings_t *bios_cfg __read_mostly; 243static const struct bios_settings_t *bios_cfg __read_mostly;
@@ -275,6 +287,12 @@ static void acerhdf_change_fanstate(int state)
275 fanstate = state; 287 fanstate = state;
276 288
277 ec_write(bios_cfg->fanreg, cmd); 289 ec_write(bios_cfg->fanreg, cmd);
290
291 if (bios_cfg->mcmd_enable && state == ACERHDF_FAN_OFF) {
292 if (verbose)
293 pr_notice("turning off fan manually\n");
294 ec_write(mcmd.mreg, mcmd.moff);
295 }
278} 296}
279 297
280static void acerhdf_check_param(struct thermal_zone_device *thermal) 298static void acerhdf_check_param(struct thermal_zone_device *thermal)