Changeset f1fae414 in mainline for uspace/srv/hid/input/port/niagara.c


Ignore:
Timestamp:
2011-06-22T01:34: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:
8d7e82c1, cac458f
Parents:
72ec8cc (diff), bf172825 (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/niagara.c

    r72ec8cc rf1fae414  
    11/*
    22 * Copyright (c) 2008 Pavel Rimsky
     3 * Copyright (c) 2011 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    4647#include <errno.h>
    4748
     49static int niagara_port_init(kbd_dev_t *);
     50static void niagara_port_yield(void);
     51static void niagara_port_reclaim(void);
     52static void niagara_port_write(uint8_t data);
     53
     54kbd_port_ops_t niagara_port = {
     55        .init = niagara_port_init,
     56        .yield = niagara_port_yield,
     57        .reclaim = niagara_port_reclaim,
     58        .write = niagara_port_write
     59};
     60
     61static kbd_dev_t *kbd_dev;
     62
    4863#define POLL_INTERVAL  10000
    4964
     
    7085
    7186/* virtual address of the shared buffer */
    72 input_buffer_t input_buffer;
     87static input_buffer_t input_buffer;
    7388
    7489static volatile bool polling_disabled = false;
     
    7994 * Maps the shared buffer and creates the polling thread.
    8095 */
    81 int kbd_port_init(void)
     96static int niagara_port_init(kbd_dev_t *kdev)
    8297{
     98        kbd_dev = kdev;
     99       
    83100        sysarg_t paddr;
    84101        if (sysinfo_get_value("niagara.inbuf.address", &paddr) != EOK)
     
    105122}
    106123
    107 void kbd_port_yield(void)
     124static void niagara_port_yield(void)
    108125{
    109126        polling_disabled = true;
    110127}
    111128
    112 void kbd_port_reclaim(void)
     129static void niagara_port_reclaim(void)
    113130{
    114131        polling_disabled = false;
    115132}
    116133
    117 void kbd_port_write(uint8_t data)
     134static void niagara_port_write(uint8_t data)
    118135{
    119136        (void) data;
     
    131148                c = input_buffer->data[input_buffer->read_ptr];
    132149                input_buffer->read_ptr =
    133                         ((input_buffer->read_ptr) + 1) % INPUT_BUFFER_SIZE;
    134                 kbd_push_scancode(c);
     150                    ((input_buffer->read_ptr) + 1) % INPUT_BUFFER_SIZE;
     151                kbd_push_data(kbd_dev, c);
    135152        }
    136153}
Note: See TracChangeset for help on using the changeset viewer.