]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
Input: wacom - add device type to device name string
authorPing Cheng <pinglinux@gmail.com>
Sat, 20 Feb 2010 08:53:49 +0000 (00:53 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 20 Feb 2010 09:22:44 +0000 (01:22 -0800)
Devices supporting both pen and touch features share the same product ID,
but presented as 2 separate input devices. By adding device type to device
name string we can help userspace applications and users differentiate
between them. 'Finger' is used for the touch since touch has been used as
a suffix by userland hotplugging services.

Signed-off-by: Jason Childs <oblivian@users.sourceforge.net>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/tablet/wacom_sys.c
drivers/input/tablet/wacom_wac.h

index f22b88d03c6c9d51f7558ae6e02f03e9d93e0d88..a1770e6feeecbce050078a8bdd6571aa9aab2018 100644 (file)
@@ -592,7 +592,17 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
        if (error)
                goto fail2;
 
-       input_dev->name = features->name;
+       strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
+
+       if (features->type == TABLETPC || features->type == TABLETPC2FG) {
+               /* Append the device type to the name */
+               strlcat(wacom_wac->name,
+                       features->device_type == BTN_TOOL_PEN ?
+                               " Pen" : " Finger",
+                       sizeof(wacom_wac->name));
+       }
+
+       input_dev->name = wacom_wac->name;
        wacom->wacom_wac = wacom_wac;
 
        input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
index 3f4b89d51fe257884ae0955f0fe302b8331d5bbe..8590b1e8ec3774294decc187a91e995bb0477bbc 100644 (file)
@@ -73,10 +73,11 @@ struct wacom_features {
 };
 
 struct wacom_wac {
+       char name[64];
        unsigned char *data;
-        int tool[2];
-        int id[2];
-        __u32 serial[2];
+       int tool[2];
+       int id[2];
+       __u32 serial[2];
        struct wacom_features features;
 };