diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pcmcia/m8xx_pcmcia.c | 140 | ||||
-rw-r--r-- | drivers/platform/x86/dell-laptop.c | 10 |
2 files changed, 6 insertions, 144 deletions
diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c index a3a851e49321..18c0d8d1ddf7 100644 --- a/drivers/pcmcia/m8xx_pcmcia.c +++ b/drivers/pcmcia/m8xx_pcmcia.c | |||
@@ -68,12 +68,6 @@ MODULE_LICENSE("Dual MPL/GPL"); | |||
68 | 68 | ||
69 | #if !defined(CONFIG_PCMCIA_SLOT_A) && !defined(CONFIG_PCMCIA_SLOT_B) | 69 | #if !defined(CONFIG_PCMCIA_SLOT_A) && !defined(CONFIG_PCMCIA_SLOT_B) |
70 | 70 | ||
71 | /* The RPX series use SLOT_B */ | ||
72 | #if defined(CONFIG_RPXCLASSIC) || defined(CONFIG_RPXLITE) | ||
73 | #define CONFIG_PCMCIA_SLOT_B | ||
74 | #define CONFIG_BD_IS_MHZ | ||
75 | #endif | ||
76 | |||
77 | /* The ADS board use SLOT_A */ | 71 | /* The ADS board use SLOT_A */ |
78 | #ifdef CONFIG_ADS | 72 | #ifdef CONFIG_ADS |
79 | #define CONFIG_PCMCIA_SLOT_A | 73 | #define CONFIG_PCMCIA_SLOT_A |
@@ -253,81 +247,6 @@ static irqreturn_t m8xx_interrupt(int irq, void *dev); | |||
253 | 247 | ||
254 | #define PCMCIA_BMT_LIMIT (15*4) /* Bus Monitor Timeout value */ | 248 | #define PCMCIA_BMT_LIMIT (15*4) /* Bus Monitor Timeout value */ |
255 | 249 | ||
256 | /* ------------------------------------------------------------------------- */ | ||
257 | /* board specific stuff: */ | ||
258 | /* voltage_set(), hardware_enable() and hardware_disable() */ | ||
259 | /* ------------------------------------------------------------------------- */ | ||
260 | /* RPX Boards from Embedded Planet */ | ||
261 | |||
262 | #if defined(CONFIG_RPXCLASSIC) || defined(CONFIG_RPXLITE) | ||
263 | |||
264 | /* The RPX boards seems to have it's bus monitor timeout set to 6*8 clocks. | ||
265 | * SYPCR is write once only, therefore must the slowest memory be faster | ||
266 | * than the bus monitor or we will get a machine check due to the bus timeout. | ||
267 | */ | ||
268 | |||
269 | #define PCMCIA_BOARD_MSG "RPX CLASSIC or RPX LITE" | ||
270 | |||
271 | #undef PCMCIA_BMT_LIMIT | ||
272 | #define PCMCIA_BMT_LIMIT (6*8) | ||
273 | |||
274 | static int voltage_set(int slot, int vcc, int vpp) | ||
275 | { | ||
276 | u32 reg = 0; | ||
277 | |||
278 | switch (vcc) { | ||
279 | case 0: | ||
280 | break; | ||
281 | case 33: | ||
282 | reg |= BCSR1_PCVCTL4; | ||
283 | break; | ||
284 | case 50: | ||
285 | reg |= BCSR1_PCVCTL5; | ||
286 | break; | ||
287 | default: | ||
288 | return 1; | ||
289 | } | ||
290 | |||
291 | switch (vpp) { | ||
292 | case 0: | ||
293 | break; | ||
294 | case 33: | ||
295 | case 50: | ||
296 | if (vcc == vpp) | ||
297 | reg |= BCSR1_PCVCTL6; | ||
298 | else | ||
299 | return 1; | ||
300 | break; | ||
301 | case 120: | ||
302 | reg |= BCSR1_PCVCTL7; | ||
303 | default: | ||
304 | return 1; | ||
305 | } | ||
306 | |||
307 | if (!((vcc == 50) || (vcc == 0))) | ||
308 | return 1; | ||
309 | |||
310 | /* first, turn off all power */ | ||
311 | |||
312 | out_be32(((u32 *) RPX_CSR_ADDR), | ||
313 | in_be32(((u32 *) RPX_CSR_ADDR)) & ~(BCSR1_PCVCTL4 | | ||
314 | BCSR1_PCVCTL5 | | ||
315 | BCSR1_PCVCTL6 | | ||
316 | BCSR1_PCVCTL7)); | ||
317 | |||
318 | /* enable new powersettings */ | ||
319 | |||
320 | out_be32(((u32 *) RPX_CSR_ADDR), in_be32(((u32 *) RPX_CSR_ADDR)) | reg); | ||
321 | |||
322 | return 0; | ||
323 | } | ||
324 | |||
325 | #define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V | ||
326 | #define hardware_enable(_slot_) /* No hardware to enable */ | ||
327 | #define hardware_disable(_slot_) /* No hardware to disable */ | ||
328 | |||
329 | #endif /* CONFIG_RPXCLASSIC */ | ||
330 | |||
331 | /* FADS Boards from Motorola */ | 250 | /* FADS Boards from Motorola */ |
332 | 251 | ||
333 | #if defined(CONFIG_FADS) | 252 | #if defined(CONFIG_FADS) |
@@ -419,65 +338,6 @@ static inline int voltage_set(int slot, int vcc, int vpp) | |||
419 | 338 | ||
420 | #endif | 339 | #endif |
421 | 340 | ||
422 | /* ------------------------------------------------------------------------- */ | ||
423 | /* Motorola MBX860 */ | ||
424 | |||
425 | #if defined(CONFIG_MBX) | ||
426 | |||
427 | #define PCMCIA_BOARD_MSG "MBX" | ||
428 | |||
429 | static int voltage_set(int slot, int vcc, int vpp) | ||
430 | { | ||
431 | u8 reg = 0; | ||
432 | |||
433 | switch (vcc) { | ||
434 | case 0: | ||
435 | break; | ||
436 | case 33: | ||
437 | reg |= CSR2_VCC_33; | ||
438 | break; | ||
439 | case 50: | ||
440 | reg |= CSR2_VCC_50; | ||
441 | break; | ||
442 | default: | ||
443 | return 1; | ||
444 | } | ||
445 | |||
446 | switch (vpp) { | ||
447 | case 0: | ||
448 | break; | ||
449 | case 33: | ||
450 | case 50: | ||
451 | if (vcc == vpp) | ||
452 | reg |= CSR2_VPP_VCC; | ||
453 | else | ||
454 | return 1; | ||
455 | break; | ||
456 | case 120: | ||
457 | if ((vcc == 33) || (vcc == 50)) | ||
458 | reg |= CSR2_VPP_12; | ||
459 | else | ||
460 | return 1; | ||
461 | default: | ||
462 | return 1; | ||
463 | } | ||
464 | |||
465 | /* first, turn off all power */ | ||
466 | out_8((u8 *) MBX_CSR2_ADDR, | ||
467 | in_8((u8 *) MBX_CSR2_ADDR) & ~(CSR2_VCC_MASK | CSR2_VPP_MASK)); | ||
468 | |||
469 | /* enable new powersettings */ | ||
470 | out_8((u8 *) MBX_CSR2_ADDR, in_8((u8 *) MBX_CSR2_ADDR) | reg); | ||
471 | |||
472 | return 0; | ||
473 | } | ||
474 | |||
475 | #define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V | ||
476 | #define hardware_enable(_slot_) /* No hardware to enable */ | ||
477 | #define hardware_disable(_slot_) /* No hardware to disable */ | ||
478 | |||
479 | #endif /* CONFIG_MBX */ | ||
480 | |||
481 | #if defined(CONFIG_PRxK) | 341 | #if defined(CONFIG_PRxK) |
482 | #include <asm/cpld.h> | 342 | #include <asm/cpld.h> |
483 | extern volatile fpga_pc_regs *fpga_pc; | 343 | extern volatile fpga_pc_regs *fpga_pc; |
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index fa3ee6209572..1134119521ac 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c | |||
@@ -284,6 +284,7 @@ static void __init parse_da_table(const struct dmi_header *dm) | |||
284 | { | 284 | { |
285 | /* Final token is a terminator, so we don't want to copy it */ | 285 | /* Final token is a terminator, so we don't want to copy it */ |
286 | int tokens = (dm->length-11)/sizeof(struct calling_interface_token)-1; | 286 | int tokens = (dm->length-11)/sizeof(struct calling_interface_token)-1; |
287 | struct calling_interface_token *new_da_tokens; | ||
287 | struct calling_interface_structure *table = | 288 | struct calling_interface_structure *table = |
288 | container_of(dm, struct calling_interface_structure, header); | 289 | container_of(dm, struct calling_interface_structure, header); |
289 | 290 | ||
@@ -296,12 +297,13 @@ static void __init parse_da_table(const struct dmi_header *dm) | |||
296 | da_command_address = table->cmdIOAddress; | 297 | da_command_address = table->cmdIOAddress; |
297 | da_command_code = table->cmdIOCode; | 298 | da_command_code = table->cmdIOCode; |
298 | 299 | ||
299 | da_tokens = krealloc(da_tokens, (da_num_tokens + tokens) * | 300 | new_da_tokens = krealloc(da_tokens, (da_num_tokens + tokens) * |
300 | sizeof(struct calling_interface_token), | 301 | sizeof(struct calling_interface_token), |
301 | GFP_KERNEL); | 302 | GFP_KERNEL); |
302 | 303 | ||
303 | if (!da_tokens) | 304 | if (!new_da_tokens) |
304 | return; | 305 | return; |
306 | da_tokens = new_da_tokens; | ||
305 | 307 | ||
306 | memcpy(da_tokens+da_num_tokens, table->tokens, | 308 | memcpy(da_tokens+da_num_tokens, table->tokens, |
307 | sizeof(struct calling_interface_token) * tokens); | 309 | sizeof(struct calling_interface_token) * tokens); |