Message ID | 2305311.UGlXl2onVb@positron.chronox.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Am Sonntag, 21. Januar 2018, 23:06:55 CET schrieb Stephan Müller: Hi Jiri, Dimity, Henrik, > Hi, > > Changes v3: > * port to 4.15-rc8 > * small code cleanups (isolation of type casts to functions pertaining > to the Apple Magic Trackpad 2 > * clean up all checkpatch.pl errors and warnings (except those > where the patch uses the structure of existing code fragments) > * updated horizontal and vertical limits to capture start of movements > in the outer areas of the pad > > ---8<--- > > Add support for Apple Magic Trackpad 2 in bcm5974 (MacBook Tochpad) driver. > The Magic Trackpad 2 needs to be switched into the finger-reporting-mode, > just like the other macbook touchpads as well. But the format is different > to the ones before. The Header is 12 Bytes long and each reported finger > is additional 9 Bytes. The data order reported by the hardware is > different as well. May I ask whether there is an issue in the patch? I have not received any feedback and would like to inquire about the status of the patch. I would like to have Touchpad 2 properly supported. Thanks a lot Stephan -- 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
Am Dienstag, 27. Februar 2018, 17:37:45 CET schrieb Stephan Mueller: Hi Jiri, Dimity, Henrik, > Am Sonntag, 21. Januar 2018, 23:06:55 CET schrieb Stephan Müller: > > Hi Jiri, Dimity, Henrik, > > > Hi, > > > > Changes v3: > > * port to 4.15-rc8 > > * small code cleanups (isolation of type casts to functions pertaining > > > > to the Apple Magic Trackpad 2 > > > > * clean up all checkpatch.pl errors and warnings (except those > > > > where the patch uses the structure of existing code fragments) > > > > * updated horizontal and vertical limits to capture start of movements > > > > in the outer areas of the pad > > > > ---8<--- > > > > Add support for Apple Magic Trackpad 2 in bcm5974 (MacBook Tochpad) > > driver. > > The Magic Trackpad 2 needs to be switched into the finger-reporting-mode, > > just like the other macbook touchpads as well. But the format is different > > to the ones before. The Header is 12 Bytes long and each reported finger > > is additional 9 Bytes. The data order reported by the hardware is > > different as well. > > May I ask whether there is an issue in the patch? I have not received any > feedback and would like to inquire about the status of the patch. > > I would like to have Touchpad 2 properly supported. <nudge> Ciao Stephan -- 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
Hi Stephan,
>> I would like to have Touchpad 2 properly supported.
You will find proper prior support for Magic Trackpads in
drivers/hid/hid-magicmouse.c.
Henrik
--
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
Hello Henrik! I think you have been absolutely right about the MT2 support and that it should be in hid-magicmouse and not in bcm5974. The more i am working on the driver, the more i see your awesome work for multitouch in the kernel and in xf86-mtrack as well. So i try to keep close to the event reporting in bcm5974 and added the MT2 support to the hid-magicmouse with USB and bluetooth support through the HID layer. It already seems to do the trick, but some people are testing and i will have to clean up the code. Then i will send in a new patch until end of this month. It would be great if you could have a look at the new patch, when i send it in. Marek -- 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
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index d0122134f320..11868321992c 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c @@ -96,6 +96,8 @@ #define USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI 0x0272 #define USB_DEVICE_ID_APPLE_WELLSPRING9_ISO 0x0273 #define USB_DEVICE_ID_APPLE_WELLSPRING9_JIS 0x0274 +/* MagicTrackpad2 (2015) */ +#define USB_DEVICE_ID_APPLE_MAGICTRACKPAD2 0x0265 #define BCM5974_DEVICE(prod) { \ .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ @@ -161,6 +163,8 @@ static const struct usb_device_id bcm5974_table[] = { BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI), BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING9_ISO), BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING9_JIS), + /* MagicTrackpad2 */ + BCM5974_DEVICE(USB_DEVICE_ID_APPLE_MAGICTRACKPAD2), /* Terminating entry */ {} }; @@ -190,7 +194,8 @@ enum tp_type { TYPE1, /* plain trackpad */ TYPE2, /* button integrated in trackpad */ TYPE3, /* additional header fields since June 2013 */ - TYPE4 /* additional header field for pressure data */ + TYPE4, /* additional header field for pressure data */ + TYPE5 /* format for magic trackpad 2 */ }; /* trackpad finger data offsets, le16-aligned */ @@ -198,12 +203,14 @@ enum tp_type { #define HEADER_TYPE2 (15 * sizeof(__le16)) #define HEADER_TYPE3 (19 * sizeof(__le16)) #define HEADER_TYPE4 (23 * sizeof(__le16)) +#define HEADER_TYPE5 (6 * sizeof(__le16)) /* trackpad button data offsets */ #define BUTTON_TYPE1 0 #define BUTTON_TYPE2 15 #define BUTTON_TYPE3 23 #define BUTTON_TYPE4 31 +#define BUTTON_TYPE5 1 /* list of device capability bits */ #define HAS_INTEGRATED_BUTTON 1 @@ -213,18 +220,21 @@ enum tp_type { #define FSIZE_TYPE2 (14 * sizeof(__le16)) #define FSIZE_TYPE3 (14 * sizeof(__le16)) #define FSIZE_TYPE4 (15 * sizeof(__le16)) +#define FSIZE_TYPE5 (9) /* offset from header to finger struct */ #define DELTA_TYPE1 (0 * sizeof(__le16)) #define DELTA_TYPE2 (0 * sizeof(__le16)) #define DELTA_TYPE3 (0 * sizeof(__le16)) #define DELTA_TYPE4 (1 * sizeof(__le16)) +#define DELTA_TYPE5 (0 * sizeof(__le16)) /* usb control message mode switch data */ #define USBMSG_TYPE1 8, 0x300, 0, 0, 0x1, 0x8 #define USBMSG_TYPE2 8, 0x300, 0, 0, 0x1, 0x8 #define USBMSG_TYPE3 8, 0x300, 0, 0, 0x1, 0x8 #define USBMSG_TYPE4 2, 0x302, 2, 1, 0x1, 0x0 +#define USBMSG_TYPE5 2, 0x302, 1, 1, 0x1, 0x0 /* Wellspring initialization constants */ #define BCM5974_WELLSPRING_MODE_READ_REQUEST_ID 1 @@ -247,6 +257,18 @@ struct tp_finger { __le16 multi; /* one finger: varies, more fingers: constant */ } __attribute__((packed,aligned(2))); +/* trackpad finger structure for type5 (magic trackpad), le16-aligned */ +struct tp_finger_type5 { + u8 abs_x; /* absolute x coodinate */ + u8 abs_x_y; /* absolute x,y coodinate */ + u8 abs_y[2]; /* absolute y coodinate */ + u8 touch_major; /* touch area, major axis */ + u8 touch_minor; /* touch area, minor axis */ + u8 size; /* tool area, size */ + u8 pressure; /* pressure on forcetouch touchpad */ + u8 orientation_origin; /* orientation and id */ +} __attribute__((packed,aligned(2))); + /* trackpad finger data size, empirically at least ten fingers */ #define MAX_FINGERS 16 #define MAX_FINGER_ORIENTATION 16384 @@ -497,6 +519,19 @@ static const struct bcm5974_config bcm5974_config_table[] = { { SN_COORD, -203, 6803 }, { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION } }, + { + USB_DEVICE_ID_APPLE_MAGICTRACKPAD2, + USB_DEVICE_ID_APPLE_MAGICTRACKPAD2, + USB_DEVICE_ID_APPLE_MAGICTRACKPAD2, + HAS_INTEGRATED_BUTTON, + 0, sizeof(struct bt_data), + 0x83, DATAFORMAT(TYPE5), + { SN_PRESSURE, 0, 300 }, + { SN_WIDTH, 0, 2048 }, + { SN_COORD, -9000, 9000 }, + { SN_COORD, -6803, 6803 }, + { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION } + }, {} };