Changeset 89c09ae in mainline
- Timestamp:
- 2010-03-16T21:35:37Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7b76744
- Parents:
- 6e81d04
- Location:
- uspace/srv
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/char_mouse/chardev.c
r6e81d04 r89c09ae 48 48 static int dev_phone; 49 49 50 #define NAME " kbd"50 #define NAME "char_mouse" 51 51 52 52 int mouse_port_init(void) -
uspace/srv/hid/char_mouse/proto/ps2.c
r6e81d04 r89c09ae 36 36 37 37 #include <stdio.h> 38 #include <mouse_port.h> 39 #include <char_mouse.h> 38 40 #include <mouse_proto.h> 39 #include <char_mouse.h>40 41 41 42 #define BUFSIZE 3 43 44 #define PS2_MOUSE_OUT_INIT 0xf4 45 #define PS2_MOUSE_ACK 0xfa 42 46 43 47 typedef struct { … … 67 71 int mouse_proto_init(void) 68 72 { 73 mouse_port_write(PS2_MOUSE_OUT_INIT); 69 74 return 0; 70 75 } -
uspace/srv/hw/char/i8042/i8042.c
r6e81d04 r89c09ae 68 68 #define i8042_KBD_TRANSLATE 0x40 69 69 70 /* Mouse constants */71 #define MOUSE_OUT_INIT 0xf472 #define MOUSE_ACK 0xfa73 70 74 71 enum { … … 177 174 async_set_interrupt_received(i8042_irq_handler); 178 175 179 /* Disable kbd, enable mouse */ 176 /* Disable kbd and aux */ 177 wait_ready(); 180 178 pio_write_8(&i8042->status, i8042_CMD_WRITE_CMDB); 181 179 wait_ready(); 182 pio_write_8(&i8042->status, i8042_CMD_WRITE_CMDB); 183 wait_ready(); 184 pio_write_8(&i8042->data, i8042_KBD_DISABLE); 185 wait_ready(); 180 pio_write_8(&i8042->data, i8042_KBD_DISABLE | i8042_AUX_DISABLE); 186 181 187 182 /* Flush all current IO */ 188 183 while (pio_read_8(&i8042->status) & i8042_OUTPUT_FULL) 189 184 (void) pio_read_8(&i8042->data); 190 191 i8042_port_write(DEVID_AUX, MOUSE_OUT_INIT);192 185 193 186 i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status; … … 195 188 ipc_register_irq(sysinfo_value("i8042.inr_a"), device_assign_devno(), 0, &i8042_kbd); 196 189 ipc_register_irq(sysinfo_value("i8042.inr_b"), device_assign_devno(), 0, &i8042_kbd); 197 190 printf("i8042: registered for interrupts %d and %d\n", 191 sysinfo_value("i8042.inr_a"), sysinfo_value("i8042.inr_b")); 192 193 wait_ready(); 198 194 pio_write_8(&i8042->status, i8042_CMD_WRITE_CMDB); 199 195 wait_ready(); 200 196 pio_write_8(&i8042->data, i8042_KBD_IE | i8042_KBD_TRANSLATE | 201 197 i8042_AUX_IE); 202 wait_ready();203 198 204 199 return 0; … … 271 266 { 272 267 if (devid == DEVID_AUX) { 268 wait_ready(); 273 269 pio_write_8(&i8042->status, i8042_CMD_WRITE_AUX); 274 wait_ready();275 }270 } 271 wait_ready(); 276 272 pio_write_8(&i8042->data, data); 277 wait_ready();278 273 } 279 274
Note:
See TracChangeset
for help on using the changeset viewer.