Linux v3.13-6058-g2d08cd0
- Quiet incorrect usb phy error (rhbz 1057529)
This commit is contained in:
parent
b7897ab1e4
commit
b94e3495cf
@ -1,56 +0,0 @@
|
||||
Bugzilla: 1046238
|
||||
Upstream-status: Queued for 3.14
|
||||
|
||||
From 1d0d6df02750b4a6f466768cbfbf860e24f4c8d4 Mon Sep 17 00:00:00 2001
|
||||
From: Ping Cheng <pinglinux@gmail.com>
|
||||
Date: Mon, 25 Nov 2013 18:43:45 -0800
|
||||
Subject: [PATCH] Input: wacom - make sure touch_max is set for touch devices
|
||||
|
||||
Old single touch Tablet PCs do not have touch_max set at
|
||||
wacom_features. Since touch device at lease supports one
|
||||
finger, assign touch_max to 1 when touch usage is defined
|
||||
in its HID Descriptor and touch_max is not pre-defined.
|
||||
|
||||
Tested-by: Jason Gerecke <killertofu@gmail.com>
|
||||
Signed-off-by: Ping Cheng <pingc@wacom.com>
|
||||
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
|
||||
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
||||
---
|
||||
drivers/input/tablet/wacom_sys.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
|
||||
index 8a90da1..3d71b60 100644
|
||||
--- a/drivers/input/tablet/wacom_sys.c
|
||||
+++ b/drivers/input/tablet/wacom_sys.c
|
||||
@@ -304,7 +304,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
|
||||
struct usb_device *dev = interface_to_usbdev(intf);
|
||||
char limit = 0;
|
||||
/* result has to be defined as int for some devices */
|
||||
- int result = 0;
|
||||
+ int result = 0, touch_max = 0;
|
||||
int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0;
|
||||
unsigned char *report;
|
||||
|
||||
@@ -351,7 +351,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
|
||||
if (usage == WCM_DESKTOP) {
|
||||
if (finger) {
|
||||
features->device_type = BTN_TOOL_FINGER;
|
||||
-
|
||||
+ /* touch device at least supports one touch point */
|
||||
+ touch_max = 1;
|
||||
switch (features->type) {
|
||||
case TABLETPC2FG:
|
||||
features->pktlen = WACOM_PKGLEN_TPC2FG;
|
||||
@@ -504,6 +505,8 @@ static int wacom_parse_hid(struct usb_interface *intf,
|
||||
}
|
||||
|
||||
out:
|
||||
+ if (!features->touch_max && touch_max)
|
||||
+ features->touch_max = touch_max;
|
||||
result = 0;
|
||||
kfree(report);
|
||||
return result;
|
||||
--
|
||||
1.8.4.2
|
||||
|
34
0001-usb-phy-Quiet-unable-to-find-transceiver-message.patch
Normal file
34
0001-usb-phy-Quiet-unable-to-find-transceiver-message.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From 80f13c7cb8c2b83b6b38a953ad69b91cab9dc614 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Boyer <jwboyer@fedoraproject.org>
|
||||
Date: Sat, 25 Jan 2014 10:00:41 -0500
|
||||
Subject: [PATCH] usb: phy: Quiet unable to find transceiver message
|
||||
|
||||
commit 1ae5799ef6317 ("usb: hcd: Initialize USB phy if needed") allows
|
||||
the USB layer to initialize external PHYs if needed. However, a PHY is
|
||||
not needed in all cases. The usb_get_phy_device function will print
|
||||
an error message, "unable to find transceiver" but everything still
|
||||
functions normally.
|
||||
|
||||
Drop the severity of this message to pr_debug.
|
||||
|
||||
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
|
||||
---
|
||||
drivers/usb/phy/phy.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
|
||||
index e6f61e4..c7fe880 100644
|
||||
--- a/drivers/usb/phy/phy.c
|
||||
+++ b/drivers/usb/phy/phy.c
|
||||
@@ -228,7 +228,7 @@ struct usb_phy *usb_get_phy_dev(struct device *dev, u8 index)
|
||||
|
||||
phy = __usb_find_phy_dev(dev, &phy_bind_list, index);
|
||||
if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
|
||||
- pr_err("unable to find transceiver\n");
|
||||
+ pr_debug("unable to find transceiver\n");
|
||||
goto err0;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.5.3
|
||||
|
@ -1,216 +0,0 @@
|
||||
Bugzilla: 1046238
|
||||
Upstream-status: Queued for 3.14
|
||||
|
||||
From b5fd2a3e92ca5c8c1f3c20d31ac5daed3ec4d604 Mon Sep 17 00:00:00 2001
|
||||
From: Ping Cheng <pinglinux@gmail.com>
|
||||
Date: Mon, 25 Nov 2013 18:44:55 -0800
|
||||
Subject: [PATCH] Input: wacom - add support for three new Intuos devices
|
||||
|
||||
Two tablets in this series support both pen and touch. One (Intuos S)
|
||||
only supports pen. This patch also updates the driver to process wireless
|
||||
devices that do not support touch interface.
|
||||
|
||||
Tested-by: Jason Gerecke <killertofu@gmail.com>
|
||||
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
|
||||
Signed-off-by: Ping Cheng <pingc@wacom.com>
|
||||
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
||||
---
|
||||
drivers/input/tablet/wacom_sys.c | 6 ++--
|
||||
drivers/input/tablet/wacom_wac.c | 61 ++++++++++++++++++++++++++++++----------
|
||||
drivers/input/tablet/wacom_wac.h | 2 ++
|
||||
3 files changed, 51 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
|
||||
index 3d71b60..3a7d99c 100644
|
||||
--- a/drivers/input/tablet/wacom_sys.c
|
||||
+++ b/drivers/input/tablet/wacom_sys.c
|
||||
@@ -1198,7 +1198,8 @@ static void wacom_wireless_work(struct work_struct *work)
|
||||
goto fail;
|
||||
|
||||
/* Touch interface */
|
||||
- if (wacom_wac1->features.touch_max) {
|
||||
+ if (wacom_wac1->features.touch_max ||
|
||||
+ wacom_wac1->features.type == INTUOSHT) {
|
||||
wacom_wac2->features =
|
||||
*((struct wacom_features *)id->driver_info);
|
||||
wacom_wac2->features.pktlen = WACOM_PKGLEN_BBTOUCH3;
|
||||
@@ -1321,7 +1322,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
|
||||
* HID descriptor. If this is the touch interface (wMaxPacketSize
|
||||
* of WACOM_PKGLEN_BBTOUCH3), override the table values.
|
||||
*/
|
||||
- if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
|
||||
+ if (features->type >= INTUOS5S && features->type <= INTUOSHT) {
|
||||
if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) {
|
||||
features->device_type = BTN_TOOL_FINGER;
|
||||
features->pktlen = WACOM_PKGLEN_BBTOUCH3;
|
||||
@@ -1391,7 +1392,6 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
|
||||
goto fail5;
|
||||
}
|
||||
}
|
||||
-
|
||||
return 0;
|
||||
|
||||
fail5: wacom_destroy_leds(wacom);
|
||||
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
|
||||
index 3f75f1d..eb60a28 100644
|
||||
--- a/drivers/input/tablet/wacom_wac.c
|
||||
+++ b/drivers/input/tablet/wacom_wac.c
|
||||
@@ -1176,10 +1176,16 @@ static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data)
|
||||
static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data)
|
||||
{
|
||||
struct input_dev *input = wacom->input;
|
||||
+ struct wacom_features *features = &wacom->features;
|
||||
|
||||
- input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
|
||||
+ if (features->type == INTUOSHT) {
|
||||
+ input_report_key(input, BTN_LEFT, (data[1] & 0x02) != 0);
|
||||
+ input_report_key(input, BTN_BACK, (data[1] & 0x08) != 0);
|
||||
+ } else {
|
||||
+ input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
|
||||
+ input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
|
||||
+ }
|
||||
input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);
|
||||
- input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
|
||||
input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);
|
||||
}
|
||||
|
||||
@@ -1217,7 +1223,7 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
|
||||
unsigned char *data = wacom->data;
|
||||
int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
|
||||
|
||||
- if (data[0] != 0x02)
|
||||
+ if (data[0] != WACOM_REPORT_PENABLED)
|
||||
return 0;
|
||||
|
||||
prox = (data[1] & 0x20) == 0x20;
|
||||
@@ -1297,7 +1303,7 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
|
||||
unsigned char *data = wacom->data;
|
||||
int connected;
|
||||
|
||||
- if (len != WACOM_PKGLEN_WIRELESS || data[0] != 0x80)
|
||||
+ if (len != WACOM_PKGLEN_WIRELESS || data[0] != WACOM_REPORT_WL)
|
||||
return 0;
|
||||
|
||||
connected = data[1] & 0x01;
|
||||
@@ -1391,6 +1397,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
|
||||
break;
|
||||
|
||||
case BAMBOO_PT:
|
||||
+ case INTUOSHT:
|
||||
sync = wacom_bpt_irq(wacom_wac, len);
|
||||
break;
|
||||
|
||||
@@ -1459,7 +1466,7 @@ void wacom_setup_device_quirks(struct wacom_features *features)
|
||||
|
||||
/* these device have multiple inputs */
|
||||
if (features->type >= WIRELESS ||
|
||||
- (features->type >= INTUOS5S && features->type <= INTUOSPL) ||
|
||||
+ (features->type >= INTUOS5S && features->type <= INTUOSHT) ||
|
||||
(features->oVid && features->oPid))
|
||||
features->quirks |= WACOM_QUIRK_MULTI_INPUT;
|
||||
|
||||
@@ -1771,33 +1778,43 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
|
||||
__set_bit(INPUT_PROP_POINTER, input_dev->propbit);
|
||||
break;
|
||||
|
||||
+ case INTUOSHT:
|
||||
case BAMBOO_PT:
|
||||
__clear_bit(ABS_MISC, input_dev->absbit);
|
||||
|
||||
- __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
|
||||
-
|
||||
if (features->device_type == BTN_TOOL_FINGER) {
|
||||
- unsigned int flags = INPUT_MT_POINTER;
|
||||
|
||||
__set_bit(BTN_LEFT, input_dev->keybit);
|
||||
__set_bit(BTN_FORWARD, input_dev->keybit);
|
||||
__set_bit(BTN_BACK, input_dev->keybit);
|
||||
__set_bit(BTN_RIGHT, input_dev->keybit);
|
||||
|
||||
- if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
|
||||
- input_set_abs_params(input_dev,
|
||||
+ if (features->touch_max) {
|
||||
+ /* touch interface */
|
||||
+ unsigned int flags = INPUT_MT_POINTER;
|
||||
+
|
||||
+ __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
|
||||
+ if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
|
||||
+ input_set_abs_params(input_dev,
|
||||
ABS_MT_TOUCH_MAJOR,
|
||||
0, features->x_max, 0, 0);
|
||||
- input_set_abs_params(input_dev,
|
||||
+ input_set_abs_params(input_dev,
|
||||
ABS_MT_TOUCH_MINOR,
|
||||
0, features->y_max, 0, 0);
|
||||
+ } else {
|
||||
+ __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
|
||||
+ __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
|
||||
+ flags = 0;
|
||||
+ }
|
||||
+ input_mt_init_slots(input_dev, features->touch_max, flags);
|
||||
} else {
|
||||
- __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
|
||||
- __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
|
||||
- flags = 0;
|
||||
+ /* buttons/keys only interface */
|
||||
+ __clear_bit(ABS_X, input_dev->absbit);
|
||||
+ __clear_bit(ABS_Y, input_dev->absbit);
|
||||
+ __clear_bit(BTN_TOUCH, input_dev->keybit);
|
||||
}
|
||||
- input_mt_init_slots(input_dev, features->touch_max, flags);
|
||||
} else if (features->device_type == BTN_TOOL_PEN) {
|
||||
+ __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
|
||||
__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
|
||||
__set_bit(BTN_TOOL_PEN, input_dev->keybit);
|
||||
__set_bit(BTN_STYLUS, input_dev->keybit);
|
||||
@@ -2194,6 +2211,17 @@ static const struct wacom_features wacom_features_0x300 =
|
||||
static const struct wacom_features wacom_features_0x301 =
|
||||
{ "Wacom Bamboo One M", WACOM_PKGLEN_BBPEN, 21648, 13530, 1023,
|
||||
31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
|
||||
+static const struct wacom_features wacom_features_0x302 =
|
||||
+ { "Wacom Intuos PT S", WACOM_PKGLEN_BBPEN, 15200, 9500, 1023,
|
||||
+ 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
|
||||
+ .touch_max = 16 };
|
||||
+static const struct wacom_features wacom_features_0x303 =
|
||||
+ { "Wacom Intuos PT M", WACOM_PKGLEN_BBPEN, 21600, 13500, 1023,
|
||||
+ 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
|
||||
+ .touch_max = 16 };
|
||||
+static const struct wacom_features wacom_features_0x30E =
|
||||
+ { "Wacom Intuos S", WACOM_PKGLEN_BBPEN, 15200, 9500, 1023,
|
||||
+ 31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
|
||||
static const struct wacom_features wacom_features_0x6004 =
|
||||
{ "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
|
||||
0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
|
||||
@@ -2329,6 +2357,9 @@ const struct usb_device_id wacom_ids[] = {
|
||||
{ USB_DEVICE_WACOM(0x10D) },
|
||||
{ USB_DEVICE_WACOM(0x300) },
|
||||
{ USB_DEVICE_WACOM(0x301) },
|
||||
+ { USB_DEVICE_DETAILED(0x302, USB_CLASS_HID, 0, 0) },
|
||||
+ { USB_DEVICE_DETAILED(0x303, USB_CLASS_HID, 0, 0) },
|
||||
+ { USB_DEVICE_DETAILED(0x30E, USB_CLASS_HID, 0, 0) },
|
||||
{ USB_DEVICE_WACOM(0x304) },
|
||||
{ USB_DEVICE_DETAILED(0x314, USB_CLASS_HID, 0, 0) },
|
||||
{ USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) },
|
||||
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
|
||||
index fd23a37..854cceb 100644
|
||||
--- a/drivers/input/tablet/wacom_wac.h
|
||||
+++ b/drivers/input/tablet/wacom_wac.h
|
||||
@@ -54,6 +54,7 @@
|
||||
#define WACOM_REPORT_TPCST 16
|
||||
#define WACOM_REPORT_TPC1FGE 18
|
||||
#define WACOM_REPORT_24HDT 1
|
||||
+#define WACOM_REPORT_WL 128
|
||||
|
||||
/* device quirks */
|
||||
#define WACOM_QUIRK_MULTI_INPUT 0x0001
|
||||
@@ -81,6 +82,7 @@ enum {
|
||||
INTUOSPS,
|
||||
INTUOSPM,
|
||||
INTUOSPL,
|
||||
+ INTUOSHT,
|
||||
WACOM_21UX2,
|
||||
WACOM_22HD,
|
||||
DTK,
|
||||
--
|
||||
1.8.4.2
|
||||
|
@ -1,155 +0,0 @@
|
||||
Bugzilla: 1046238
|
||||
Upstream-status: Queued for 3.14
|
||||
|
||||
From 961794a00eab03f4344b7d5e825e8e789e55da87 Mon Sep 17 00:00:00 2001
|
||||
From: Ping Cheng <pinglinux@gmail.com>
|
||||
Date: Thu, 5 Dec 2013 12:54:53 -0800
|
||||
Subject: [PATCH] Input: wacom - add reporting of SW_MUTE_DEVICE events
|
||||
|
||||
New Intuos series models added a hardware switch to turn touch
|
||||
data on/off. The state of the switch is reported periodically
|
||||
from the tablet. To report the state the driver will emit SW_MUTE_DEVICE
|
||||
events.
|
||||
|
||||
Reviewed_by: Chris Bagwell <chris@cnpbagwell.com>
|
||||
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
|
||||
Tested-by: Jason Gerecke <killertofu@gmail.com>
|
||||
Signed-off-by: Ping Cheng <pingc@wacom.com>
|
||||
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
||||
---
|
||||
drivers/input/tablet/wacom_sys.c | 12 ++++++++++++
|
||||
drivers/input/tablet/wacom_wac.c | 30 +++++++++++++++++++++++++++---
|
||||
drivers/input/tablet/wacom_wac.h | 5 +++++
|
||||
3 files changed, 44 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
|
||||
index 8318826..b16ebef 100644
|
||||
--- a/drivers/input/tablet/wacom_sys.c
|
||||
+++ b/drivers/input/tablet/wacom_sys.c
|
||||
@@ -1197,6 +1197,8 @@ static void wacom_wireless_work(struct work_struct *work)
|
||||
wacom_wac1->features.device_type = BTN_TOOL_PEN;
|
||||
snprintf(wacom_wac1->name, WACOM_NAME_MAX, "%s (WL) Pen",
|
||||
wacom_wac1->features.name);
|
||||
+ wacom_wac1->shared->touch_max = wacom_wac1->features.touch_max;
|
||||
+ wacom_wac1->shared->type = wacom_wac1->features.type;
|
||||
error = wacom_register_input(wacom1);
|
||||
if (error)
|
||||
goto fail;
|
||||
@@ -1218,6 +1220,10 @@ static void wacom_wireless_work(struct work_struct *work)
|
||||
error = wacom_register_input(wacom2);
|
||||
if (error)
|
||||
goto fail;
|
||||
+
|
||||
+ if (wacom_wac1->features.type == INTUOSHT &&
|
||||
+ wacom_wac1->features.touch_max)
|
||||
+ wacom_wac->shared->touch_input = wacom_wac2->input;
|
||||
}
|
||||
|
||||
error = wacom_initialize_battery(wacom);
|
||||
@@ -1396,6 +1402,12 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
|
||||
goto fail5;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ if (wacom_wac->features.type == INTUOSHT && wacom_wac->features.touch_max) {
|
||||
+ if (wacom_wac->features.device_type == BTN_TOOL_FINGER)
|
||||
+ wacom_wac->shared->touch_input = wacom_wac->input;
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
|
||||
fail5: wacom_destroy_leds(wacom);
|
||||
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
|
||||
index 7655088..048e5b3 100644
|
||||
--- a/drivers/input/tablet/wacom_wac.c
|
||||
+++ b/drivers/input/tablet/wacom_wac.c
|
||||
@@ -1219,13 +1219,23 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom)
|
||||
|
||||
static int wacom_bpt_pen(struct wacom_wac *wacom)
|
||||
{
|
||||
+ struct wacom_features *features = &wacom->features;
|
||||
struct input_dev *input = wacom->input;
|
||||
unsigned char *data = wacom->data;
|
||||
int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
|
||||
|
||||
- if (data[0] != WACOM_REPORT_PENABLED)
|
||||
+ if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_USB)
|
||||
return 0;
|
||||
|
||||
+ if (data[0] == WACOM_REPORT_USB) {
|
||||
+ if (features->type == INTUOSHT && features->touch_max) {
|
||||
+ input_report_switch(wacom->shared->touch_input,
|
||||
+ SW_MUTE_DEVICE, data[8] & 0x40);
|
||||
+ input_sync(wacom->shared->touch_input);
|
||||
+ }
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
prox = (data[1] & 0x20) == 0x20;
|
||||
|
||||
/*
|
||||
@@ -1258,8 +1268,8 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
|
||||
* touching and applying pressure; do not report negative
|
||||
* distance.
|
||||
*/
|
||||
- if (data[8] <= wacom->features.distance_max)
|
||||
- d = wacom->features.distance_max - data[8];
|
||||
+ if (data[8] <= features->distance_max)
|
||||
+ d = features->distance_max - data[8];
|
||||
|
||||
pen = data[1] & 0x01;
|
||||
btn1 = data[1] & 0x02;
|
||||
@@ -1310,6 +1320,13 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
|
||||
if (connected) {
|
||||
int pid, battery;
|
||||
|
||||
+ if ((wacom->shared->type == INTUOSHT) &&
|
||||
+ wacom->shared->touch_max) {
|
||||
+ input_report_switch(wacom->shared->touch_input,
|
||||
+ SW_MUTE_DEVICE, data[5] & 0x40);
|
||||
+ input_sync(wacom->shared->touch_input);
|
||||
+ }
|
||||
+
|
||||
pid = get_unaligned_be16(&data[6]);
|
||||
battery = data[5] & 0x3f;
|
||||
if (wacom->pid != pid) {
|
||||
@@ -1779,6 +1796,13 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
|
||||
break;
|
||||
|
||||
case INTUOSHT:
|
||||
+ if (features->touch_max &&
|
||||
+ features->device_type == BTN_TOOL_FINGER) {
|
||||
+ input_dev->evbit[0] |= BIT_MASK(EV_SW);
|
||||
+ __set_bit(SW_MUTE_DEVICE, input_dev->swbit);
|
||||
+ }
|
||||
+ /* fall through */
|
||||
+
|
||||
case BAMBOO_PT:
|
||||
__clear_bit(ABS_MISC, input_dev->absbit);
|
||||
|
||||
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
|
||||
index 854cceb..3600cf7 100644
|
||||
--- a/drivers/input/tablet/wacom_wac.h
|
||||
+++ b/drivers/input/tablet/wacom_wac.h
|
||||
@@ -55,6 +55,7 @@
|
||||
#define WACOM_REPORT_TPC1FGE 18
|
||||
#define WACOM_REPORT_24HDT 1
|
||||
#define WACOM_REPORT_WL 128
|
||||
+#define WACOM_REPORT_USB 192
|
||||
|
||||
/* device quirks */
|
||||
#define WACOM_QUIRK_MULTI_INPUT 0x0001
|
||||
@@ -131,6 +132,10 @@ struct wacom_features {
|
||||
struct wacom_shared {
|
||||
bool stylus_in_proximity;
|
||||
bool touch_down;
|
||||
+ /* for wireless device to access USB interfaces */
|
||||
+ unsigned touch_max;
|
||||
+ int type;
|
||||
+ struct input_dev *touch_input;
|
||||
};
|
||||
|
||||
struct wacom_wac {
|
||||
--
|
||||
1.8.4.2
|
||||
|
@ -1,348 +0,0 @@
|
||||
Bugzilla: 953211
|
||||
Upstream-status: Queued for 3.14
|
||||
|
||||
From 4081924b7b6ce876fdb8e8049f1a5ba9c1496483 Mon Sep 17 00:00:00 2001
|
||||
From: Yunkang Tang <tommywill2011@gmail.com>
|
||||
Date: Thu, 26 Dec 2013 14:54:19 -0800
|
||||
Subject: [PATCH] Input: ALPS - add support for "Dolphin" devices
|
||||
|
||||
This adds support for another flavor of ALPS protocol used in newer
|
||||
"Dolphin" devices.
|
||||
|
||||
Signed-off-by: Yunkang Tang <yunkang.tang@cn.alps.com>
|
||||
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
|
||||
---
|
||||
drivers/input/mouse/alps.c | 214 ++++++++++++++++++++++++++++++++++++---------
|
||||
drivers/input/mouse/alps.h | 7 +-
|
||||
2 files changed, 179 insertions(+), 42 deletions(-)
|
||||
|
||||
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
|
||||
index 5cf62e3..fb15c64 100644
|
||||
--- a/drivers/input/mouse/alps.c
|
||||
+++ b/drivers/input/mouse/alps.c
|
||||
@@ -277,6 +277,57 @@ static void alps_process_packet_v1_v2(struct psmouse *psmouse)
|
||||
}
|
||||
|
||||
/*
|
||||
+ * Process bitmap data for V5 protocols. Return value is null.
|
||||
+ *
|
||||
+ * The bitmaps don't have enough data to track fingers, so this function
|
||||
+ * only generates points representing a bounding box of at most two contacts.
|
||||
+ * These two points are returned in x1, y1, x2, and y2.
|
||||
+ */
|
||||
+static void alps_process_bitmap_dolphin(struct alps_data *priv,
|
||||
+ struct alps_fields *fields,
|
||||
+ int *x1, int *y1, int *x2, int *y2)
|
||||
+{
|
||||
+ int box_middle_x, box_middle_y;
|
||||
+ unsigned int x_map, y_map;
|
||||
+ unsigned char start_bit, end_bit;
|
||||
+ unsigned char x_msb, x_lsb, y_msb, y_lsb;
|
||||
+
|
||||
+ x_map = fields->x_map;
|
||||
+ y_map = fields->y_map;
|
||||
+
|
||||
+ if (!x_map || !y_map)
|
||||
+ return;
|
||||
+
|
||||
+ /* Get Most-significant and Least-significant bit */
|
||||
+ x_msb = fls(x_map);
|
||||
+ x_lsb = ffs(x_map);
|
||||
+ y_msb = fls(y_map);
|
||||
+ y_lsb = ffs(y_map);
|
||||
+
|
||||
+ /* Most-significant bit should never exceed max sensor line number */
|
||||
+ if (x_msb > priv->x_bits || y_msb > priv->y_bits)
|
||||
+ return;
|
||||
+
|
||||
+ *x1 = *y1 = *x2 = *y2 = 0;
|
||||
+
|
||||
+ if (fields->fingers > 1) {
|
||||
+ start_bit = priv->x_bits - x_msb;
|
||||
+ end_bit = priv->x_bits - x_lsb;
|
||||
+ box_middle_x = (priv->x_max * (start_bit + end_bit)) /
|
||||
+ (2 * (priv->x_bits - 1));
|
||||
+
|
||||
+ start_bit = y_lsb - 1;
|
||||
+ end_bit = y_msb - 1;
|
||||
+ box_middle_y = (priv->y_max * (start_bit + end_bit)) /
|
||||
+ (2 * (priv->y_bits - 1));
|
||||
+ *x1 = fields->x;
|
||||
+ *y1 = fields->y;
|
||||
+ *x2 = 2 * box_middle_x - *x1;
|
||||
+ *y2 = 2 * box_middle_y - *y1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* Process bitmap data from v3 and v4 protocols. Returns the number of
|
||||
* fingers detected. A return value of 0 means at least one of the
|
||||
* bitmaps was empty.
|
||||
@@ -481,7 +532,8 @@ static void alps_decode_buttons_v3(struct alps_fields *f, unsigned char *p)
|
||||
f->ts_middle = !!(p[3] & 0x40);
|
||||
}
|
||||
|
||||
-static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p)
|
||||
+static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p,
|
||||
+ struct psmouse *psmouse)
|
||||
{
|
||||
f->first_mp = !!(p[4] & 0x40);
|
||||
f->is_mp = !!(p[0] & 0x40);
|
||||
@@ -502,48 +554,61 @@ static void alps_decode_pinnacle(struct alps_fields *f, unsigned char *p)
|
||||
alps_decode_buttons_v3(f, p);
|
||||
}
|
||||
|
||||
-static void alps_decode_rushmore(struct alps_fields *f, unsigned char *p)
|
||||
+static void alps_decode_rushmore(struct alps_fields *f, unsigned char *p,
|
||||
+ struct psmouse *psmouse)
|
||||
{
|
||||
- alps_decode_pinnacle(f, p);
|
||||
+ alps_decode_pinnacle(f, p, psmouse);
|
||||
|
||||
f->x_map |= (p[5] & 0x10) << 11;
|
||||
f->y_map |= (p[5] & 0x20) << 6;
|
||||
}
|
||||
|
||||
-static void alps_decode_dolphin(struct alps_fields *f, unsigned char *p)
|
||||
+static void alps_decode_dolphin(struct alps_fields *f, unsigned char *p,
|
||||
+ struct psmouse *psmouse)
|
||||
{
|
||||
+ u64 palm_data = 0;
|
||||
+ struct alps_data *priv = psmouse->private;
|
||||
+
|
||||
f->first_mp = !!(p[0] & 0x02);
|
||||
f->is_mp = !!(p[0] & 0x20);
|
||||
|
||||
- f->fingers = ((p[0] & 0x6) >> 1 |
|
||||
+ if (!f->is_mp) {
|
||||
+ f->x = ((p[1] & 0x7f) | ((p[4] & 0x0f) << 7));
|
||||
+ f->y = ((p[2] & 0x7f) | ((p[4] & 0xf0) << 3));
|
||||
+ f->z = (p[0] & 4) ? 0 : p[5] & 0x7f;
|
||||
+ alps_decode_buttons_v3(f, p);
|
||||
+ } else {
|
||||
+ f->fingers = ((p[0] & 0x6) >> 1 |
|
||||
(p[0] & 0x10) >> 2);
|
||||
- f->x_map = ((p[2] & 0x60) >> 5) |
|
||||
- ((p[4] & 0x7f) << 2) |
|
||||
- ((p[5] & 0x7f) << 9) |
|
||||
- ((p[3] & 0x07) << 16) |
|
||||
- ((p[3] & 0x70) << 15) |
|
||||
- ((p[0] & 0x01) << 22);
|
||||
- f->y_map = (p[1] & 0x7f) |
|
||||
- ((p[2] & 0x1f) << 7);
|
||||
-
|
||||
- f->x = ((p[1] & 0x7f) | ((p[4] & 0x0f) << 7));
|
||||
- f->y = ((p[2] & 0x7f) | ((p[4] & 0xf0) << 3));
|
||||
- f->z = (p[0] & 4) ? 0 : p[5] & 0x7f;
|
||||
|
||||
- alps_decode_buttons_v3(f, p);
|
||||
+ palm_data = (p[1] & 0x7f) |
|
||||
+ ((p[2] & 0x7f) << 7) |
|
||||
+ ((p[4] & 0x7f) << 14) |
|
||||
+ ((p[5] & 0x7f) << 21) |
|
||||
+ ((p[3] & 0x07) << 28) |
|
||||
+ (((u64)p[3] & 0x70) << 27) |
|
||||
+ (((u64)p[0] & 0x01) << 34);
|
||||
+
|
||||
+ /* Y-profile is stored in P(0) to p(n-1), n = y_bits; */
|
||||
+ f->y_map = palm_data & (BIT(priv->y_bits) - 1);
|
||||
+
|
||||
+ /* X-profile is stored in p(n) to p(n+m-1), m = x_bits; */
|
||||
+ f->x_map = (palm_data >> priv->y_bits) &
|
||||
+ (BIT(priv->x_bits) - 1);
|
||||
+ }
|
||||
}
|
||||
|
||||
-static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
|
||||
+static void alps_process_touchpad_packet_v3_v5(struct psmouse *psmouse)
|
||||
{
|
||||
struct alps_data *priv = psmouse->private;
|
||||
unsigned char *packet = psmouse->packet;
|
||||
struct input_dev *dev = psmouse->dev;
|
||||
struct input_dev *dev2 = priv->dev2;
|
||||
int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
|
||||
- int fingers = 0, bmap_fingers;
|
||||
- struct alps_fields f;
|
||||
+ int fingers = 0, bmap_fn;
|
||||
+ struct alps_fields f = {0};
|
||||
|
||||
- priv->decode_fields(&f, packet);
|
||||
+ priv->decode_fields(&f, packet, psmouse);
|
||||
|
||||
/*
|
||||
* There's no single feature of touchpad position and bitmap packets
|
||||
@@ -560,19 +625,38 @@ static void alps_process_touchpad_packet_v3(struct psmouse *psmouse)
|
||||
*/
|
||||
if (f.is_mp) {
|
||||
fingers = f.fingers;
|
||||
- bmap_fingers = alps_process_bitmap(priv,
|
||||
- f.x_map, f.y_map,
|
||||
- &x1, &y1, &x2, &y2);
|
||||
-
|
||||
- /*
|
||||
- * We shouldn't report more than one finger if
|
||||
- * we don't have two coordinates.
|
||||
- */
|
||||
- if (fingers > 1 && bmap_fingers < 2)
|
||||
- fingers = bmap_fingers;
|
||||
-
|
||||
- /* Now process position packet */
|
||||
- priv->decode_fields(&f, priv->multi_data);
|
||||
+ if (priv->proto_version == ALPS_PROTO_V3) {
|
||||
+ bmap_fn = alps_process_bitmap(priv, f.x_map,
|
||||
+ f.y_map, &x1, &y1,
|
||||
+ &x2, &y2);
|
||||
+
|
||||
+ /*
|
||||
+ * We shouldn't report more than one finger if
|
||||
+ * we don't have two coordinates.
|
||||
+ */
|
||||
+ if (fingers > 1 && bmap_fn < 2)
|
||||
+ fingers = bmap_fn;
|
||||
+
|
||||
+ /* Now process position packet */
|
||||
+ priv->decode_fields(&f, priv->multi_data,
|
||||
+ psmouse);
|
||||
+ } else {
|
||||
+ /*
|
||||
+ * Because Dolphin uses position packet's
|
||||
+ * coordinate data as Pt1 and uses it to
|
||||
+ * calculate Pt2, so we need to do position
|
||||
+ * packet decode first.
|
||||
+ */
|
||||
+ priv->decode_fields(&f, priv->multi_data,
|
||||
+ psmouse);
|
||||
+
|
||||
+ /*
|
||||
+ * Since Dolphin's finger number is reliable,
|
||||
+ * there is no need to compare with bmap_fn.
|
||||
+ */
|
||||
+ alps_process_bitmap_dolphin(priv, &f, &x1, &y1,
|
||||
+ &x2, &y2);
|
||||
+ }
|
||||
} else {
|
||||
priv->multi_packet = 0;
|
||||
}
|
||||
@@ -662,7 +746,7 @@ static void alps_process_packet_v3(struct psmouse *psmouse)
|
||||
return;
|
||||
}
|
||||
|
||||
- alps_process_touchpad_packet_v3(psmouse);
|
||||
+ alps_process_touchpad_packet_v3_v5(psmouse);
|
||||
}
|
||||
|
||||
static void alps_process_packet_v6(struct psmouse *psmouse)
|
||||
@@ -1709,6 +1793,52 @@ error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
+static int alps_dolphin_get_device_area(struct psmouse *psmouse,
|
||||
+ struct alps_data *priv)
|
||||
+{
|
||||
+ struct ps2dev *ps2dev = &psmouse->ps2dev;
|
||||
+ unsigned char param[4] = {0};
|
||||
+ int num_x_electrode, num_y_electrode;
|
||||
+
|
||||
+ if (alps_enter_command_mode(psmouse))
|
||||
+ return -1;
|
||||
+
|
||||
+ param[0] = 0x0a;
|
||||
+ if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_RESET_WRAP) ||
|
||||
+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETPOLL) ||
|
||||
+ ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETPOLL) ||
|
||||
+ ps2_command(ps2dev, ¶m[0], PSMOUSE_CMD_SETRATE) ||
|
||||
+ ps2_command(ps2dev, ¶m[0], PSMOUSE_CMD_SETRATE))
|
||||
+ return -1;
|
||||
+
|
||||
+ if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO))
|
||||
+ return -1;
|
||||
+
|
||||
+ /*
|
||||
+ * Dolphin's sensor line number is not fixed. It can be calculated
|
||||
+ * by adding the device's register value with DOLPHIN_PROFILE_X/YOFFSET.
|
||||
+ * Further more, we can get device's x_max and y_max by multiplying
|
||||
+ * sensor line number with DOLPHIN_COUNT_PER_ELECTRODE.
|
||||
+ *
|
||||
+ * e.g. When we get register's sensor_x = 11 & sensor_y = 8,
|
||||
+ * real sensor line number X = 11 + 8 = 19, and
|
||||
+ * real sensor line number Y = 8 + 1 = 9.
|
||||
+ * So, x_max = (19 - 1) * 64 = 1152, and
|
||||
+ * y_max = (9 - 1) * 64 = 512.
|
||||
+ */
|
||||
+ num_x_electrode = DOLPHIN_PROFILE_XOFFSET + (param[2] & 0x0F);
|
||||
+ num_y_electrode = DOLPHIN_PROFILE_YOFFSET + ((param[2] >> 4) & 0x0F);
|
||||
+ priv->x_bits = num_x_electrode;
|
||||
+ priv->y_bits = num_y_electrode;
|
||||
+ priv->x_max = (num_x_electrode - 1) * DOLPHIN_COUNT_PER_ELECTRODE;
|
||||
+ priv->y_max = (num_y_electrode - 1) * DOLPHIN_COUNT_PER_ELECTRODE;
|
||||
+
|
||||
+ if (alps_exit_command_mode(psmouse))
|
||||
+ return -1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int alps_hw_init_dolphin_v1(struct psmouse *psmouse)
|
||||
{
|
||||
struct ps2dev *ps2dev = &psmouse->ps2dev;
|
||||
@@ -1763,13 +1893,13 @@ static void alps_set_defaults(struct alps_data *priv)
|
||||
break;
|
||||
case ALPS_PROTO_V5:
|
||||
priv->hw_init = alps_hw_init_dolphin_v1;
|
||||
- priv->process_packet = alps_process_packet_v3;
|
||||
+ priv->process_packet = alps_process_touchpad_packet_v3_v5;
|
||||
priv->decode_fields = alps_decode_dolphin;
|
||||
priv->set_abs_params = alps_set_abs_params_mt;
|
||||
priv->nibble_commands = alps_v3_nibble_commands;
|
||||
priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
|
||||
priv->byte0 = 0xc8;
|
||||
- priv->mask0 = 0xc8;
|
||||
+ priv->mask0 = 0xd8;
|
||||
priv->flags = 0;
|
||||
priv->x_max = 1360;
|
||||
priv->y_max = 660;
|
||||
@@ -1845,11 +1975,13 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)
|
||||
if (alps_match_table(psmouse, priv, e7, ec) == 0) {
|
||||
return 0;
|
||||
} else if (e7[0] == 0x73 && e7[1] == 0x03 && e7[2] == 0x50 &&
|
||||
- ec[0] == 0x73 && ec[1] == 0x01) {
|
||||
+ ec[0] == 0x73 && (ec[1] == 0x01 || ec[1] == 0x02)) {
|
||||
priv->proto_version = ALPS_PROTO_V5;
|
||||
alps_set_defaults(priv);
|
||||
-
|
||||
- return 0;
|
||||
+ if (alps_dolphin_get_device_area(psmouse, priv))
|
||||
+ return -EIO;
|
||||
+ else
|
||||
+ return 0;
|
||||
} else if (ec[0] == 0x88 && ec[1] == 0x08) {
|
||||
priv->proto_version = ALPS_PROTO_V3;
|
||||
alps_set_defaults(priv);
|
||||
diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
|
||||
index 704f0f9..03f88b6 100644
|
||||
--- a/drivers/input/mouse/alps.h
|
||||
+++ b/drivers/input/mouse/alps.h
|
||||
@@ -19,6 +19,10 @@
|
||||
#define ALPS_PROTO_V5 5
|
||||
#define ALPS_PROTO_V6 6
|
||||
|
||||
+#define DOLPHIN_COUNT_PER_ELECTRODE 64
|
||||
+#define DOLPHIN_PROFILE_XOFFSET 8 /* x-electrode offset */
|
||||
+#define DOLPHIN_PROFILE_YOFFSET 1 /* y-electrode offset */
|
||||
+
|
||||
/**
|
||||
* struct alps_model_info - touchpad ID table
|
||||
* @signature: E7 response string to match.
|
||||
@@ -146,7 +150,8 @@ struct alps_data {
|
||||
|
||||
int (*hw_init)(struct psmouse *psmouse);
|
||||
void (*process_packet)(struct psmouse *psmouse);
|
||||
- void (*decode_fields)(struct alps_fields *f, unsigned char *p);
|
||||
+ void (*decode_fields)(struct alps_fields *f, unsigned char *p,
|
||||
+ struct psmouse *psmouse);
|
||||
void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1);
|
||||
|
||||
int prev_fin;
|
||||
--
|
||||
1.8.4.2
|
||||
|
@ -182,6 +182,7 @@ CONFIG_INFINIBAND_NES=m
|
||||
CONFIG_INFINIBAND_QIB=m
|
||||
CONFIG_INFINIBAND_QIB_DCA=y
|
||||
# CONFIG_INFINIBAND_OCRDMA is not set
|
||||
# CONFIG_INFINIBAND_USNIC is not set
|
||||
|
||||
#
|
||||
# Executable file formats
|
||||
@ -3200,6 +3201,7 @@ CONFIG_FB_EFI=y
|
||||
# CONFIG_FB_BROADSHEET is not set
|
||||
# CONFIG_FB_UDL is not set
|
||||
# CONFIG_FB_GOLDFISH is not set
|
||||
# CONFIG_FB_OPENCORES is not set
|
||||
|
||||
# CONFIG_FIRMWARE_EDID is not set
|
||||
|
||||
@ -4511,6 +4513,7 @@ CONFIG_THERMAL_GOV_FAIR_SHARE=y
|
||||
# CONFIG_THERMAL_GOV_USER_SPACE is not set
|
||||
CONFIG_THERMAL_GOV_STEP_WISE=y
|
||||
# CONFIG_THERMAL_EMULATION is not set
|
||||
# CONFIG_THERMAL_OF is not set
|
||||
# CONFIG_CPU_THERMAL is not set
|
||||
|
||||
CONFIG_INOTIFY=y
|
||||
@ -4772,6 +4775,7 @@ CONFIG_NOZOMI=m
|
||||
CONFIG_INPUT_APANEL=m
|
||||
CONFIG_INPUT_GP2A=m
|
||||
# CONFIG_INPUT_GPIO_TILT_POLLED is not set
|
||||
# CONFIG_INPUT_GPIO_BEEPER is not set
|
||||
|
||||
# CONFIG_INTEL_MENLOW is not set
|
||||
CONFIG_ENCLOSURE_SERVICES=m
|
||||
|
@ -450,6 +450,7 @@ CONFIG_PINCTRL_BAYTRAIL=y
|
||||
|
||||
# CONFIG_INTEL_POWERCLAMP is not set
|
||||
CONFIG_X86_PKG_TEMP_THERMAL=m
|
||||
CONFIG_ACPI_INT3403_THERMAL=m
|
||||
|
||||
CONFIG_VMWARE_VMCI=m
|
||||
CONFIG_VMWARE_VMCI_VSOCKETS=m
|
||||
|
@ -1,110 +0,0 @@
|
||||
Bugzilla: 1030802
|
||||
Upstream-status: http://www.mail-archive.com/linux-input@vger.kernel.org/msg07220.html
|
||||
|
||||
From e1c7fa5fbb6688bd464658ff8a93bdf23c442065 Mon Sep 17 00:00:00 2001
|
||||
From: Hans de Goede <hdegoede@redhat.com>
|
||||
Date: Mon, 9 Dec 2013 15:18:04 +0100
|
||||
Subject: [PATCH v2] elantech: Properly differentiate between clickpads and
|
||||
normal touchpads
|
||||
|
||||
The current assumption in the elantech driver that hw version 3 touchpads are
|
||||
never clickpads and hw version 4 touchpads are always clickpads is wrong.
|
||||
|
||||
There are several bug reports for this, ie:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1030802
|
||||
http://superuser.com/questions/619582/right-elantech-touchpad-button-not-working-in-linux
|
||||
|
||||
I've spend a couple of hours wading through various bugzillas,
|
||||
launchpads and forum posts to create a list of fw-versions and capabilities
|
||||
for different laptop models to find a good method to differentiate between
|
||||
clickpads and versions with separate hardware buttons.
|
||||
|
||||
Which shows that a device being a clickpad is reliable indicated by bit 12
|
||||
being set in the fw_version. I've included the gathered list inside the driver,
|
||||
so that we've this info at hand if we need to revisit this later.
|
||||
|
||||
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
||||
---
|
||||
drivers/input/mouse/elantech.c | 45 +++++++++++++++++++++++++++++++++++++++---
|
||||
1 file changed, 42 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
|
||||
index 597e9b8..ef1cf52 100644
|
||||
--- a/drivers/input/mouse/elantech.c
|
||||
+++ b/drivers/input/mouse/elantech.c
|
||||
@@ -486,6 +486,7 @@ static void elantech_input_sync_v4(struct psmouse *psmouse)
|
||||
unsigned char *packet = psmouse->packet;
|
||||
|
||||
input_report_key(dev, BTN_LEFT, packet[0] & 0x01);
|
||||
+ input_report_key(dev, BTN_RIGHT, packet[0] & 0x02);
|
||||
input_mt_report_pointer_emulation(dev, true);
|
||||
input_sync(dev);
|
||||
}
|
||||
@@ -984,6 +985,44 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,
|
||||
}
|
||||
|
||||
/*
|
||||
+ * Advertise INPUT_PROP_BUTTONPAD for clickpads. The testing of bit 12 in
|
||||
+ * fw_version for this is based on the following fw_version & caps table:
|
||||
+ *
|
||||
+ * Laptop-model: fw_version: caps: buttons:
|
||||
+ * Acer S3 0x461f00 10, 13, 0e clickpad
|
||||
+ * Acer S7-392 0x581f01 50, 17, 0d clickpad
|
||||
+ * Acer V5-131 0x461f02 01, 16, 0c clickpad
|
||||
+ * Acer V5-551 0x461f00 ? clickpad
|
||||
+ * Asus K53SV 0x450f01 78, 15, 0c 2 hw buttons
|
||||
+ * Asus G46VW 0x460f02 00, 18, 0c 2 hw buttons
|
||||
+ * Asus G750JX 0x360f00 00, 16, 0c 2 hw buttons
|
||||
+ * Asus UX31 0x361f00 20, 15, 0e clickpad
|
||||
+ * Asus UX32VD 0x361f02 00, 15, 0e clickpad
|
||||
+ * Avatar AVIU-145A2 0x361f00 ? clickpad
|
||||
+ * Gigabyte U2442 0x450f01 58, 17, 0c 2 hw buttons
|
||||
+ * Lenovo L430 0x350f02 b9, 15, 0c 2 hw buttons (*)
|
||||
+ * Samsung NF210 0x150b00 78, 14, 0a 2 hw buttons
|
||||
+ * Samsung NP770Z5E 0x575f01 10, 15, 0f clickpad
|
||||
+ * Samsung NP700Z5B 0x361f06 21, 15, 0f clickpad
|
||||
+ * Samsung NP900X3E-A02 0x575f03 ? clickpad
|
||||
+ * Samsung NP-QX410 0x851b00 19, 14, 0c clickpad
|
||||
+ * Samsung RC512 0x450f00 08, 15, 0c 2 hw buttons
|
||||
+ * Samsung RF710 0x450f00 ? 2 hw buttons
|
||||
+ * System76 Pangolin 0x250f01 ? 2 hw buttons
|
||||
+ * (*) + 3 trackpoint buttons
|
||||
+ */
|
||||
+static void elantech_set_buttonpad_prop(struct psmouse *psmouse)
|
||||
+{
|
||||
+ struct input_dev *dev = psmouse->dev;
|
||||
+ struct elantech_data *etd = psmouse->private;
|
||||
+
|
||||
+ if (etd->fw_version & 0x001000) {
|
||||
+ __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
|
||||
+ __clear_bit(BTN_RIGHT, dev->keybit);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* Set the appropriate event bits for the input subsystem
|
||||
*/
|
||||
static int elantech_set_input_params(struct psmouse *psmouse)
|
||||
@@ -1026,6 +1065,8 @@ static int elantech_set_input_params(struct psmouse *psmouse)
|
||||
__set_bit(INPUT_PROP_SEMI_MT, dev->propbit);
|
||||
/* fall through */
|
||||
case 3:
|
||||
+ if (etd->hw_version == 3)
|
||||
+ elantech_set_buttonpad_prop(psmouse);
|
||||
input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0);
|
||||
input_set_abs_params(dev, ABS_Y, y_min, y_max, 0, 0);
|
||||
if (etd->reports_pressure) {
|
||||
@@ -1047,9 +1088,7 @@ static int elantech_set_input_params(struct psmouse *psmouse)
|
||||
*/
|
||||
psmouse_warn(psmouse, "couldn't query resolution data.\n");
|
||||
}
|
||||
- /* v4 is clickpad, with only one button. */
|
||||
- __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit);
|
||||
- __clear_bit(BTN_RIGHT, dev->keybit);
|
||||
+ elantech_set_buttonpad_prop(psmouse);
|
||||
__set_bit(BTN_TOOL_QUADTAP, dev->keybit);
|
||||
/* For X to recognize me as touchpad. */
|
||||
input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0);
|
||||
--
|
||||
1.8.4.2
|
||||
|
34
kernel.spec
34
kernel.spec
@ -61,7 +61,7 @@ Summary: The Linux kernel
|
||||
# The rc snapshot level
|
||||
%define rcrev 0
|
||||
# The git snapshot level
|
||||
%define gitrev 8
|
||||
%define gitrev 9
|
||||
# Set rpm version accordingly
|
||||
%define rpmversion 3.%{upstream_sublevel}.0
|
||||
%endif
|
||||
@ -627,23 +627,15 @@ Patch25166: sunrpc-add-an-info-file-for-the-dummy-gssd-pipe.patch
|
||||
Patch25167: rpc_pipe-remove-the-clntXX-dir-if-creating-the-pipe-fails.patch
|
||||
Patch25168: rpc_pipe-fix-cleanup-of-dummy-gssd-directory-when-notification-fails.patch
|
||||
|
||||
#rhbz 1030802
|
||||
Patch25171: elantech-Properly-differentiate-between-clickpads-an.patch
|
||||
|
||||
#rhbz 1003167 1046238
|
||||
Patch25181: 0001-Input-wacom-make-sure-touch_max-is-set-for-touch-dev.patch
|
||||
Patch25182: 0002-Input-wacom-add-support-for-three-new-Intuos-devices.patch
|
||||
Patch25183: 0003-Input-wacom-add-reporting-of-SW_MUTE_DEVICE-events.patch
|
||||
|
||||
#rhbz 953211
|
||||
Patch25184: Input-ALPS-add-support-for-Dolphin-devices.patch
|
||||
|
||||
Patch25185: perf-plugin-dir.patch
|
||||
|
||||
Patch25186: peterz-printk-timestamp-fix.patch
|
||||
|
||||
Patch25187: revert-fsnotify-changes.patch
|
||||
|
||||
#rhbz 1057529
|
||||
Patch25188: 0001-usb-phy-Quiet-unable-to-find-transceiver-message.patch
|
||||
|
||||
# END OF PATCH DEFINITIONS
|
||||
|
||||
%endif
|
||||
@ -1293,17 +1285,6 @@ ApplyPatch rpc_pipe-remove-the-clntXX-dir-if-creating-the-pipe-fails.patch
|
||||
ApplyPatch sunrpc-add-an-info-file-for-the-dummy-gssd-pipe.patch
|
||||
ApplyPatch rpc_pipe-fix-cleanup-of-dummy-gssd-directory-when-notification-fails.patch
|
||||
|
||||
#rhbz 1030802
|
||||
ApplyPatch elantech-Properly-differentiate-between-clickpads-an.patch
|
||||
|
||||
#rhbz 1003167 1046238
|
||||
ApplyPatch 0001-Input-wacom-make-sure-touch_max-is-set-for-touch-dev.patch
|
||||
ApplyPatch 0002-Input-wacom-add-support-for-three-new-Intuos-devices.patch
|
||||
ApplyPatch 0003-Input-wacom-add-reporting-of-SW_MUTE_DEVICE-events.patch
|
||||
|
||||
#rhbz 953211
|
||||
ApplyPatch Input-ALPS-add-support-for-Dolphin-devices.patch
|
||||
|
||||
ApplyPatch perf-plugin-dir.patch
|
||||
|
||||
ApplyPatch peterz-printk-timestamp-fix.patch
|
||||
@ -1312,6 +1293,9 @@ ApplyPatch peterz-printk-timestamp-fix.patch
|
||||
# Revert them until they're worked out upstream
|
||||
ApplyPatch revert-fsnotify-changes.patch
|
||||
|
||||
# rhbz 1057529
|
||||
ApplyPatch 0001-usb-phy-Quiet-unable-to-find-transceiver-message.patch
|
||||
|
||||
# END OF PATCH APPLICATIONS
|
||||
|
||||
%endif
|
||||
@ -2091,6 +2075,10 @@ fi
|
||||
# ||----w |
|
||||
# || ||
|
||||
%changelog
|
||||
* Sat Jan 25 2014 Josh Boyer <jwboyer@fedoraproject.org> - 3.14.0-0.rc0.git9.1
|
||||
- Linux v3.13-6058-g2d08cd0
|
||||
- Quiet incorrect usb phy error (rhbz 1057529)
|
||||
|
||||
* Sat Jan 25 2014 Ville Skyttä <ville.skytta@iki.fi>
|
||||
- Own the /lib/modules dir.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user