Changeset 6a44ee4 in mainline for uspace/srv/hid/input/port/ns16550.c


Ignore:
Timestamp:
2011-07-20T15:26:21Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
efcebe1
Parents:
25bef0ff (diff), a701812 (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 moved

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/input/port/ns16550.c

    r25bef0ff r6a44ee4  
    11/*
    22 * Copyright (c) 2006 Josef Cejka
     3 * Copyright (c) 2011 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    3738#include <ipc/irc.h>
    3839#include <async.h>
     40#include <async_obsolete.h>
    3941#include <sysinfo.h>
     42#include <input.h>
    4043#include <kbd.h>
    4144#include <kbd_port.h>
    42 #include <sun.h>
    4345#include <ddi.h>
    4446#include <errno.h>
     47
     48static int ns16550_port_init(kbd_dev_t *);
     49static void ns16550_port_yield(void);
     50static void ns16550_port_reclaim(void);
     51static void ns16550_port_write(uint8_t data);
     52
     53kbd_port_ops_t ns16550_port = {
     54        .init = ns16550_port_init,
     55        .yield = ns16550_port_yield,
     56        .reclaim = ns16550_port_reclaim,
     57        .write = ns16550_port_write
     58};
     59
     60static kbd_dev_t *kbd_dev;
    4561
    4662/* NS16550 registers */
     
    90106
    91107static uintptr_t ns16550_physical;
    92 static uintptr_t ns16550_kernel; 
     108static uintptr_t ns16550_kernel;
    93109
    94 int ns16550_port_init(void)
     110static kbd_dev_t *kbd_dev;
     111
     112static int ns16550_port_init(kbd_dev_t *kdev)
    95113{
    96114        void *vaddr;
    97 
     115       
     116        kbd_dev = kdev;
     117       
     118        sysarg_t ns16550;
     119        if (sysinfo_get_value("kbd.type.ns16550", &ns16550) != EOK)
     120                return -1;
     121        if (!ns16550)
     122                return -1;
     123       
    98124        if (sysinfo_get_value("kbd.address.physical", &ns16550_physical) != EOK)
    99125                return -1;
     
    115141}
    116142
     143static void ns16550_port_yield(void)
     144{
     145}
     146
     147static void ns16550_port_reclaim(void)
     148{
     149}
     150
     151static void ns16550_port_write(uint8_t data)
     152{
     153        (void) data;
     154}
     155
    117156static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call)
    118157{
    119         int scan_code = IPC_GET_ARG2(*call);
    120         kbd_push_scancode(scan_code);
     158        kbd_push_data(kbd_dev, IPC_GET_ARG2(*call));
    121159       
    122160        if (irc_service)
    123                 async_msg_1(irc_phone, IRC_CLEAR_INTERRUPT,
     161                async_obsolete_msg_1(irc_phone, IRC_CLEAR_INTERRUPT,
    124162                    IPC_GET_IMETHOD(*call));
    125163}
Note: See TracChangeset for help on using the changeset viewer.