]> git.pld-linux.org Git - packages/kernel.git/blob - linux-2.4.3-latitudec600.patch
- obsolete
[packages/kernel.git] / linux-2.4.3-latitudec600.patch
1 diff -ur Linux/arch/i386/kernel/dmi_scan.c linux/arch/i386/kernel/dmi_scan.c
2 --- Linux/arch/i386/kernel/dmi_scan.c   Wed May 16 16:01:13 2001
3 +++ linux/arch/i386/kernel/dmi_scan.c   Wed May 16 16:43:24 2001
4 @@ -6,6 +6,9 @@
5  #include <linux/apm_bios.h>
6  #include <linux/slab.h>
7  #include <asm/io.h>
8 +#include <linux/pm.h>
9 +#include <linux/keyboard.h>
10 +#include <asm/keyboard.h>
11  
12  struct dmi_header
13  {
14 @@ -219,6 +222,35 @@
15  
16  
17  /*
18 + * Some Bioses enable the PS/2 mouse (touchpad) at resume, even if it was disabled before 
19 + * the suspend. Linux gets terribly confused by that.
20 + */
21 +
22 +typedef void (pm_kbd_func) (void);
23 +extern pm_kbd_func *pm_kbd_request_override;
24 +
25 +static int pm_kbd_request(struct pm_dev *dev, pm_request_t req, void *data)
26 +{
27 +       if (req == PM_RESUME) {
28 +               pckbd_pm_resume();
29 +       }
30 +       return 0;
31 +}
32 +
33 +
34 +static __init int broken_ps2_resume(struct dmi_blacklist *d)
35 +{
36 +       if (pm_kbd_request_override == NULL)
37 +       {
38 +               pm_kbd_request_override = pckbd_pm_resume;
39 +               printk(KERN_INFO "%s machine detected. Mousepad Resume Bug workaround enabled.\n", d->ident);
40 +       }
41 +}
42 +
43 +
44 +
45 +
46 +/*
47   *  Check for clue free BIOS implementations who use
48   *  the following QA technique
49   *
50 @@ -258,6 +290,10 @@
51                         NO_MATCH, NO_MATCH, NO_MATCH
52                         } },
53  #endif                 
54 +       { broken_ps2_resume, "Dell Latitude C600", {    /* Handle problems with APM on Inspiron 5000e */
55 +                       MATCH(DMI_SYS_VENDOR, "Dell"),
56 +                       MATCH(DMI_PRODUCT_NAME, "Latitude C600"), NO_MATCH, NO_MATCH
57 +                       } },
58         { broken_apm_power, "Dell Inspiron 5000e", {    /* Handle problems with APM on Inspiron 5000e */
59                         MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"),
60                         MATCH(DMI_BIOS_VERSION, "A04"),
61 diff -ur Linux/drivers/char/keyboard.c linux/drivers/char/keyboard.c
62 --- Linux/drivers/char/keyboard.c       Wed May 16 16:00:37 2001
63 +++ linux/drivers/char/keyboard.c       Wed May 16 16:25:44 2001
64 @@ -911,6 +911,10 @@
65  EXPORT_SYMBOL(keyboard_tasklet);
66  DECLARE_TASKLET_DISABLED(keyboard_tasklet, kbd_bh, 0);
67  
68 +typedef void (pm_kbd_func) (void);
69 +
70 +pm_kbd_func *pm_kbd_request_override = NULL;
71 +
72  int __init kbd_init(void)
73  {
74         int i;
75 @@ -934,7 +938,7 @@
76         tasklet_enable(&keyboard_tasklet);
77         tasklet_schedule(&keyboard_tasklet);
78         
79 -       pm_kbd = pm_register(PM_SYS_DEV, PM_SYS_KBC, NULL);
80 +       pm_kbd = pm_register(PM_SYS_DEV, PM_SYS_KBC, pm_kbd_request_override);
81  
82         return 0;
83  }
84 diff -ur Linux/drivers/char/pc_keyb.c linux/drivers/char/pc_keyb.c
85 --- Linux/drivers/char/pc_keyb.c        Wed May 16 16:01:14 2001
86 +++ linux/drivers/char/pc_keyb.c        Wed May 16 16:26:27 2001
87 @@ -393,6 +393,30 @@
88             return 0200;
89  }
90  
91 +void pckbd_pm_resume(void)
92 +{
93 +       unsigned int flags;
94 +
95 +       if (queue) {                    /* Aux port detected */
96 +               if (aux_count == 0) {   /* Mouse not in use */ 
97 +                       spin_lock_irqsave(&kbd_controller_lock, flags);
98 +                       /*
99 +                        * Dell Lat. C600 A06 enables mouse after resume.
100 +                        * When user touches the pad, it posts IRQ 12
101 +                        * (which we do not process), thus holding keyboard.
102 +                        */
103 +                       kbd_write_command(KBD_CCMD_MOUSE_DISABLE);
104 +                       /* kbd_write_cmd(AUX_INTS_OFF); */ /* Config & lock */
105 +                       kb_wait();
106 +                       kbd_write_command(KBD_CCMD_WRITE_MODE);
107 +                       kb_wait();
108 +                       kbd_write_output(AUX_INTS_OFF);
109 +                       spin_unlock_irqrestore(&kbd_controller_lock, flags);
110 +               }
111 +       }
112 +}
113 +
114 +
115  static inline void handle_mouse_event(unsigned char scancode)
116  {
117  #ifdef CONFIG_PSMOUSE
This page took 0.031665 seconds and 3 git commands to generate.