* [PATCH 1/3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid
@ 2013-08-23 1:15 Jason Gerecke
2013-08-23 1:15 ` [PATCH 2/3] Input: wacom - Provide a range for the ABS_MISC axis Jason Gerecke
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Jason Gerecke @ 2013-08-23 1:15 UTC (permalink / raw)
To: linuxwacom-devel, linux-input, pinglinux; +Cc: Jason Gerecke
Adds support for the sensors integrated in to the Cintiq Companion
Hybrid. These sensors use by-and-large the same protocol as the
Cintiq 24HD touch.
NOTE: The ExpressKeys on the Cintiq Companion Hybrid are wired to
both the EMR controller and CPU GPIO pins. It may be necessary to
disable their functionality in this driver if building a custom
Android kernel for this device (lest two events be sent to userspace
for every button press).
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
---
drivers/input/tablet/wacom_sys.c | 2 +-
drivers/input/tablet/wacom_wac.c | 49 +++++++++++++++++++++++++++++++++++++++-
drivers/input/tablet/wacom_wac.h | 1 +
3 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 1ad3e07..8fa7af7 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -548,7 +548,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
/* MT Tablet PC touch */
return wacom_set_device_mode(intf, 3, 4, 4);
}
- else if (features->type == WACOM_24HDT) {
+ else if (features->type == WACOM_24HDT || features->type == ASTERIX) {
return wacom_set_device_mode(intf, 18, 3, 2);
}
} else if (features->device_type == BTN_TOOL_PEN) {
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 541197b..8ccfe91 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -475,7 +475,7 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
/* general pen packet */
if ((data[1] & 0xb8) == 0xa0) {
t = (data[6] << 2) | ((data[7] >> 6) & 3);
- if (features->type >= INTUOS4S && features->type <= WACOM_24HD) {
+ if (features->type >= INTUOS4S && features->type <= ASTERIX) {
t = (t << 1) | (data[1] & 1);
}
input_report_abs(input, ABS_PRESSURE, t);
@@ -619,6 +619,25 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
} else {
input_report_abs(input, ABS_MISC, 0);
}
+ } else if (features->type == ASTERIX) {
+ /*
+ * Do not send hardware buttons under Android. They
+ * are already sent to the system through GPIO (and
+ * have different meaning).
+ */
+
+#if 1
+ input_report_key(input, BTN_1, (data[4] & 0x01));
+ input_report_key(input, BTN_2, (data[4] & 0x02));
+ input_report_key(input, BTN_3, (data[4] & 0x04));
+ input_report_key(input, BTN_4, (data[4] & 0x08));
+
+ input_report_key(input, BTN_5, (data[4] & 0x10)); // Right
+ input_report_key(input, BTN_6, (data[4] & 0x20)); // Up
+ input_report_key(input, BTN_7, (data[4] & 0x40)); // Left
+ input_report_key(input, BTN_8, (data[4] & 0x80)); // Down
+ input_report_key(input, BTN_0, (data[3] & 0x01)); // Center
+#endif
} else if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
int i;
@@ -1325,6 +1344,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
case WACOM_22HD:
case WACOM_24HD:
case DTK:
+ case ASTERIX:
sync = wacom_intuos_irq(wacom_wac);
break;
@@ -1763,6 +1783,24 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
0, 0);
}
break;
+
+ case ASTERIX:
+ __set_bit(BTN_1, input_dev->keybit);
+ __set_bit(BTN_2, input_dev->keybit);
+ __set_bit(BTN_3, input_dev->keybit);
+ __set_bit(BTN_4, input_dev->keybit);
+
+ __set_bit(BTN_5, input_dev->keybit);
+ __set_bit(BTN_6, input_dev->keybit);
+ __set_bit(BTN_7, input_dev->keybit);
+ __set_bit(BTN_8, input_dev->keybit);
+ __set_bit(BTN_0, input_dev->keybit);
+
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+ __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
+
+ wacom_setup_cintiq(wacom_wac);
+ break;
}
return 0;
}
@@ -2117,6 +2155,13 @@ static const struct wacom_features wacom_features_0xDF =
static const struct wacom_features wacom_features_0x6004 =
{ "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x0307 =
+ { "Wacom ISDv5 307", WACOM_PKGLEN_INTUOS, 59552, 33848, 2047,
+ 63, ASTERIX, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x309 };
+static const struct wacom_features wacom_features_0x0309 =
+ { "Wacom ISDv5 309", .type = WACOM_24HDT, /* Touch */
+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x0307, .touch_max = 10 };
#define USB_DEVICE_WACOM(prod) \
USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
@@ -2247,6 +2292,8 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_WACOM(0xF8) },
{ USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_WACOM(0xFA) },
+ { USB_DEVICE_WACOM(0x0307) },
+ { USB_DEVICE_DETAILED(0x0309, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_LENOVO(0x6004) },
{ }
};
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index dfc9e08..f47a5c1 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -80,6 +80,7 @@ enum {
WACOM_22HD,
DTK,
WACOM_24HD,
+ ASTERIX,
CINTIQ,
WACOM_BEE,
WACOM_13HD,
--
1.8.3.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] Input: wacom - Provide a range for the ABS_MISC axis
2013-08-23 1:15 [PATCH 1/3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid Jason Gerecke
@ 2013-08-23 1:15 ` Jason Gerecke
2013-08-24 23:50 ` Dmitry Torokhov
2013-08-23 1:15 ` [PATCH 3/3] Input: wacom - Send proper tablet state info when pen leaves proximity Jason Gerecke
` (3 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Jason Gerecke @ 2013-08-23 1:15 UTC (permalink / raw)
To: linuxwacom-devel, linux-input, pinglinux; +Cc: Jason Gerecke
Android marks found axes as 'valid' only if they have a minimum
and maximum value that aren't equal. Since we don't actually
assign any range information for ABS_MISC, Android doesn't bother
to mark it such. This prevents userspace from being able to make
use of tool serial information.
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
---
drivers/input/tablet/wacom_wac.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 8ccfe91..869e9c9 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1468,6 +1468,8 @@ static void wacom_abs_set_axis(struct input_dev *input_dev,
{
struct wacom_features *features = &wacom_wac->features;
+ input_set_abs_params(input_dev, ABS_MISC, INT_MIN, INT_MAX, 0, 0);
+
if (features->device_type == BTN_TOOL_PEN) {
input_set_abs_params(input_dev, ABS_X, 0, features->x_max,
features->x_fuzz, 0);
--
1.8.3.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/3] Input: wacom - Send proper tablet state info when pen leaves proximity
2013-08-23 1:15 [PATCH 1/3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid Jason Gerecke
2013-08-23 1:15 ` [PATCH 2/3] Input: wacom - Provide a range for the ABS_MISC axis Jason Gerecke
@ 2013-08-23 1:15 ` Jason Gerecke
2013-08-24 23:56 ` [PATCH 1/3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid Dmitry Torokhov
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Jason Gerecke @ 2013-08-23 1:15 UTC (permalink / raw)
To: linuxwacom-devel, linux-input, pinglinux; +Cc: Jason Gerecke
The EMR sensor of Intuos4 and newer devices can send a packet with
0x20 in its second byte which contains only location information.
This packet is sent when the pen is too far away to reliably obtain
other information. Because only the location is updated userspace
will continue to see stale information for other values, most notably
TOUCH, PRESSURE, and DISTANCE.
This patch ensures userspace is not left with stale device state
information when the pen re-enters proximity (possibly leading to
the assumption the pen is still in contact even though it is
actually hovering).
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
---
drivers/input/tablet/wacom_wac.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 869e9c9..f67a75a 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -425,6 +425,13 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
(features->type == WACOM_21UX2))
return 1;
+ /* Range Report */
+ if ((data[1] & 0xfe) == 0x20) {
+ input_report_key(input, BTN_TOUCH, 0);
+ input_report_abs(input, ABS_PRESSURE, 0);
+ input_report_abs(input, ABS_DISTANCE, wacom->features.distance_max);
+ }
+
/* Exit report */
if ((data[1] & 0xfe) == 0x80) {
if (features->quirks == WACOM_QUIRK_MULTI_INPUT)
--
1.8.3.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] Input: wacom - Provide a range for the ABS_MISC axis
2013-08-23 1:15 ` [PATCH 2/3] Input: wacom - Provide a range for the ABS_MISC axis Jason Gerecke
@ 2013-08-24 23:50 ` Dmitry Torokhov
2013-08-25 17:43 ` Jason Gerecke
0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Torokhov @ 2013-08-24 23:50 UTC (permalink / raw)
To: Jason Gerecke; +Cc: linuxwacom-devel, linux-input, pinglinux
Hi Jason,
On Thu, Aug 22, 2013 at 06:15:36PM -0700, Jason Gerecke wrote:
> Android marks found axes as 'valid' only if they have a minimum
> and maximum value that aren't equal. Since we don't actually
> assign any range information for ABS_MISC, Android doesn't bother
> to mark it such. This prevents userspace from being able to make
> use of tool serial information.
That should be fixed in Android code. Min/max are filled on best effort
basis and 0/0 is effectively unknown.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid
2013-08-23 1:15 [PATCH 1/3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid Jason Gerecke
2013-08-23 1:15 ` [PATCH 2/3] Input: wacom - Provide a range for the ABS_MISC axis Jason Gerecke
2013-08-23 1:15 ` [PATCH 3/3] Input: wacom - Send proper tablet state info when pen leaves proximity Jason Gerecke
@ 2013-08-24 23:56 ` Dmitry Torokhov
2013-08-26 17:13 ` [PATCH 1/3 v2] " Jason Gerecke
2013-09-03 21:52 ` [PATCH 1/3 v3] " Jason Gerecke
4 siblings, 0 replies; 9+ messages in thread
From: Dmitry Torokhov @ 2013-08-24 23:56 UTC (permalink / raw)
To: Jason Gerecke; +Cc: linuxwacom-devel, linux-input, pinglinux
Hi Jason,
On Thu, Aug 22, 2013 at 06:15:35PM -0700, Jason Gerecke wrote:
> Adds support for the sensors integrated in to the Cintiq Companion
> Hybrid. These sensors use by-and-large the same protocol as the
> Cintiq 24HD touch.
>
> NOTE: The ExpressKeys on the Cintiq Companion Hybrid are wired to
> both the EMR controller and CPU GPIO pins. It may be necessary to
> disable their functionality in this driver if building a custom
> Android kernel for this device (lest two events be sent to userspace
> for every button press).
>
> Signed-off-by: Jason Gerecke <killertofu@gmail.com>
> ---
> drivers/input/tablet/wacom_sys.c | 2 +-
> drivers/input/tablet/wacom_wac.c | 49 +++++++++++++++++++++++++++++++++++++++-
> drivers/input/tablet/wacom_wac.h | 1 +
> 3 files changed, 50 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
> index 1ad3e07..8fa7af7 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -548,7 +548,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
> /* MT Tablet PC touch */
> return wacom_set_device_mode(intf, 3, 4, 4);
> }
> - else if (features->type == WACOM_24HDT) {
> + else if (features->type == WACOM_24HDT || features->type == ASTERIX) {
> return wacom_set_device_mode(intf, 18, 3, 2);
> }
> } else if (features->device_type == BTN_TOOL_PEN) {
> diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
> index 541197b..8ccfe91 100644
> --- a/drivers/input/tablet/wacom_wac.c
> +++ b/drivers/input/tablet/wacom_wac.c
> @@ -475,7 +475,7 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
> /* general pen packet */
> if ((data[1] & 0xb8) == 0xa0) {
> t = (data[6] << 2) | ((data[7] >> 6) & 3);
> - if (features->type >= INTUOS4S && features->type <= WACOM_24HD) {
> + if (features->type >= INTUOS4S && features->type <= ASTERIX) {
> t = (t << 1) | (data[1] & 1);
> }
> input_report_abs(input, ABS_PRESSURE, t);
> @@ -619,6 +619,25 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
> } else {
> input_report_abs(input, ABS_MISC, 0);
> }
> + } else if (features->type == ASTERIX) {
> + /*
> + * Do not send hardware buttons under Android. They
> + * are already sent to the system through GPIO (and
> + * have different meaning).
> + */
> +
> +#if 1
Should this be removed.
> + input_report_key(input, BTN_1, (data[4] & 0x01));
> + input_report_key(input, BTN_2, (data[4] & 0x02));
> + input_report_key(input, BTN_3, (data[4] & 0x04));
> + input_report_key(input, BTN_4, (data[4] & 0x08));
> +
> + input_report_key(input, BTN_5, (data[4] & 0x10)); // Right
> + input_report_key(input, BTN_6, (data[4] & 0x20)); // Up
> + input_report_key(input, BTN_7, (data[4] & 0x40)); // Left
> + input_report_key(input, BTN_8, (data[4] & 0x80)); // Down
> + input_report_key(input, BTN_0, (data[3] & 0x01)); // Center
C-style comments are still preferred in the kernel.
> +#endif
> } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
> int i;
>
> @@ -1325,6 +1344,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
> case WACOM_22HD:
> case WACOM_24HD:
> case DTK:
> + case ASTERIX:
> sync = wacom_intuos_irq(wacom_wac);
> break;
>
> @@ -1763,6 +1783,24 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
> 0, 0);
> }
> break;
> +
> + case ASTERIX:
> + __set_bit(BTN_1, input_dev->keybit);
> + __set_bit(BTN_2, input_dev->keybit);
> + __set_bit(BTN_3, input_dev->keybit);
> + __set_bit(BTN_4, input_dev->keybit);
> +
> + __set_bit(BTN_5, input_dev->keybit);
> + __set_bit(BTN_6, input_dev->keybit);
> + __set_bit(BTN_7, input_dev->keybit);
> + __set_bit(BTN_8, input_dev->keybit);
> + __set_bit(BTN_0, input_dev->keybit);
> +
> + input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
> + __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
> +
> + wacom_setup_cintiq(wacom_wac);
> + break;
> }
> return 0;
> }
> @@ -2117,6 +2155,13 @@ static const struct wacom_features wacom_features_0xDF =
> static const struct wacom_features wacom_features_0x6004 =
> { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
> 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
> +static const struct wacom_features wacom_features_0x0307 =
> + { "Wacom ISDv5 307", WACOM_PKGLEN_INTUOS, 59552, 33848, 2047,
> + 63, ASTERIX, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
> + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x309 };
> +static const struct wacom_features wacom_features_0x0309 =
> + { "Wacom ISDv5 309", .type = WACOM_24HDT, /* Touch */
> + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x0307, .touch_max = 10 };
>
> #define USB_DEVICE_WACOM(prod) \
> USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
> @@ -2247,6 +2292,8 @@ const struct usb_device_id wacom_ids[] = {
> { USB_DEVICE_WACOM(0xF8) },
> { USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) },
> { USB_DEVICE_WACOM(0xFA) },
> + { USB_DEVICE_WACOM(0x0307) },
> + { USB_DEVICE_DETAILED(0x0309, USB_CLASS_HID, 0, 0) },
> { USB_DEVICE_LENOVO(0x6004) },
> { }
> };
> diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
> index dfc9e08..f47a5c1 100644
> --- a/drivers/input/tablet/wacom_wac.h
> +++ b/drivers/input/tablet/wacom_wac.h
> @@ -80,6 +80,7 @@ enum {
> WACOM_22HD,
> DTK,
> WACOM_24HD,
> + ASTERIX,
> CINTIQ,
> WACOM_BEE,
> WACOM_13HD,
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] Input: wacom - Provide a range for the ABS_MISC axis
2013-08-24 23:50 ` Dmitry Torokhov
@ 2013-08-25 17:43 ` Jason Gerecke
0 siblings, 0 replies; 9+ messages in thread
From: Jason Gerecke @ 2013-08-25 17:43 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linuxwacom-devel, Linux Input, Ping Cheng
On Sat, Aug 24, 2013 at 4:50 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> Hi Jason,
>
> On Thu, Aug 22, 2013 at 06:15:36PM -0700, Jason Gerecke wrote:
> > Android marks found axes as 'valid' only if they have a minimum
> > and maximum value that aren't equal. Since we don't actually
> > assign any range information for ABS_MISC, Android doesn't bother
> > to mark it such. This prevents userspace from being able to make
> > use of tool serial information.
>
> That should be fixed in Android code. Min/max are filled on best effort
> basis and 0/0 is effectively unknown.
>
> Thanks.
>
> --
> Dmitry
If userspace is written with the assumption that 0/0 == unknown, then
this patch changes nothing since the consumer will expect any value
between INT_MIN and INT_MAX anyway. Furthermore, if some userspace
program strictly interprets 0/0 to mean "will always be equal to 0",
then this patch actually provides it with the correct range. Either
way, setting the values to INT_MIN and INT_MAX does nothing more than
explicitly state the correct range.
I agree that Google should re-visit the function which does this
"valid" filtering, but I don't see a problem with this patch.
Jason
---
Now instead of four in the eights place /
you’ve got three, ‘Cause you added one /
(That is to say, eight) to the two, /
But you can’t take seven from three, /
So you look at the sixty-fours....
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3 v2] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid
2013-08-23 1:15 [PATCH 1/3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid Jason Gerecke
` (2 preceding siblings ...)
2013-08-24 23:56 ` [PATCH 1/3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid Dmitry Torokhov
@ 2013-08-26 17:13 ` Jason Gerecke
2013-08-29 1:10 ` Peter Hutterer
2013-09-03 21:52 ` [PATCH 1/3 v3] " Jason Gerecke
4 siblings, 1 reply; 9+ messages in thread
From: Jason Gerecke @ 2013-08-26 17:13 UTC (permalink / raw)
To: linuxwacom-devel, linux-input, pinglinux; +Cc: Jason Gerecke
Adds support for the sensors integrated in to the Cintiq Companion
Hybrid. These sensors use by-and-large the same protocol as the
Cintiq 24HD touch.
NOTE: The ExpressKeys on the Cintiq Companion Hybrid are wired to
both the EMR controller and CPU GPIO pins. It may be necessary to
disable their functionality in this driver if building a custom
Android kernel for this device (lest two events be sent to userspace
for every button press).
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
---
Changes in v2:
* Remove "#if 1" block surrounding conditional ExpressKey reporting
* Change to C-style comments
drivers/input/tablet/wacom_sys.c | 2 +-
drivers/input/tablet/wacom_wac.c | 46 +++++++++++++++++++++++++++++++++++++++-
drivers/input/tablet/wacom_wac.h | 1 +
3 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 1ad3e07..8fa7af7 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -548,7 +548,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
/* MT Tablet PC touch */
return wacom_set_device_mode(intf, 3, 4, 4);
}
- else if (features->type == WACOM_24HDT) {
+ else if (features->type == WACOM_24HDT || features->type == ASTERIX) {
return wacom_set_device_mode(intf, 18, 3, 2);
}
} else if (features->device_type == BTN_TOOL_PEN) {
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 541197b..9265b3d 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -475,7 +475,7 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
/* general pen packet */
if ((data[1] & 0xb8) == 0xa0) {
t = (data[6] << 2) | ((data[7] >> 6) & 3);
- if (features->type >= INTUOS4S && features->type <= WACOM_24HD) {
+ if (features->type >= INTUOS4S && features->type <= ASTERIX) {
t = (t << 1) | (data[1] & 1);
}
input_report_abs(input, ABS_PRESSURE, t);
@@ -619,6 +619,22 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
} else {
input_report_abs(input, ABS_MISC, 0);
}
+ } else if (features->type == ASTERIX) {
+ /*
+ * Do not send hardware buttons under Android. They
+ * are already sent to the system through GPIO (and
+ * have different meaning).
+ */
+ input_report_key(input, BTN_1, (data[4] & 0x01));
+ input_report_key(input, BTN_2, (data[4] & 0x02));
+ input_report_key(input, BTN_3, (data[4] & 0x04));
+ input_report_key(input, BTN_4, (data[4] & 0x08));
+
+ input_report_key(input, BTN_5, (data[4] & 0x10)); /* Right */
+ input_report_key(input, BTN_6, (data[4] & 0x20)); /* Up */
+ input_report_key(input, BTN_7, (data[4] & 0x40)); /* Left */
+ input_report_key(input, BTN_8, (data[4] & 0x80)); /* Down */
+ input_report_key(input, BTN_0, (data[3] & 0x01)); /* Center */
} else if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
int i;
@@ -1325,6 +1341,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
case WACOM_22HD:
case WACOM_24HD:
case DTK:
+ case ASTERIX:
sync = wacom_intuos_irq(wacom_wac);
break;
@@ -1763,6 +1780,24 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
0, 0);
}
break;
+
+ case ASTERIX:
+ __set_bit(BTN_1, input_dev->keybit);
+ __set_bit(BTN_2, input_dev->keybit);
+ __set_bit(BTN_3, input_dev->keybit);
+ __set_bit(BTN_4, input_dev->keybit);
+
+ __set_bit(BTN_5, input_dev->keybit);
+ __set_bit(BTN_6, input_dev->keybit);
+ __set_bit(BTN_7, input_dev->keybit);
+ __set_bit(BTN_8, input_dev->keybit);
+ __set_bit(BTN_0, input_dev->keybit);
+
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+ __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
+
+ wacom_setup_cintiq(wacom_wac);
+ break;
}
return 0;
}
@@ -2117,6 +2152,13 @@ static const struct wacom_features wacom_features_0xDF =
static const struct wacom_features wacom_features_0x6004 =
{ "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x0307 =
+ { "Wacom ISDv5 307", WACOM_PKGLEN_INTUOS, 59552, 33848, 2047,
+ 63, ASTERIX, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x309 };
+static const struct wacom_features wacom_features_0x0309 =
+ { "Wacom ISDv5 309", .type = WACOM_24HDT, /* Touch */
+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x0307, .touch_max = 10 };
#define USB_DEVICE_WACOM(prod) \
USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
@@ -2247,6 +2289,8 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_WACOM(0xF8) },
{ USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_WACOM(0xFA) },
+ { USB_DEVICE_WACOM(0x0307) },
+ { USB_DEVICE_DETAILED(0x0309, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_LENOVO(0x6004) },
{ }
};
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index dfc9e08..f47a5c1 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -80,6 +80,7 @@ enum {
WACOM_22HD,
DTK,
WACOM_24HD,
+ ASTERIX,
CINTIQ,
WACOM_BEE,
WACOM_13HD,
--
1.8.3.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3 v2] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid
2013-08-26 17:13 ` [PATCH 1/3 v2] " Jason Gerecke
@ 2013-08-29 1:10 ` Peter Hutterer
0 siblings, 0 replies; 9+ messages in thread
From: Peter Hutterer @ 2013-08-29 1:10 UTC (permalink / raw)
To: Jason Gerecke; +Cc: linuxwacom-devel, linux-input, pinglinux
On Mon, Aug 26, 2013 at 10:13:30AM -0700, Jason Gerecke wrote:
> Adds support for the sensors integrated in to the Cintiq Companion
> Hybrid. These sensors use by-and-large the same protocol as the
> Cintiq 24HD touch.
>
> NOTE: The ExpressKeys on the Cintiq Companion Hybrid are wired to
> both the EMR controller and CPU GPIO pins. It may be necessary to
> disable their functionality in this driver if building a custom
> Android kernel for this device (lest two events be sent to userspace
> for every button press).
>
> Signed-off-by: Jason Gerecke <killertofu@gmail.com>
> ---
> Changes in v2:
> * Remove "#if 1" block surrounding conditional ExpressKey reporting
> * Change to C-style comments
[...]
> diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
> index dfc9e08..f47a5c1 100644
> --- a/drivers/input/tablet/wacom_wac.h
> +++ b/drivers/input/tablet/wacom_wac.h
> @@ -80,6 +80,7 @@ enum {
> WACOM_22HD,
> DTK,
> WACOM_24HD,
> + ASTERIX,
> CINTIQ,
> WACOM_BEE,
> WACOM_13HD,
> --
> 1.8.3.4
I assume ASTERIX is some internal codename - can we use the commonly used
name instead?
Cheers,
Peter
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3 v3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid
2013-08-23 1:15 [PATCH 1/3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid Jason Gerecke
` (3 preceding siblings ...)
2013-08-26 17:13 ` [PATCH 1/3 v2] " Jason Gerecke
@ 2013-09-03 21:52 ` Jason Gerecke
4 siblings, 0 replies; 9+ messages in thread
From: Jason Gerecke @ 2013-09-03 21:52 UTC (permalink / raw)
To: linuxwacom-devel, linux-input, pinglinux, peter.hutterer; +Cc: Jason Gerecke
Adds support for the sensors integrated in to the Cintiq Companion
Hybrid. These sensors use by-and-large the same protocol as the
Cintiq 24HD touch.
NOTE: The ExpressKeys on the Cintiq Companion Hybrid are wired to
both the EMR controller and CPU GPIO pins. It may be necessary to
disable their functionality in this driver if building a custom
Android kernel for this device (lest two events be sent to userspace
for every button press).
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
---
Changes in v3:
* Change type name from 'ASTERIX' to 'CINTIQ_HYBRID'
Changes in v2:
* Remove "#if 1" block surrounding conditional ExpressKey reporting
* Change to C-style comments
drivers/input/tablet/wacom_sys.c | 2 +-
drivers/input/tablet/wacom_wac.c | 46 +++++++++++++++++++++++++++++++++++++++-
drivers/input/tablet/wacom_wac.h | 1 +
3 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 1ad3e07..0750d2a 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -548,7 +548,7 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
/* MT Tablet PC touch */
return wacom_set_device_mode(intf, 3, 4, 4);
}
- else if (features->type == WACOM_24HDT) {
+ else if (features->type == WACOM_24HDT || features->type == CINTIQ_HYBRID) {
return wacom_set_device_mode(intf, 18, 3, 2);
}
} else if (features->device_type == BTN_TOOL_PEN) {
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 541197b..d68bf73 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -475,7 +475,7 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
/* general pen packet */
if ((data[1] & 0xb8) == 0xa0) {
t = (data[6] << 2) | ((data[7] >> 6) & 3);
- if (features->type >= INTUOS4S && features->type <= WACOM_24HD) {
+ if (features->type >= INTUOS4S && features->type <= CINTIQ_HYBRID) {
t = (t << 1) | (data[1] & 1);
}
input_report_abs(input, ABS_PRESSURE, t);
@@ -619,6 +619,22 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
} else {
input_report_abs(input, ABS_MISC, 0);
}
+ } else if (features->type == CINTIQ_HYBRID) {
+ /*
+ * Do not send hardware buttons under Android. They
+ * are already sent to the system through GPIO (and
+ * have different meaning).
+ */
+ input_report_key(input, BTN_1, (data[4] & 0x01));
+ input_report_key(input, BTN_2, (data[4] & 0x02));
+ input_report_key(input, BTN_3, (data[4] & 0x04));
+ input_report_key(input, BTN_4, (data[4] & 0x08));
+
+ input_report_key(input, BTN_5, (data[4] & 0x10)); /* Right */
+ input_report_key(input, BTN_6, (data[4] & 0x20)); /* Up */
+ input_report_key(input, BTN_7, (data[4] & 0x40)); /* Left */
+ input_report_key(input, BTN_8, (data[4] & 0x80)); /* Down */
+ input_report_key(input, BTN_0, (data[3] & 0x01)); /* Center */
} else if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
int i;
@@ -1325,6 +1341,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
case WACOM_22HD:
case WACOM_24HD:
case DTK:
+ case CINTIQ_HYBRID:
sync = wacom_intuos_irq(wacom_wac);
break;
@@ -1763,6 +1780,24 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
0, 0);
}
break;
+
+ case CINTIQ_HYBRID:
+ __set_bit(BTN_1, input_dev->keybit);
+ __set_bit(BTN_2, input_dev->keybit);
+ __set_bit(BTN_3, input_dev->keybit);
+ __set_bit(BTN_4, input_dev->keybit);
+
+ __set_bit(BTN_5, input_dev->keybit);
+ __set_bit(BTN_6, input_dev->keybit);
+ __set_bit(BTN_7, input_dev->keybit);
+ __set_bit(BTN_8, input_dev->keybit);
+ __set_bit(BTN_0, input_dev->keybit);
+
+ input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
+ __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
+
+ wacom_setup_cintiq(wacom_wac);
+ break;
}
return 0;
}
@@ -2117,6 +2152,13 @@ static const struct wacom_features wacom_features_0xDF =
static const struct wacom_features wacom_features_0x6004 =
{ "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x0307 =
+ { "Wacom ISDv5 307", WACOM_PKGLEN_INTUOS, 59552, 33848, 2047,
+ 63, CINTIQ_HYBRID, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x309 };
+static const struct wacom_features wacom_features_0x0309 =
+ { "Wacom ISDv5 309", .type = WACOM_24HDT, /* Touch */
+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x0307, .touch_max = 10 };
#define USB_DEVICE_WACOM(prod) \
USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
@@ -2247,6 +2289,8 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_WACOM(0xF8) },
{ USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_WACOM(0xFA) },
+ { USB_DEVICE_WACOM(0x0307) },
+ { USB_DEVICE_DETAILED(0x0309, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_LENOVO(0x6004) },
{ }
};
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index dfc9e08..90ce10d 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -80,6 +80,7 @@ enum {
WACOM_22HD,
DTK,
WACOM_24HD,
+ CINTIQ_HYBRID,
CINTIQ,
WACOM_BEE,
WACOM_13HD,
--
1.8.3.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-09-03 21:52 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-23 1:15 [PATCH 1/3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid Jason Gerecke
2013-08-23 1:15 ` [PATCH 2/3] Input: wacom - Provide a range for the ABS_MISC axis Jason Gerecke
2013-08-24 23:50 ` Dmitry Torokhov
2013-08-25 17:43 ` Jason Gerecke
2013-08-23 1:15 ` [PATCH 3/3] Input: wacom - Send proper tablet state info when pen leaves proximity Jason Gerecke
2013-08-24 23:56 ` [PATCH 1/3] Input: wacom - Support EMR and MFT sensors of Cintiq Companion Hybrid Dmitry Torokhov
2013-08-26 17:13 ` [PATCH 1/3 v2] " Jason Gerecke
2013-08-29 1:10 ` Peter Hutterer
2013-09-03 21:52 ` [PATCH 1/3 v3] " Jason Gerecke
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).