Changeset e2b73d4f in mainline for uspace/srv/hw/char/i8042/i8042.c


Ignore:
Timestamp:
2010-03-21T09:25:29Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
19f857a
Parents:
facebd56 (diff), 4e9aaf5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/char/i8042/i8042.c

    rfacebd56 re2b73d4f  
    6868#define i8042_KBD_TRANSLATE     0x40
    6969
    70 /* Mouse constants */
    71 #define MOUSE_OUT_INIT  0xf4
    72 #define MOUSE_ACK       0xfa
    7370
    7471enum {
     
    177174        async_set_interrupt_received(i8042_irq_handler);
    178175
    179         /* Disable kbd, enable mouse */
     176        /* Disable kbd and aux */
     177        wait_ready();
    180178        pio_write_8(&i8042->status, i8042_CMD_WRITE_CMDB);
    181179        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);
    186181
    187182        /* Flush all current IO */
    188183        while (pio_read_8(&i8042->status) & i8042_OUTPUT_FULL)
    189184                (void) pio_read_8(&i8042->data);
    190 
    191         i8042_port_write(DEVID_AUX, MOUSE_OUT_INIT);
    192185
    193186        i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status;
     
    195188        ipc_register_irq(sysinfo_value("i8042.inr_a"), device_assign_devno(), 0, &i8042_kbd);
    196189        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();
    198194        pio_write_8(&i8042->status, i8042_CMD_WRITE_CMDB);
    199195        wait_ready();
    200196        pio_write_8(&i8042->data, i8042_KBD_IE | i8042_KBD_TRANSLATE |
    201197            i8042_AUX_IE);
    202         wait_ready();
    203198
    204199        return 0;
     
    271266{
    272267        if (devid == DEVID_AUX) {
     268                wait_ready();
    273269                pio_write_8(&i8042->status, i8042_CMD_WRITE_AUX);
    274                 wait_ready();
    275         }
     270        }
     271        wait_ready();
    276272        pio_write_8(&i8042->data, data);
    277         wait_ready();
    278273}
    279274
Note: See TracChangeset for help on using the changeset viewer.