Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 312e5ff in mainline


Ignore:
Timestamp:
2014-08-29T20:28:55Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
75751db6
Parents:
293703e
Message:

DDFize IntegratorCP keyboard driver.

Files:
6 added
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/arm32/Makefile.inc

    r293703e r312e5ff  
    6060
    6161ifeq ($(MACHINE), gta02)
    62 RD_SRVS_ESSENTIAL += \
    63         $(USPACE_PATH)/srv/hid/s3c24xx_ts/s3c24xx_ts \
    64         $(USPACE_PATH)/srv/hw/char/s3c24xx_uart/s3c24ser
     62        RD_SRVS_ESSENTIAL += \
     63                $(USPACE_PATH)/srv/hid/s3c24xx_ts/s3c24xx_ts \
     64                $(USPACE_PATH)/srv/hw/char/s3c24xx_uart/s3c24ser
     65endif
     66
     67ifeq ($(MACHINE), $(filter $(MACHINE),beagleboardxm beaglebone))
     68        RD_DRVS_ESSENTIAL += \
     69                platform/amdm37x \
     70                fb/amdm37x_dispc
     71endif
     72
     73ifeq ($(MACHINE), integratorcp)
     74        RD_DRVS_ESSENTIAL += \
     75                char/pl050 \
     76                char/xtkbd \
     77                platform/icp
    6578endif
    6679
    6780RD_DRVS_ESSENTIAL += \
    68         platform/amdm37x \
    69         fb/amdm37x_dispc \
    7081        bus/usb/ehci \
    7182        bus/usb/ohci \
  • uspace/Makefile

    r293703e r312e5ff  
    136136        drv/block/ata_bd \
    137137        drv/char/i8042 \
     138        drv/char/pl050 \
    138139        drv/char/ps2mouse \
    139140        drv/char/xtkbd \
     
    155156        drv/nic/e1k \
    156157        drv/nic/rtl8139 \
    157         drv/nic/rtl8169
     158        drv/nic/rtl8169 \
     159        drv/platform/icp
    158160
    159161## Platform-specific hardware support
  • uspace/drv/char/xtkbd/xtkbd.c

    r293703e r312e5ff  
    199199 * @param dev DDF device structure.
    200200 *
    201  * Connects to parent, creates mouse function, starts polling fibril.
     201 * Connects to parent, creates keyboard function, starts polling fibril.
    202202 */
    203203int xt_kbd_init(xt_kbd_t *kbd, ddf_dev_t *dev)
     
    207207        kbd->client_sess = NULL;
    208208        kbd->parent_sess = ddf_dev_parent_sess_create(dev, EXCHANGE_SERIALIZE);
    209         if (!kbd->parent_sess)
    210                 return ENOMEM;
     209        if (!kbd->parent_sess) {
     210                ddf_msg(LVL_ERROR, "Failed creating parent session.");
     211                return EIO;
     212        }
    211213
    212214        kbd->kbd_fun = ddf_fun_create(dev, fun_exposed, "kbd");
    213215        if (!kbd->kbd_fun) {
     216                ddf_msg(LVL_ERROR, "Failed creating function 'kbd'.");
    214217                return ENOMEM;
    215218        }
     
    218221        int ret = ddf_fun_bind(kbd->kbd_fun);
    219222        if (ret != EOK) {
     223                ddf_msg(LVL_ERROR, "Failed binding function 'kbd'.");
    220224                ddf_fun_destroy(kbd->kbd_fun);
    221                 return ENOMEM;
     225                return EEXIST;
    222226        }
    223227
    224228        ret = ddf_fun_add_to_category(kbd->kbd_fun, "keyboard");
    225229        if (ret != EOK) {
     230                ddf_msg(LVL_ERROR, "Failed adding function 'kbd' to category "
     231                    "'keyboard'.");
    226232                ddf_fun_unbind(kbd->kbd_fun);
    227233                ddf_fun_destroy(kbd->kbd_fun);
     
    231237        kbd->polling_fibril = fibril_create(polling, kbd);
    232238        if (!kbd->polling_fibril) {
     239                ddf_msg(LVL_ERROR, "Failed creating polling fibril.");
    233240                ddf_fun_unbind(kbd->kbd_fun);
    234241                ddf_fun_destroy(kbd->kbd_fun);
    235242                return ENOMEM;
    236243        }
     244
    237245        fibril_add_ready(kbd->polling_fibril);
    238246        return EOK;
     
    241249/** Get data and parse scancodes.
    242250 * @param arg Pointer to xt_kbd_t structure.
    243  * @return Never.
     251 * @return EIO on error.
    244252 */
    245253int polling(void *arg)
     
    259267                uint8_t code = 0;
    260268                ssize_t size = chardev_read(parent_exch, &code, 1);
     269                if (size != 1)
     270                        return EIO;
    261271
    262272                /** Ignore AT command reply */
     
    269279                        map_size = sizeof(scanmap_e0) / sizeof(int);
    270280                        size = chardev_read(parent_exch, &code, 1);
     281                        if (size != 1)
     282                                return EIO;
     283
    271284                        // TODO handle print screen
    272285                }
    273 
    274                 /* Invalid read. */
    275                 if (size != 1) {
    276                         continue;
    277                 }
    278 
    279286
    280287                /* Bit 7 indicates press/release */
  • uspace/srv/hid/input/Makefile

    r293703e r312e5ff  
    4242        port/niagara.c \
    4343        port/ns16550.c \
    44         port/pl050.c \
    4544        port/ski.c \
    4645        proto/adb.c \
     
    4847        ctl/apple.c \
    4948        ctl/kbdev.c \
    50         ctl/pc.c \
    5149        ctl/stty.c \
    5250        ctl/sun.c \
  • uspace/srv/hid/input/input.c

    r293703e r312e5ff  
    539539        kbd_add_dev(&chardev_port, &stty_ctl);
    540540#endif
    541 #if defined(UARCH_arm32) && defined(MACHINE_integratorcp)
    542         kbd_add_dev(&pl050_port, &pc_ctl);
    543 #endif
    544541#if defined(MACHINE_ski)
    545542        kbd_add_dev(&ski_port, &stty_ctl);
  • uspace/srv/hid/input/kbd_ctl.h

    r293703e r312e5ff  
    5050extern kbd_ctl_ops_t apple_ctl;
    5151extern kbd_ctl_ops_t kbdev_ctl;
    52 extern kbd_ctl_ops_t pc_ctl;
    5352extern kbd_ctl_ops_t stty_ctl;
    5453extern kbd_ctl_ops_t sun_ctl;
  • uspace/srv/hid/input/kbd_port.h

    r293703e r312e5ff  
    5252extern kbd_port_ops_t niagara_port;
    5353extern kbd_port_ops_t ns16550_port;
    54 extern kbd_port_ops_t pl050_port;
    5554extern kbd_port_ops_t ski_port;
    5655
Note: See TracChangeset for help on using the changeset viewer.