diff options
author | Ping Cheng <pinglinux@gmail.com> | 2010-02-20 03:53:49 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-02-20 04:22:44 -0500 |
commit | 49b764aebde6ceea393f56cd3449bfa5720f8383 (patch) | |
tree | 6c74b3d42e4f1705e9f6d2766cd91940f9409249 /drivers | |
parent | 23c239be223d7427da51656d6f196bde965d9796 (diff) |
Input: wacom - add device type to device name string
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 12 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.h | 7 |
2 files changed, 15 insertions, 4 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index f22b88d03c6c..a1770e6feeec 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -592,7 +592,17 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
592 | if (error) | 592 | if (error) |
593 | goto fail2; | 593 | goto fail2; |
594 | 594 | ||
595 | input_dev->name = features->name; | 595 | strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); |
596 | |||
597 | if (features->type == TABLETPC || features->type == TABLETPC2FG) { | ||
598 | /* Append the device type to the name */ | ||
599 | strlcat(wacom_wac->name, | ||
600 | features->device_type == BTN_TOOL_PEN ? | ||
601 | " Pen" : " Finger", | ||
602 | sizeof(wacom_wac->name)); | ||
603 | } | ||
604 | |||
605 | input_dev->name = wacom_wac->name; | ||
596 | wacom->wacom_wac = wacom_wac; | 606 | wacom->wacom_wac = wacom_wac; |
597 | 607 | ||
598 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | 608 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 3f4b89d51fe2..8590b1e8ec37 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h | |||
@@ -73,10 +73,11 @@ struct wacom_features { | |||
73 | }; | 73 | }; |
74 | 74 | ||
75 | struct wacom_wac { | 75 | struct wacom_wac { |
76 | char name[64]; | ||
76 | unsigned char *data; | 77 | unsigned char *data; |
77 | int tool[2]; | 78 | int tool[2]; |
78 | int id[2]; | 79 | int id[2]; |
79 | __u32 serial[2]; | 80 | __u32 serial[2]; |
80 | struct wacom_features features; | 81 | struct wacom_features features; |
81 | }; | 82 | }; |
82 | 83 | ||