evdev: log configured device info
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Fri, 11 Apr 2014 23:27:01 +0000 (16:27 -0700)
committerJonas Ådahl <jadahl@gmail.com>
Sat, 12 Apr 2014 08:04:23 +0000 (10:04 +0200)
Bring back the device configure logging that was originally part of
Weston's evdev.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
src/evdev.c

index 72e4086..901b310 100644 (file)
@@ -601,6 +601,8 @@ evdev_configure_device(struct evdev_device *device)
                    !libevdev_has_event_code(device->evdev, EV_KEY, BTN_TOOL_PEN) &&
                    (has_abs || has_mt)) {
                        device->dispatch = evdev_mt_touchpad_create(device);
+                       log_info("input device '%s', %s is a touchpad\n",
+                                device->devname, device->devnode);
                }
                for (i = KEY_ESC; i < KEY_MAX; i++) {
                        if (i >= BTN_MISC && i < KEY_OK)
@@ -622,12 +624,24 @@ evdev_configure_device(struct evdev_device *device)
        if (libevdev_has_event_type(device->evdev, EV_LED))
                has_keyboard = 1;
 
-       if ((has_abs || has_rel) && has_button)
+       if ((has_abs || has_rel) && has_button) {
                device->seat_caps |= EVDEV_DEVICE_POINTER;
-       if (has_keyboard)
+               log_info("input device '%s', %s is a pointer caps =%s%s%s\n",
+                        device->devname, device->devnode,
+                        has_abs ? " absolute-motion" : "",
+                        has_rel ? " relative-motion": "",
+                        has_button ? " button" : "");
+       }
+       if (has_keyboard) {
                device->seat_caps |= EVDEV_DEVICE_KEYBOARD;
-       if (has_touch && !has_button)
+               log_info("input device '%s', %s is a keyboard\n",
+                        device->devname, device->devnode);
+       }
+       if (has_touch && !has_button) {
                device->seat_caps |= EVDEV_DEVICE_TOUCH;
+               log_info("input device '%s', %s is a touch device\n",
+                        device->devname, device->devnode);
+       }
 
        return 0;
 }