ia64/xen-unstable
changeset 7452:27c8bc033f16
disable bogus touchpad device model, which cause annoying dmesg on 2.6 kernel
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Thu Oct 20 11:52:27 2005 +0100 (2005-10-20) |
parents | 6450e40ad21a |
children | 4ac2051ec21e |
files | tools/ioemu/hw/pckbd.c |
line diff
1.1 --- a/tools/ioemu/hw/pckbd.c Thu Oct 20 11:27:51 2005 +0100 1.2 +++ b/tools/ioemu/hw/pckbd.c Thu Oct 20 11:52:27 2005 +0100 1.3 @@ -29,6 +29,9 @@ 1.4 /* debug PC keyboard : only mouse */ 1.5 //#define DEBUG_MOUSE 1.6 1.7 +/* enable synapatic touchpad device model */ 1.8 +//#define SYNAPTIC 1.9 + 1.10 /* Keyboard Controller Commands */ 1.11 #define KBD_CCMD_READ_MODE 0x20 /* Read mode bits */ 1.12 #define KBD_CCMD_WRITE_MODE 0x60 /* Write mode bits */ 1.13 @@ -117,10 +120,12 @@ typedef struct { 1.14 int rptr, wptr, count; 1.15 } KBDQueue; 1.16 1.17 +#ifdef SYNAPTIC 1.18 typedef struct { 1.19 int absolute; 1.20 int high; 1.21 } TouchPad; 1.22 +#endif 1.23 1.24 typedef struct KBDState { 1.25 KBDQueue queue; 1.26 @@ -142,7 +147,9 @@ typedef struct KBDState { 1.27 int mouse_dy; 1.28 int mouse_dz; 1.29 uint8_t mouse_buttons; 1.30 +#ifdef SYNAPTIC 1.31 TouchPad touchpad; 1.32 +#endif 1.33 } KBDState; 1.34 1.35 KBDState kbd_state; 1.36 @@ -399,6 +406,7 @@ static void kbd_mouse_send_packet(KBDSta 1.37 dx1 = s->mouse_dx; 1.38 dy1 = s->mouse_dy; 1.39 dz1 = s->mouse_dz; 1.40 +#ifdef SYNAPTIC 1.41 if (s->touchpad.absolute) 1.42 { 1.43 int dz2, dleftnright, dg, df; 1.44 @@ -444,6 +452,7 @@ static void kbd_mouse_send_packet(KBDSta 1.45 kbd_queue(s, dy1 & 0xFF, 1); 1.46 return; 1.47 } 1.48 +#endif 1.49 /* XXX: increase range to 8 bits ? */ 1.50 if (dx1 > 127) 1.51 dx1 = 127; 1.52 @@ -516,9 +525,11 @@ static void pc_kbd_mouse_event(void *opa 1.53 1.54 static void kbd_write_mouse(KBDState *s, int val) 1.55 { 1.56 +#ifdef SYNAPTIC 1.57 /* variables needed to store synaptics command info */ 1.58 static int rr = 0, ss = 0, tt = 0, uu = 0, res_count = 0, last_com = 0; 1.59 int spare; 1.60 +#endif 1.61 #ifdef DEBUG_MOUSE 1.62 printf("kbd: write mouse 0x%02x\n", val); 1.63 #endif 1.64 @@ -536,7 +547,9 @@ int spare; 1.65 return; 1.66 } 1.67 } 1.68 +#ifdef SYNAPTIC 1.69 last_com = val; 1.70 +#endif 1.71 switch(val) { 1.72 case AUX_SET_SCALE11: 1.73 s->mouse_status &= ~MOUSE_STATUS_SCALE21; 1.74 @@ -568,6 +581,7 @@ int spare; 1.75 kbd_queue(s, AUX_ACK, 1); 1.76 break; 1.77 case AUX_GET_SCALE: 1.78 +#ifdef SYNAPTIC 1.79 if (res_count == 4) 1.80 { 1.81 /* time for the special stuff */ 1.82 @@ -681,6 +695,7 @@ int spare; 1.83 } 1.84 } 1.85 else 1.86 +#endif 1.87 { 1.88 /* not a special command, just do the regular stuff */ 1.89 kbd_queue(s, AUX_ACK, 1); 1.90 @@ -705,14 +720,18 @@ int spare; 1.91 s->mouse_sample_rate = 100; 1.92 s->mouse_resolution = 2; 1.93 s->mouse_status = 0; 1.94 +#ifdef SYNAPTIC 1.95 s->touchpad.absolute = 0; 1.96 +#endif 1.97 kbd_queue(s, AUX_ACK, 1); 1.98 break; 1.99 case AUX_RESET: 1.100 s->mouse_sample_rate = 100; 1.101 s->mouse_resolution = 2; 1.102 s->mouse_status = 0; 1.103 +#ifdef SYNAPTIC 1.104 s->touchpad.absolute = 0; 1.105 +#endif 1.106 kbd_queue(s, AUX_ACK, 1); 1.107 kbd_queue(s, 0xaa, 1); 1.108 kbd_queue(s, s->mouse_type, 1); 1.109 @@ -722,6 +741,7 @@ int spare; 1.110 } 1.111 break; 1.112 case AUX_SET_SAMPLE: 1.113 +#ifdef SYNAPTIC 1.114 if (res_count == 4 && val == 0x14) 1.115 { 1.116 /* time for the special stuff */ 1.117 @@ -729,6 +749,7 @@ int spare; 1.118 val = (rr*64) + (ss*16) + (tt*4) + uu; 1.119 /* TODO: set the mode byte */ 1.120 } else 1.121 +#endif 1.122 s->mouse_sample_rate = val; 1.123 #if 0 1.124 /* detect IMPS/2 or IMEX */ 1.125 @@ -762,6 +783,7 @@ int spare; 1.126 s->mouse_write_cmd = -1; 1.127 break; 1.128 case AUX_SET_RES: 1.129 +#ifdef SYNAPTIC 1.130 if (last_com != AUX_SET_RES) 1.131 { 1.132 /* if its not 4 in a row, its not a command */ 1.133 @@ -790,6 +812,7 @@ int spare; 1.134 uu = val; 1.135 break; 1.136 } 1.137 +#endif 1.138 s->mouse_resolution = val; 1.139 kbd_queue(s, AUX_ACK, 1); 1.140 s->mouse_write_cmd = -1; 1.141 @@ -871,8 +894,10 @@ static void kbd_save(QEMUFile* f, void* 1.142 qemu_put_be32s(f, &s->mouse_dy); 1.143 qemu_put_be32s(f, &s->mouse_dz); 1.144 qemu_put_8s(f, &s->mouse_buttons); 1.145 +#ifdef SYNAPTIC 1.146 qemu_put_be32s(f, &s->touchpad.absolute); 1.147 qemu_put_be32s(f, &s->touchpad.high); 1.148 +#endif 1.149 } 1.150 1.151 static int kbd_load(QEMUFile* f, void* opaque, int version_id) 1.152 @@ -897,8 +922,10 @@ static int kbd_load(QEMUFile* f, void* o 1.153 qemu_get_be32s(f, &s->mouse_dy); 1.154 qemu_get_be32s(f, &s->mouse_dz); 1.155 qemu_get_8s(f, &s->mouse_buttons); 1.156 +#ifdef SYNAPTIC 1.157 qemu_get_be32s(f, &s->touchpad.absolute); 1.158 qemu_get_be32s(f, &s->touchpad.high); 1.159 +#endif 1.160 return 0; 1.161 } 1.162