Changeset d900699 in mainline for uspace/srv/hid/input/port/z8530.c


Ignore:
Timestamp:
2011-06-17T16:48:53Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f3a605be
Parents:
df8110d3 (diff), 98caf49 (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/z8530.c

    rdf8110d3 rd900699  
    11/*
    22 * Copyright (c) 2006 Martin Decky
     3 * Copyright (c) 2011 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    3940#include <async_obsolete.h>
    4041#include <sysinfo.h>
     42#include <input.h>
    4143#include <kbd.h>
    4244#include <kbd_port.h>
    43 #include <sun.h>
    4445#include <sys/types.h>
    4546#include <ddi.h>
    4647#include <errno.h>
     48
     49static int z8530_port_init(kbd_dev_t *);
     50static void z8530_port_yield(void);
     51static void z8530_port_reclaim(void);
     52static void z8530_port_write(uint8_t data);
     53
     54kbd_port_ops_t z8530_port = {
     55        .init = z8530_port_init,
     56        .yield = z8530_port_yield,
     57        .reclaim = z8530_port_reclaim,
     58        .write = z8530_port_write
     59};
     60
     61static kbd_dev_t *kbd_dev;
    4762
    4863#define CHAN_A_STATUS  4
     
    7792        }
    7893};
    79        
    80 irq_code_t z8530_kbd = {
     94
     95static irq_code_t z8530_kbd = {
    8196        sizeof(z8530_cmds) / sizeof(irq_cmd_t),
    8297        z8530_cmds
     
    85100static void z8530_irq_handler(ipc_callid_t iid, ipc_call_t *call);
    86101
    87 int z8530_port_init(void)
     102static int z8530_port_init(kbd_dev_t *kdev)
    88103{
     104        kbd_dev = kdev;
     105       
     106        sysarg_t z8530;
     107        if (sysinfo_get_value("kbd.type.z8530", &z8530) != EOK)
     108                return -1;
     109        if (!z8530)
     110                return -1;
     111       
    89112        sysarg_t kaddr;
    90113        if (sysinfo_get_value("kbd.address.kernel", &kaddr) != EOK)
     
    104127}
    105128
     129static void z8530_port_yield(void)
     130{
     131}
     132
     133static void z8530_port_reclaim(void)
     134{
     135}
     136
     137static void z8530_port_write(uint8_t data)
     138{
     139        (void) data;
     140}
     141
    106142static void z8530_irq_handler(ipc_callid_t iid, ipc_call_t *call)
    107143{
    108144        int scan_code = IPC_GET_ARG2(*call);
    109         kbd_push_scancode(scan_code);
     145        kbd_push_scancode(kbd_dev, scan_code);
    110146       
    111147        if (irc_service)
Note: See TracChangeset for help on using the changeset viewer.