linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input : wacom - add an eraser to DTH2242/DTK2241
@ 2013-05-13 17:44 Ping Cheng
  2013-05-23 16:50 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Ping Cheng @ 2013-05-13 17:44 UTC (permalink / raw)
  To: linux-input; +Cc: dmitry.torokhov, Ping Cheng

plus send begin and end of express keys events for
Cintiq 13HD and DTH2242/DTK2241

Signed-off-by: Ping Cheng <pingc@wacom.com>
---
 drivers/input/tablet/wacom_wac.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 2bc7839..518282d 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -362,7 +362,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
 		case 0x100804: /* Intuos4/5 13HD/24HD Art Pen */
 		case 0x140802: /* Intuos4/5 13HD/24HD Classic Pen */
 		case 0x160802: /* Cintiq 13HD Pro Pen */
-		case 0x180802: /* DTH2242 Grip Pen */
+		case 0x180802: /* DTH2242 Pen */
 			wacom->tool[idx] = BTN_TOOL_PEN;
 			break;
 
@@ -400,6 +400,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
 		case 0x10090a: /* Intuos4/5 13HD/24HD Airbrush Eraser */
 		case 0x10080c: /* Intuos4/5 13HD/24HD Art Pen Eraser */
 		case 0x16080a: /* Cintiq 13HD Pro Pen Eraser */
+		case 0x18080a: /* DTH2242 Eraser */
 			wacom->tool[idx] = BTN_TOOL_RUBBER;
 			break;
 
@@ -550,6 +551,11 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
 			input_report_key(input, BTN_3, (data[6] & 0x08));
 			input_report_key(input, BTN_4, (data[6] & 0x10));
 			input_report_key(input, BTN_5, (data[6] & 0x20));
+			if (data[6] & 0x3f) {
+				input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
+			} else {
+				input_report_abs(input, ABS_MISC, 0);
+			}
 		} else if (features->type == WACOM_13HD) {
 			input_report_key(input, BTN_0, (data[3] & 0x01));
 			input_report_key(input, BTN_1, (data[4] & 0x01));
@@ -560,6 +566,11 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
 			input_report_key(input, BTN_6, (data[4] & 0x20));
 			input_report_key(input, BTN_7, (data[4] & 0x40));
 			input_report_key(input, BTN_8, (data[4] & 0x80));
+			if ((data[3] & 0x01) | data[4]) {
+				input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
+			} else {
+				input_report_abs(input, ABS_MISC, 0);
+			}
 		} else if (features->type == WACOM_24HD) {
 			input_report_key(input, BTN_0, (data[6] & 0x01));
 			input_report_key(input, BTN_1, (data[6] & 0x02));
@@ -1539,15 +1550,15 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
 		__set_bit(KEY_PROG1, input_dev->keybit);
 		__set_bit(KEY_PROG2, input_dev->keybit);
 		__set_bit(KEY_PROG3, input_dev->keybit);
+
+		input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+		input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
 		/* fall through */
 
 	case DTK:
 		for (i = 0; i < 6; i++)
 			__set_bit(BTN_0 + i, input_dev->keybit);
 
-		input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
-		input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
-
 		__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
 
 		wacom_setup_cintiq(wacom_wac);
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] input : wacom - add an eraser to DTH2242/DTK2241
  2013-05-13 17:44 [PATCH] input : wacom - add an eraser to DTH2242/DTK2241 Ping Cheng
@ 2013-05-23 16:50 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2013-05-23 16:50 UTC (permalink / raw)
  To: Ping Cheng; +Cc: linux-input, Ping Cheng

On Mon, May 13, 2013 at 10:44:00AM -0700, Ping Cheng wrote:
> plus send begin and end of express keys events for
> Cintiq 13HD and DTH2242/DTK2241
> 
> Signed-off-by: Ping Cheng <pingc@wacom.com>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-23 16:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-13 17:44 [PATCH] input : wacom - add an eraser to DTH2242/DTK2241 Ping Cheng
2013-05-23 16:50 ` Dmitry Torokhov

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).