Skip to content

Commit

Permalink
T2: Device model 7a and 7b
Browse files Browse the repository at this point in the history
  • Loading branch information
Bingxing Wang committed Jul 29, 2019
1 parent 30f6b4c commit a594020
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/AmtPtpDeviceUsbKm/Device.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ AmtPtpGetDeviceConfig(
USHORT id = deviceInfo.idProduct;
const struct BCM5974_CONFIG* cfg;

for (cfg = Bcm5974ConfigTable; cfg->ansi; ++cfg) {
if (cfg->ansi == id || cfg->iso == id || cfg->jis == id) {
for (cfg = Bcm5974ConfigTable; cfg->identification; ++cfg) {
if (cfg->identification == id) {
return cfg;
}
}
Expand Down
33 changes: 28 additions & 5 deletions src/AmtPtpDeviceUsbKm/include/AppleDefinition.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#define USB_VENDOR_ID_APPLE 0x05ac

/* Apple T2 USB trackpad */
#define USB_DEVICE_ID_APPLE_T2_7A 0x027a
#define USB_DEVICE_ID_APPLE_T2_7B 0x027b
#define USB_DEVICE_ID_APPLE_T2_7C 0x027c
#define USB_DEVICE_ID_APPLE_T2_7D 0x027d

Expand Down Expand Up @@ -97,7 +99,7 @@ struct BCM5974_PARAM {

/* device-specific configuration */
struct BCM5974_CONFIG {
int ansi, iso, jis; /* the product id of this device */
int identification; /* the product id of this device */
int caps; /* device capability bitmask */
int bt_ep; /* the endpoint of the button interface */
int bt_datalen; /* data length of the button interface */
Expand Down Expand Up @@ -146,8 +148,28 @@ struct BCM5974_CONFIG {
/* device constants */
static const struct BCM5974_CONFIG Bcm5974ConfigTable[] = {
{
USB_DEVICE_ID_APPLE_T2_7C,
USB_DEVICE_ID_APPLE_T2_7C,
USB_DEVICE_ID_APPLE_T2_7A,
HAS_INTEGRATED_BUTTON,
0, sizeof(struct TRACKPAD_BUTTON_DATA),
0x83, DATAFORMAT(TYPE4),
{ SN_PRESSURE, 0, 300 },
{ SN_WIDTH, 0, 2048 },
{ SN_COORD, -6243, 6749 },
{ SN_COORD, -170, 7685 },
{ SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
},
{
USB_DEVICE_ID_APPLE_T2_7B,
HAS_INTEGRATED_BUTTON,
0, sizeof(struct TRACKPAD_BUTTON_DATA),
0x83, DATAFORMAT(TYPE4),
{ SN_PRESSURE, 0, 300 },
{ SN_WIDTH, 0, 2048 },
{ SN_COORD, -6243, 6749 },
{ SN_COORD, -170, 7685 },
{ SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
},
{
USB_DEVICE_ID_APPLE_T2_7C,
HAS_INTEGRATED_BUTTON,
0, sizeof(struct TRACKPAD_BUTTON_DATA),
Expand All @@ -159,8 +181,6 @@ static const struct BCM5974_CONFIG Bcm5974ConfigTable[] = {
{ SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
},
{
USB_DEVICE_ID_APPLE_T2_7D,
USB_DEVICE_ID_APPLE_T2_7D,
USB_DEVICE_ID_APPLE_T2_7D,
HAS_INTEGRATED_BUTTON,
0, sizeof(struct TRACKPAD_BUTTON_DATA),
Expand All @@ -171,4 +191,7 @@ static const struct BCM5974_CONFIG Bcm5974ConfigTable[] = {
{ SN_COORD, -170, 7685 },
{ SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION }
},
{
0
},
};

0 comments on commit a594020

Please sign in to comment.