This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-utils.git tree:

Subject: keytable: Add more information about the device
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Sat Aug 13 14:54:49 2011 -0300

Print more information about the device on query mode. It also
provides some info when called with the compatibility mode
or against a non-RC device (e. g. now it will provide some info
if someone uses -d <device> parameter).

Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 utils/keytable/keytable.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=a66d38bd2006ac9705031e048f27e6c480560347

diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index aa0627f..3abf36b 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -1350,6 +1350,27 @@ static void show_evdev_attribs(int fd)
        get_rate(fd, &delay, &period);
 }
 
+static void device_info(int fd, char *prepend)
+{
+       struct input_id id;
+       char buf[32];
+       int rc;
+
+       rc = ioctl(fd, EVIOCGNAME(sizeof(buf)), buf);
+       if (rc >= 0)
+               fprintf(stderr,"%sName: %.*s\n",prepend, rc, buf);
+       else
+               perror ("EVIOCGNAME");
+
+       rc = ioctl(fd, EVIOCGID, &id);
+       if (rc >= 0)
+               fprintf(stderr,
+                       "%sbus: %d, vendor/product: %04x:%04x, version: 
0x%04x\n",
+                       prepend, id.bustype, id.vendor, id.product, id.version);
+       else
+               perror ("EVIOCGID");
+}
+
 static int show_sysfs_attribs(struct rc_device *rc_dev)
 {
        static struct sysfs_names *names, *cur;
@@ -1374,6 +1395,7 @@ static int show_sysfs_attribs(struct rc_device *rc_dev)
                        display_proto(rc_dev);
                        fd = open(rc_dev->input_name, O_RDONLY);
                        if (fd > 0) {
+                               device_info(fd, "\t");
                                show_evdev_attribs(fd);
                                close(fd);
                        } else {
@@ -1395,6 +1417,16 @@ int main(int argc, char *argv[])
 
        /* Just list all devices */
        if (!clear && !readtable && !keys.next && !ch_proto && !cfg.next && 
!test && !delay && !period) {
+               if (devname) {
+                       fd = open(devname, O_RDONLY);
+                       if (fd < 0) {
+                               perror("Can't open device");
+                               return -1;
+                       }
+                       device_info(fd, "");
+                       close(fd);
+                       return 0;
+               }
                if (show_sysfs_attribs(&rc_dev))
                        return -1;
 

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to