|
|
a8a466 |
centosplus patch (bug#10447)
|
|
|
a8a466 |
support for touchpad and fn key support for MacBookPro 12,1
|
|
|
a8a466 |
|
|
|
a8a466 |
https://kernel.googlesource.com/pub/scm/linux/kernel/git/groeck/linux-staging/+/dbe08116b87cdc2217f11a78b5b70e29068b7efd%5E1..dbe08116b87cdc2217f11a78b5b70e29068b7efd/
|
|
|
a8a466 |
|
|
|
a8a466 |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
|
|
|
a8a466 |
|
|
|
a8a466 |
Pull input fixes from Dmitry Torokhov:
|
|
|
a8a466 |
"The main change is support for keyboards and touchpads found in 2015
|
|
|
a8a466 |
editions of Macbooks"
|
|
|
a8a466 |
|
|
|
a8a466 |
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
|
|
|
a8a466 |
Revert "Input: zforce - don't overwrite the stack"
|
|
|
a8a466 |
Input: bcm5974 - add support for the 2015 Macbook Pro
|
|
|
a8a466 |
HID: apple: Add support for the 2015 Macbook Pro
|
|
|
a8a466 |
Input: bcm5974 - prepare for a new trackpad generation
|
|
|
a8a466 |
Input: synaptics - dump ext10 capabilities as well
|
|
|
a8a466 |
|
|
|
a8a466 |
Applied-by Akemi Yagi <toracat@centos.org>
|
|
|
a8a466 |
|
|
|
a8a466 |
--- a/drivers/hid/hid-apple.c 2016-01-23 00:53:07.000000000 -0800
|
|
|
a8a466 |
+++ b/drivers/hid/hid-apple.c 2016-03-08 12:41:27.147368677 -0800
|
|
|
a8a466 |
@@ -552,6 +552,12 @@ static const struct hid_device_id apple_
|
|
|
a8a466 |
.driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
|
|
|
a8a466 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS),
|
|
|
a8a466 |
.driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
|
|
|
a8a466 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI),
|
|
|
a8a466 |
+ .driver_data = APPLE_HAS_FN },
|
|
|
a8a466 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO),
|
|
|
a8a466 |
+ .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD },
|
|
|
a8a466 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS),
|
|
|
a8a466 |
+ .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS },
|
|
|
a8a466 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI),
|
|
|
a8a466 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
|
|
a8a466 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO),
|
|
|
a8a466 |
--- a/drivers/hid/hid-core.c 2016-01-23 00:53:07.000000000 -0800
|
|
|
a8a466 |
+++ b/drivers/hid/hid-core.c 2016-03-08 12:45:44.846880469 -0800
|
|
|
a8a466 |
@@ -1643,6 +1643,9 @@ static const struct hid_device_id hid_ha
|
|
|
a8a466 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI) },
|
|
|
a8a466 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ISO) },
|
|
|
a8a466 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS) },
|
|
|
a8a466 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI) },
|
|
|
a8a466 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO) },
|
|
|
a8a466 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS) },
|
|
|
a8a466 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
|
|
|
a8a466 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
|
|
|
a8a466 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
|
|
|
a8a466 |
@@ -2284,6 +2287,9 @@ static const struct hid_device_id hid_mo
|
|
|
a8a466 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI) },
|
|
|
a8a466 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ISO) },
|
|
|
a8a466 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS) },
|
|
|
a8a466 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI) },
|
|
|
a8a466 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO) },
|
|
|
a8a466 |
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS) },
|
|
|
a8a466 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
|
|
|
a8a466 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
|
|
|
a8a466 |
{ }
|
|
|
a8a466 |
--- a/drivers/hid/hid-ids.h 2016-01-23 00:53:07.000000000 -0800
|
|
|
a8a466 |
+++ b/drivers/hid/hid-ids.h 2016-03-08 12:48:25.532198900 -0800
|
|
|
a8a466 |
@@ -138,6 +138,9 @@
|
|
|
a8a466 |
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI 0x0290
|
|
|
a8a466 |
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO 0x0291
|
|
|
a8a466 |
#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS 0x0292
|
|
|
a8a466 |
+#define USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI 0x0272
|
|
|
a8a466 |
+#define USB_DEVICE_ID_APPLE_WELLSPRING9_ISO 0x0273
|
|
|
a8a466 |
+#define USB_DEVICE_ID_APPLE_WELLSPRING9_JIS 0x0274
|
|
|
a8a466 |
#define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a
|
|
|
a8a466 |
#define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b
|
|
|
a8a466 |
#define USB_DEVICE_ID_APPLE_IRCONTROL 0x8240
|
|
|
a8a466 |
--- a/drivers/input/mouse/bcm5974.c 2016-01-23 00:53:07.000000000 -0800
|
|
|
a8a466 |
+++ b/drivers/input/mouse/bcm5974.c 2016-03-08 13:37:14.906154047 -0800
|
|
|
a8a466 |
@@ -2,6 +2,7 @@
|
|
|
a8a466 |
* Apple USB BCM5974 (Macbook Air and Penryn Macbook Pro) multitouch driver
|
|
|
a8a466 |
*
|
|
|
a8a466 |
* Copyright (C) 2008 Henrik Rydberg (rydberg@euromail.se)
|
|
|
a8a466 |
+ * Copyright (C) 2015 John Horan (knasher@gmail.com)
|
|
|
a8a466 |
*
|
|
|
a8a466 |
* The USB initialization and package decoding was made by
|
|
|
a8a466 |
* Scott Shawcroft as part of the touchd user-space driver project:
|
|
|
a8a466 |
@@ -92,6 +93,10 @@
|
|
|
a8a466 |
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI 0x0290
|
|
|
a8a466 |
#define USB_DEVICE_ID_APPLE_WELLSPRING8_ISO 0x0291
|
|
|
a8a466 |
#define USB_DEVICE_ID_APPLE_WELLSPRING8_JIS 0x0292
|
|
|
a8a466 |
+/* MacbookPro12,1 (2015) */
|
|
|
a8a466 |
+#define USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI 0x0272
|
|
|
a8a466 |
+#define USB_DEVICE_ID_APPLE_WELLSPRING9_ISO 0x0273
|
|
|
a8a466 |
+#define USB_DEVICE_ID_APPLE_WELLSPRING9_JIS 0x0274
|
|
|
a8a466 |
|
|
|
a8a466 |
#define BCM5974_DEVICE(prod) { \
|
|
|
a8a466 |
.match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \
|
|
|
a8a466 |
@@ -153,6 +158,10 @@ static const struct usb_device_id bcm597
|
|
|
a8a466 |
BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI),
|
|
|
a8a466 |
BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING8_ISO),
|
|
|
a8a466 |
BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING8_JIS),
|
|
|
a8a466 |
+ /* MacbookPro12,1 */
|
|
|
a8a466 |
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI),
|
|
|
a8a466 |
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING9_ISO),
|
|
|
a8a466 |
+ BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING9_JIS),
|
|
|
a8a466 |
/* Terminating entry */
|
|
|
a8a466 |
{}
|
|
|
a8a466 |
};
|
|
|
a8a466 |
@@ -181,21 +190,47 @@ struct bt_data {
|
|
|
a8a466 |
enum tp_type {
|
|
|
a8a466 |
TYPE1, /* plain trackpad */
|
|
|
a8a466 |
TYPE2, /* button integrated in trackpad */
|
|
|
a8a466 |
- TYPE3 /* additional header fields since June 2013 */
|
|
|
a8a466 |
+ TYPE3, /* additional header fields since June 2013 */
|
|
|
a8a466 |
+ TYPE4 /* additional header field for pressure data */
|
|
|
a8a466 |
};
|
|
|
a8a466 |
|
|
|
a8a466 |
/* trackpad finger data offsets, le16-aligned */
|
|
|
a8a466 |
-#define FINGER_TYPE1 (13 * sizeof(__le16))
|
|
|
a8a466 |
-#define FINGER_TYPE2 (15 * sizeof(__le16))
|
|
|
a8a466 |
-#define FINGER_TYPE3 (19 * sizeof(__le16))
|
|
|
a8a466 |
+#define HEADER_TYPE1 (13 * sizeof(__le16))
|
|
|
a8a466 |
+#define HEADER_TYPE2 (15 * sizeof(__le16))
|
|
|
a8a466 |
+#define HEADER_TYPE3 (19 * sizeof(__le16))
|
|
|
a8a466 |
+#define HEADER_TYPE4 (23 * sizeof(__le16))
|
|
|
a8a466 |
|
|
|
a8a466 |
/* trackpad button data offsets */
|
|
|
a8a466 |
+#define BUTTON_TYPE1 0
|
|
|
a8a466 |
#define BUTTON_TYPE2 15
|
|
|
a8a466 |
#define BUTTON_TYPE3 23
|
|
|
a8a466 |
+#define BUTTON_TYPE4 31
|
|
|
a8a466 |
|
|
|
a8a466 |
/* list of device capability bits */
|
|
|
a8a466 |
#define HAS_INTEGRATED_BUTTON 1
|
|
|
a8a466 |
|
|
|
a8a466 |
+/* trackpad finger data block size */
|
|
|
a8a466 |
+#define FSIZE_TYPE1 (14 * sizeof(__le16))
|
|
|
a8a466 |
+#define FSIZE_TYPE2 (14 * sizeof(__le16))
|
|
|
a8a466 |
+#define FSIZE_TYPE3 (14 * sizeof(__le16))
|
|
|
a8a466 |
+#define FSIZE_TYPE4 (15 * sizeof(__le16))
|
|
|
a8a466 |
+
|
|
|
a8a466 |
+/* offset from header to finger struct */
|
|
|
a8a466 |
+#define DELTA_TYPE1 (0 * sizeof(__le16))
|
|
|
a8a466 |
+#define DELTA_TYPE2 (0 * sizeof(__le16))
|
|
|
a8a466 |
+#define DELTA_TYPE3 (0 * sizeof(__le16))
|
|
|
a8a466 |
+#define DELTA_TYPE4 (1 * sizeof(__le16))
|
|
|
a8a466 |
+
|
|
|
a8a466 |
+/* usb control message mode switch data */
|
|
|
a8a466 |
+#define USBMSG_TYPE1 8, 0x300, 0, 0, 0x1, 0x8
|
|
|
a8a466 |
+#define USBMSG_TYPE2 8, 0x300, 0, 0, 0x1, 0x8
|
|
|
a8a466 |
+#define USBMSG_TYPE3 8, 0x300, 0, 0, 0x1, 0x8
|
|
|
a8a466 |
+#define USBMSG_TYPE4 2, 0x302, 2, 1, 0x1, 0x0
|
|
|
a8a466 |
+
|
|
|
a8a466 |
+/* Wellspring initialization constants */
|
|
|
a8a466 |
+#define BCM5974_WELLSPRING_MODE_READ_REQUEST_ID 1
|
|
|
a8a466 |
+#define BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID 9
|
|
|
a8a466 |
+
|
|
|
a8a466 |
/* trackpad finger structure, le16-aligned */
|
|
|
a8a466 |
struct tp_finger {
|
|
|
a8a466 |
__le16 origin; /* zero when switching track finger */
|
|
|
a8a466 |
@@ -208,14 +243,13 @@ struct tp_finger {
|
|
|
a8a466 |
__le16 orientation; /* 16384 when point, else 15 bit angle */
|
|
|
a8a466 |
__le16 touch_major; /* touch area, major axis */
|
|
|
a8a466 |
__le16 touch_minor; /* touch area, minor axis */
|
|
|
a8a466 |
- __le16 unused[3]; /* zeros */
|
|
|
a8a466 |
+ __le16 unused[2]; /* zeros */
|
|
|
a8a466 |
+ __le16 pressure; /* pressure on forcetouch touchpad */
|
|
|
a8a466 |
__le16 multi; /* one finger: varies, more fingers: constant */
|
|
|
a8a466 |
} __attribute__((packed,aligned(2)));
|
|
|
a8a466 |
|
|
|
a8a466 |
/* trackpad finger data size, empirically at least ten fingers */
|
|
|
a8a466 |
#define MAX_FINGERS 16
|
|
|
a8a466 |
-#define SIZEOF_FINGER sizeof(struct tp_finger)
|
|
|
a8a466 |
-#define SIZEOF_ALL_FINGERS (MAX_FINGERS * SIZEOF_FINGER)
|
|
|
a8a466 |
#define MAX_FINGER_ORIENTATION 16384
|
|
|
a8a466 |
|
|
|
a8a466 |
/* device-specific parameters */
|
|
|
a8a466 |
@@ -233,8 +267,17 @@ struct bcm5974_config {
|
|
|
a8a466 |
int bt_datalen; /* data length of the button interface */
|
|
|
a8a466 |
int tp_ep; /* the endpoint of the trackpad interface */
|
|
|
a8a466 |
enum tp_type tp_type; /* type of trackpad interface */
|
|
|
a8a466 |
- int tp_offset; /* offset to trackpad finger data */
|
|
|
a8a466 |
+ int tp_header; /* bytes in header block */
|
|
|
a8a466 |
int tp_datalen; /* data length of the trackpad interface */
|
|
|
a8a466 |
+ int tp_button; /* offset to button data */
|
|
|
a8a466 |
+ int tp_fsize; /* bytes in single finger block */
|
|
|
a8a466 |
+ int tp_delta; /* offset from header to finger struct */
|
|
|
a8a466 |
+ int um_size; /* usb control message length */
|
|
|
a8a466 |
+ int um_req_val; /* usb control message value */
|
|
|
a8a466 |
+ int um_req_idx; /* usb control message index */
|
|
|
a8a466 |
+ int um_switch_idx; /* usb control message mode switch index */
|
|
|
a8a466 |
+ int um_switch_on; /* usb control message mode switch on */
|
|
|
a8a466 |
+ int um_switch_off; /* usb control message mode switch off */
|
|
|
a8a466 |
struct bcm5974_param p; /* finger pressure limits */
|
|
|
a8a466 |
struct bcm5974_param w; /* finger width limits */
|
|
|
a8a466 |
struct bcm5974_param x; /* horizontal limits */
|
|
|
a8a466 |
@@ -260,6 +303,24 @@ struct bcm5974 {
|
|
|
a8a466 |
int slots[MAX_FINGERS]; /* slot assignments */
|
|
|
a8a466 |
};
|
|
|
a8a466 |
|
|
|
a8a466 |
+/* trackpad finger block data, le16-aligned */
|
|
|
a8a466 |
+static const struct tp_finger *get_tp_finger(const struct bcm5974 *dev, int i)
|
|
|
a8a466 |
+{
|
|
|
a8a466 |
+ const struct bcm5974_config *c = &dev->cfg;
|
|
|
a8a466 |
+ u8 *f_base = dev->tp_data + c->tp_header + c->tp_delta;
|
|
|
a8a466 |
+
|
|
|
a8a466 |
+ return (const struct tp_finger *)(f_base + i * c->tp_fsize);
|
|
|
a8a466 |
+}
|
|
|
a8a466 |
+
|
|
|
a8a466 |
+#define DATAFORMAT(type) \
|
|
|
a8a466 |
+ type, \
|
|
|
a8a466 |
+ HEADER_##type, \
|
|
|
a8a466 |
+ HEADER_##type + (MAX_FINGERS) * (FSIZE_##type), \
|
|
|
a8a466 |
+ BUTTON_##type, \
|
|
|
a8a466 |
+ FSIZE_##type, \
|
|
|
a8a466 |
+ DELTA_##type, \
|
|
|
a8a466 |
+ USBMSG_##type
|
|
|
a8a466 |
+
|
|
|
a8a466 |
/* logical signal quality */
|
|
|
a8a466 |
#define SN_PRESSURE 45 /* pressure signal-to-noise ratio */
|
|
|
a8a466 |
#define SN_WIDTH 25 /* width signal-to-noise ratio */
|
|
|
a8a466 |
@@ -274,7 +335,7 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING_JIS,
|
|
|
a8a466 |
0,
|
|
|
a8a466 |
0x84, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x81, TYPE1, FINGER_TYPE1, FINGER_TYPE1 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x81, DATAFORMAT(TYPE1),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 256 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4824, 5342 },
|
|
|
a8a466 |
@@ -287,7 +348,7 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING2_JIS,
|
|
|
a8a466 |
0,
|
|
|
a8a466 |
0x84, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x81, TYPE1, FINGER_TYPE1, FINGER_TYPE1 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x81, DATAFORMAT(TYPE1),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 256 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4824, 4824 },
|
|
|
a8a466 |
@@ -300,7 +361,7 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING3_JIS,
|
|
|
a8a466 |
HAS_INTEGRATED_BUTTON,
|
|
|
a8a466 |
0x84, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x81, DATAFORMAT(TYPE2),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 300 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4460, 5166 },
|
|
|
a8a466 |
@@ -313,7 +374,7 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING4_JIS,
|
|
|
a8a466 |
HAS_INTEGRATED_BUTTON,
|
|
|
a8a466 |
0x84, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x81, DATAFORMAT(TYPE2),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 300 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4620, 5140 },
|
|
|
a8a466 |
@@ -326,7 +387,7 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS,
|
|
|
a8a466 |
HAS_INTEGRATED_BUTTON,
|
|
|
a8a466 |
0x84, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x81, DATAFORMAT(TYPE2),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 300 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4616, 5112 },
|
|
|
a8a466 |
@@ -339,7 +400,7 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING5_JIS,
|
|
|
a8a466 |
HAS_INTEGRATED_BUTTON,
|
|
|
a8a466 |
0x84, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x81, DATAFORMAT(TYPE2),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 300 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4415, 5050 },
|
|
|
a8a466 |
@@ -352,7 +413,7 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING6_JIS,
|
|
|
a8a466 |
HAS_INTEGRATED_BUTTON,
|
|
|
a8a466 |
0x84, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x81, DATAFORMAT(TYPE2),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 300 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4620, 5140 },
|
|
|
a8a466 |
@@ -365,7 +426,7 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS,
|
|
|
a8a466 |
HAS_INTEGRATED_BUTTON,
|
|
|
a8a466 |
0x84, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x81, DATAFORMAT(TYPE2),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 300 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4750, 5280 },
|
|
|
a8a466 |
@@ -378,7 +439,7 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS,
|
|
|
a8a466 |
HAS_INTEGRATED_BUTTON,
|
|
|
a8a466 |
0x84, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x81, DATAFORMAT(TYPE2),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 300 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4620, 5140 },
|
|
|
a8a466 |
@@ -391,7 +452,7 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING7_JIS,
|
|
|
a8a466 |
HAS_INTEGRATED_BUTTON,
|
|
|
a8a466 |
0x84, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x81, DATAFORMAT(TYPE2),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 300 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4750, 5280 },
|
|
|
a8a466 |
@@ -404,7 +465,7 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS,
|
|
|
a8a466 |
HAS_INTEGRATED_BUTTON,
|
|
|
a8a466 |
0x84, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x81, DATAFORMAT(TYPE2),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 300 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4750, 5280 },
|
|
|
a8a466 |
@@ -417,13 +478,26 @@ static const struct bcm5974_config bcm59
|
|
|
a8a466 |
USB_DEVICE_ID_APPLE_WELLSPRING8_JIS,
|
|
|
a8a466 |
HAS_INTEGRATED_BUTTON,
|
|
|
a8a466 |
0, sizeof(struct bt_data),
|
|
|
a8a466 |
- 0x83, TYPE3, FINGER_TYPE3, FINGER_TYPE3 + SIZEOF_ALL_FINGERS,
|
|
|
a8a466 |
+ 0x83, DATAFORMAT(TYPE3),
|
|
|
a8a466 |
{ SN_PRESSURE, 0, 300 },
|
|
|
a8a466 |
{ SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
{ SN_COORD, -4620, 5140 },
|
|
|
a8a466 |
{ SN_COORD, -150, 6600 },
|
|
|
a8a466 |
{ SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
|
|
|
a8a466 |
},
|
|
|
a8a466 |
+ {
|
|
|
a8a466 |
+ USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI,
|
|
|
a8a466 |
+ USB_DEVICE_ID_APPLE_WELLSPRING9_ISO,
|
|
|
a8a466 |
+ USB_DEVICE_ID_APPLE_WELLSPRING9_JIS,
|
|
|
a8a466 |
+ HAS_INTEGRATED_BUTTON,
|
|
|
a8a466 |
+ 0, sizeof(struct bt_data),
|
|
|
a8a466 |
+ 0x83, DATAFORMAT(TYPE4),
|
|
|
a8a466 |
+ { SN_PRESSURE, 0, 300 },
|
|
|
a8a466 |
+ { SN_WIDTH, 0, 2048 },
|
|
|
a8a466 |
+ { SN_COORD, -4828, 5345 },
|
|
|
a8a466 |
+ { SN_COORD, -203, 6803 },
|
|
|
a8a466 |
+ { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
|
|
|
a8a466 |
+ },
|
|
|
a8a466 |
{}
|
|
|
a8a466 |
};
|
|
|
a8a466 |
|
|
|
a8a466 |
@@ -550,19 +624,18 @@ static int report_tp_state(struct bcm597
|
|
|
a8a466 |
struct input_dev *input = dev->input;
|
|
|
a8a466 |
int raw_n, i, n = 0;
|
|
|
a8a466 |
|
|
|
a8a466 |
- if (size < c->tp_offset || (size - c->tp_offset) % SIZEOF_FINGER != 0)
|
|
|
a8a466 |
+ if (size < c->tp_header || (size - c->tp_header) % c->tp_fsize != 0)
|
|
|
a8a466 |
return -EIO;
|
|
|
a8a466 |
|
|
|
a8a466 |
- /* finger data, le16-aligned */
|
|
|
a8a466 |
- f = (const struct tp_finger *)(dev->tp_data + c->tp_offset);
|
|
|
a8a466 |
- raw_n = (size - c->tp_offset) / SIZEOF_FINGER;
|
|
|
a8a466 |
+ raw_n = (size - c->tp_header) / c->tp_fsize;
|
|
|
a8a466 |
|
|
|
a8a466 |
for (i = 0; i < raw_n; i++) {
|
|
|
a8a466 |
- if (raw2int(f[i].touch_major) == 0)
|
|
|
a8a466 |
+ f = get_tp_finger(dev, i);
|
|
|
a8a466 |
+ if (raw2int(f->touch_major) == 0)
|
|
|
a8a466 |
continue;
|
|
|
a8a466 |
- dev->pos[n].x = raw2int(f[i].abs_x);
|
|
|
a8a466 |
- dev->pos[n].y = c->y.min + c->y.max - raw2int(f[i].abs_y);
|
|
|
a8a466 |
- dev->index[n++] = &f[i];
|
|
|
a8a466 |
+ dev->pos[n].x = raw2int(f->abs_x);
|
|
|
a8a466 |
+ dev->pos[n].y = c->y.min + c->y.max - raw2int(f->abs_y);
|
|
|
a8a466 |
+ dev->index[n++] = f;
|
|
|
a8a466 |
}
|
|
|
a8a466 |
|
|
|
a8a466 |
input_mt_assign_slots(input, dev->slots, dev->pos, n);
|
|
|
a8a466 |
@@ -573,32 +646,22 @@ static int report_tp_state(struct bcm597
|
|
|
a8a466 |
|
|
|
a8a466 |
input_mt_sync_frame(input);
|
|
|
a8a466 |
|
|
|
a8a466 |
- report_synaptics_data(input, c, f, raw_n);
|
|
|
a8a466 |
+ report_synaptics_data(input, c, get_tp_finger(dev, 0), raw_n);
|
|
|
a8a466 |
|
|
|
a8a466 |
- /* type 2 reports button events via ibt only */
|
|
|
a8a466 |
- if (c->tp_type == TYPE2) {
|
|
|
a8a466 |
- int ibt = raw2int(dev->tp_data[BUTTON_TYPE2]);
|
|
|
a8a466 |
+ /* later types report button events via integrated button only */
|
|
|
a8a466 |
+ if (c->caps & HAS_INTEGRATED_BUTTON) {
|
|
|
a8a466 |
+ int ibt = raw2int(dev->tp_data[c->tp_button]);
|
|
|
a8a466 |
input_report_key(input, BTN_LEFT, ibt);
|
|
|
a8a466 |
}
|
|
|
a8a466 |
|
|
|
a8a466 |
- if (c->tp_type == TYPE3)
|
|
|
a8a466 |
- input_report_key(input, BTN_LEFT, dev->tp_data[BUTTON_TYPE3]);
|
|
|
a8a466 |
-
|
|
|
a8a466 |
input_sync(input);
|
|
|
a8a466 |
|
|
|
a8a466 |
return 0;
|
|
|
a8a466 |
}
|
|
|
a8a466 |
|
|
|
a8a466 |
-/* Wellspring initialization constants */
|
|
|
a8a466 |
-#define BCM5974_WELLSPRING_MODE_READ_REQUEST_ID 1
|
|
|
a8a466 |
-#define BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID 9
|
|
|
a8a466 |
-#define BCM5974_WELLSPRING_MODE_REQUEST_VALUE 0x300
|
|
|
a8a466 |
-#define BCM5974_WELLSPRING_MODE_REQUEST_INDEX 0
|
|
|
a8a466 |
-#define BCM5974_WELLSPRING_MODE_VENDOR_VALUE 0x01
|
|
|
a8a466 |
-#define BCM5974_WELLSPRING_MODE_NORMAL_VALUE 0x08
|
|
|
a8a466 |
-
|
|
|
a8a466 |
static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
|
|
|
a8a466 |
{
|
|
|
a8a466 |
+ const struct bcm5974_config *c = &dev->cfg;
|
|
|
a8a466 |
int retval = 0, size;
|
|
|
a8a466 |
char *data;
|
|
|
a8a466 |
|
|
|
a8a466 |
@@ -606,7 +669,7 @@ static int bcm5974_wellspring_mode(struc
|
|
|
a8a466 |
if (dev->cfg.tp_type == TYPE3)
|
|
|
a8a466 |
return 0;
|
|
|
a8a466 |
|
|
|
a8a466 |
- data = kmalloc(8, GFP_KERNEL);
|
|
|
a8a466 |
+ data = kmalloc(c->um_size, GFP_KERNEL);
|
|
|
a8a466 |
if (!data) {
|
|
|
a8a466 |
dev_err(&dev->intf->dev, "out of memory\n");
|
|
|
a8a466 |
retval = -ENOMEM;
|
|
|
a8a466 |
@@ -617,28 +680,24 @@ static int bcm5974_wellspring_mode(struc
|
|
|
a8a466 |
size = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
|
|
|
a8a466 |
BCM5974_WELLSPRING_MODE_READ_REQUEST_ID,
|
|
|
a8a466 |
USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
|
|
|
a8a466 |
- BCM5974_WELLSPRING_MODE_REQUEST_VALUE,
|
|
|
a8a466 |
- BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000);
|
|
|
a8a466 |
+ c->um_req_val, c->um_req_idx, data, c->um_size, 5000);
|
|
|
a8a466 |
|
|
|
a8a466 |
- if (size != 8) {
|
|
|
a8a466 |
+ if (size != c->um_size) {
|
|
|
a8a466 |
dev_err(&dev->intf->dev, "could not read from device\n");
|
|
|
a8a466 |
retval = -EIO;
|
|
|
a8a466 |
goto out;
|
|
|
a8a466 |
}
|
|
|
a8a466 |
|
|
|
a8a466 |
/* apply the mode switch */
|
|
|
a8a466 |
- data[0] = on ?
|
|
|
a8a466 |
- BCM5974_WELLSPRING_MODE_VENDOR_VALUE :
|
|
|
a8a466 |
- BCM5974_WELLSPRING_MODE_NORMAL_VALUE;
|
|
|
a8a466 |
+ data[c->um_switch_idx] = on ? c->um_switch_on : c->um_switch_off;
|
|
|
a8a466 |
|
|
|
a8a466 |
/* write configuration */
|
|
|
a8a466 |
size = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0),
|
|
|
a8a466 |
BCM5974_WELLSPRING_MODE_WRITE_REQUEST_ID,
|
|
|
a8a466 |
USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
|
|
|
a8a466 |
- BCM5974_WELLSPRING_MODE_REQUEST_VALUE,
|
|
|
a8a466 |
- BCM5974_WELLSPRING_MODE_REQUEST_INDEX, data, 8, 5000);
|
|
|
a8a466 |
+ c->um_req_val, c->um_req_idx, data, c->um_size, 5000);
|
|
|
a8a466 |
|
|
|
a8a466 |
- if (size != 8) {
|
|
|
a8a466 |
+ if (size != c->um_size) {
|
|
|
a8a466 |
dev_err(&dev->intf->dev, "could not write to device\n");
|
|
|
a8a466 |
retval = -EIO;
|
|
|
a8a466 |
goto out;
|
|
|
a8a466 |
--- a/drivers/input/mouse/synaptics.c 2016-01-23 00:53:07.000000000 -0800
|
|
|
a8a466 |
+++ b/drivers/input/mouse/synaptics.c 2016-03-08 13:50:00.835861449 -0800
|
|
|
a8a466 |
@@ -1724,12 +1724,12 @@ static int __synaptics_init(struct psmou
|
|
|
a8a466 |
priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS;
|
|
|
a8a466 |
|
|
|
a8a466 |
psmouse_info(psmouse,
|
|
|
a8a466 |
- "Touchpad model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx, board id: %lu, fw id: %lu\n",
|
|
|
a8a466 |
+ "Touchpad model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx/%#lx, board id: %lu, fw id: %lu\n",
|
|
|
a8a466 |
SYN_ID_MODEL(priv->identity),
|
|
|
a8a466 |
SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity),
|
|
|
a8a466 |
priv->model_id,
|
|
|
a8a466 |
priv->capabilities, priv->ext_cap, priv->ext_cap_0c,
|
|
|
a8a466 |
- priv->board_id, priv->firmware_id);
|
|
|
a8a466 |
+ priv->ext_cap_10, priv->board_id, priv->firmware_id);
|
|
|
a8a466 |
|
|
|
a8a466 |
set_input_params(psmouse, priv);
|
|
|
a8a466 |
|