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

Changeset a2afd8f in mainline for uspace/srv/hid/input/input.c


Ignore:
Timestamp:
2017-11-13T18:07:46Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
0dd4779
Parents:
56763a4
Message:

Move ADB keyboard and mouse support to separate drivers.

File:
1 edited

Legend:

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

    r56763a4 ra2afd8f  
    458458}
    459459
    460 /** Add new legacy mouse device. */
    461 static void mouse_add_dev(mouse_port_ops_t *port, mouse_proto_ops_t *proto)
    462 {
    463         mouse_dev_t *mdev = mouse_dev_new();
    464         if (mdev == NULL)
    465                 return;
    466        
    467         mdev->port_ops = port;
    468         mdev->proto_ops = proto;
    469         mdev->svc_id = 0;
    470        
    471         /* Initialize port driver. */
    472         if ((*mdev->port_ops->init)(mdev) != 0)
    473                 goto fail;
    474        
    475         /* Initialize protocol driver. */
    476         if ((*mdev->proto_ops->init)(mdev) != 0) {
    477                 /* XXX Uninit port */
    478                 goto fail;
    479         }
    480        
    481         list_append(&mdev->link, &mouse_devs);
    482         return;
    483        
    484 fail:
    485         free(mdev);
    486 }
    487 
    488460/** Add new kbdev device.
    489461 *
     
    643615        kbd_add_dev(&chardev_port, &stty_ctl);
    644616#endif
    645 #if defined(UARCH_ppc32)
    646         kbd_add_dev(&adb_port, &apple_ctl);
    647 #endif
    648617#if defined(UARCH_sparc64) && defined(PROCESSOR_sun4v)
    649618        kbd_add_dev(&chardev_port, &stty_ctl);
     
    651620        /* Silence warning on abs32le about kbd_add_dev() being unused */
    652621        (void) kbd_add_dev;
    653 }
    654 
    655 /** Add legacy drivers/devices. */
    656 static void mouse_add_legacy_devs(void)
    657 {
    658         /*
    659          * Need to add these drivers based on config unless we can probe
    660          * them automatically.
    661          */
    662 #if defined(UARCH_ppc32)
    663         mouse_add_dev(&adb_mouse_port, &adb_proto);
    664 #endif
    665         /* Silence warning on abs32le about mouse_add_dev() being unused */
    666         (void) mouse_add_dev;
    667622}
    668623
     
    895850        kbd_add_legacy_devs();
    896851       
    897         /* Add legacy mouse devices. */
    898         mouse_add_legacy_devs();
    899        
    900852        /* Register driver */
    901853        async_set_client_data_constructor(client_data_create);
Note: See TracChangeset for help on using the changeset viewer.