From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Jiri Kosina <jkosina@suse.cz>, Ping Cheng <pinglinux@gmail.com>,
Jason Gerecke <killertofu@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: [PATCH v2 07/23] Input - wacom: split out the pad device for Graphire G4 and MO
Date: Tue, 15 Jul 2014 14:45:30 -0400 [thread overview]
Message-ID: <1405449946-11515-8-git-send-email-benjamin.tissoires@redhat.com> (raw)
In-Reply-To: <1405449946-11515-1-git-send-email-benjamin.tissoires@redhat.com>
MSC_SERIAL can be safely removed from pad devices. If it is not
here, xf86-input-wacom correctly generates ones for its internal
use.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
---
no changes in v2
drivers/input/tablet/wacom_wac.c | 44 ++++++++++++++++++++++++----------------
1 file changed, 27 insertions(+), 17 deletions(-)
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index e7ce16e..299ce78 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -262,6 +262,7 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
struct wacom_features *features = &wacom->features;
unsigned char *data = wacom->data;
struct input_dev *input = wacom->input;
+ struct input_dev *pad_input = wacom->pad_input;
int prox;
int rw = 0;
int retval = 0;
@@ -322,7 +323,6 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
wacom->id[0] = 0;
input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */
input_report_key(input, wacom->tool[0], prox);
- input_event(input, EV_MSC, MSC_SERIAL, 1);
input_sync(input); /* sync last event */
}
@@ -332,14 +332,13 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
prox = data[7] & 0xf8;
if (prox || wacom->id[1]) {
wacom->id[1] = PAD_DEVICE_ID;
- input_report_key(input, BTN_BACK, (data[7] & 0x40));
- input_report_key(input, BTN_FORWARD, (data[7] & 0x80));
+ input_report_key(pad_input, BTN_BACK, (data[7] & 0x40));
+ input_report_key(pad_input, BTN_FORWARD, (data[7] & 0x80));
rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
- input_report_rel(input, REL_WHEEL, rw);
+ input_report_rel(pad_input, REL_WHEEL, rw);
if (!prox)
wacom->id[1] = 0;
- input_report_abs(input, ABS_MISC, wacom->id[1]);
- input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
+ input_report_abs(pad_input, ABS_MISC, wacom->id[1]);
retval = 1;
}
break;
@@ -348,15 +347,14 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
prox = (data[7] & 0xf8) || data[8];
if (prox || wacom->id[1]) {
wacom->id[1] = PAD_DEVICE_ID;
- input_report_key(input, BTN_BACK, (data[7] & 0x08));
- input_report_key(input, BTN_LEFT, (data[7] & 0x20));
- input_report_key(input, BTN_FORWARD, (data[7] & 0x10));
- input_report_key(input, BTN_RIGHT, (data[7] & 0x40));
- input_report_abs(input, ABS_WHEEL, (data[8] & 0x7f));
+ input_report_key(pad_input, BTN_BACK, (data[7] & 0x08));
+ input_report_key(pad_input, BTN_LEFT, (data[7] & 0x20));
+ input_report_key(pad_input, BTN_FORWARD, (data[7] & 0x10));
+ input_report_key(pad_input, BTN_RIGHT, (data[7] & 0x40));
+ input_report_abs(pad_input, ABS_WHEEL, (data[8] & 0x7f));
if (!prox)
wacom->id[1] = 0;
- input_report_abs(input, ABS_MISC, wacom->id[1]);
- input_event(input, EV_MSC, MSC_SERIAL, 0xf0);
+ input_report_abs(pad_input, ABS_MISC, wacom->id[1]);
retval = 1;
}
break;
@@ -1624,10 +1622,6 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
/* fall through */
case WACOM_G4:
- input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
-
- __set_bit(BTN_BACK, input_dev->keybit);
- __set_bit(BTN_FORWARD, input_dev->keybit);
/* fall through */
case GRAPHIRE:
@@ -1840,6 +1834,22 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
input_set_abs_params(input_dev, ABS_Y, 0, 1, 0, 0);
switch (features->type) {
+ case WACOM_MO:
+ __set_bit(BTN_BACK, input_dev->keybit);
+ __set_bit(BTN_LEFT, input_dev->keybit);
+ __set_bit(BTN_FORWARD, input_dev->keybit);
+ __set_bit(BTN_RIGHT, input_dev->keybit);
+ input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
+ break;
+
+ case WACOM_G4:
+ __set_bit(BTN_BACK, input_dev->keybit);
+ __set_bit(BTN_LEFT, input_dev->keybit);
+ __set_bit(BTN_FORWARD, input_dev->keybit);
+ __set_bit(BTN_RIGHT, input_dev->keybit);
+ input_set_capability(input_dev, EV_REL, REL_WHEEL);
+ break;
+
case WACOM_24HD:
__set_bit(BTN_A, input_dev->keybit);
__set_bit(BTN_B, input_dev->keybit);
--
2.0.0
next prev parent reply other threads:[~2014-07-15 19:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-15 18:45 [PATCH v2 00/23] Wacom queued patches Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 01/23] Revert "Input: wacom - testing result shows get_report is unnecessary." Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 02/23] Input - wacom: assign phys field from struct wacom into input_dev Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 03/23] Input - wacom: create a separate input device for pads Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 04/23] Input - wacom: split out the pad device for Intuos/Cintiq Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 05/23] Input - wacom: split out the pad device for Bamboos Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 06/23] Input - wacom: split out the pad device for DTUS Benjamin Tissoires
2014-07-15 18:45 ` Benjamin Tissoires [this message]
2014-07-15 18:45 ` [PATCH v2 08/23] Input - wacom: split out the pad device for the wireless receiver Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 09/23] Input - wacom: include and use linux/hid.h Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 10/23] Input - wacom: switch from an USB driver to a HID driver Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 11/23] Input - wacom: use hid communication instead of plain usb Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 12/23] Input - wacom: use HID core to actually fetch the report descriptor Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 13/23] Input - wacom: compute the HID report size to get the actual packet size Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 14/23] Input - wacom: install LED/OLED sysfs files in the HID device instead of USB Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 15/23] Input - wacom: register the input devices on top of the HID one Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 16/23] Input - wacom: remove usb dependency for siblings devices Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 17/23] Input - wacom: register power device at the HID level Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 18/23] Input - wacom: use hid_info instead of plain dev_info Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 19/23] Input - wacom: use in-kernel HID parser Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 20/23] Input - wacom: use hidinput_calc_abs_res instead of duplicating its code Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 21/23] Input - wacom: remove field pktlen declaration in the list of devices Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 22/23] Input - wacom: keep wacom_ids ordered Benjamin Tissoires
2014-07-15 18:45 ` [PATCH v2 23/23] Input - wacom: Move the USB (now hid) Wacom driver in drivers/hid Benjamin Tissoires
2014-07-24 20:25 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1405449946-11515-8-git-send-email-benjamin.tissoires@redhat.com \
--to=benjamin.tissoires@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=jkosina@suse.cz \
--cc=killertofu@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pinglinux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).