Author Topic: Making a standalone USB trackpad from Macbook Pro (mid-2012) trackpad.  (Read 6966 times)

0 Members and 1 Guest are viewing this topic.

Offline bob808Topic starter

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: 00
Ever since I first used a Macbook with the Apple trackpad I always wanted to have that trackpad as a separate unit. After they released the standalone unit I couldn't really justify the price. So I decided to try and hack one when the opportunity comes.
Few days back a friend had a beer with his macbook pro (13" mid-2012). That turned out to be a bad idea, so I ended up with the broken laptop.
Looking at the trackpad itself, it doesn't contain any electronics, everything is on the motherboard. There's a CY8C24794 chip that deals with both the trackpad and keyboard. I think this chip has some firmware in it so I'm not sure you can use a new one.
If Apple would release official schematics then I might be able to do a better job at explaining what you need to do. But I'll try without it.
There's two series resistors between the chip's D+/D- lines and the USB mux. Easy to remove them and tap the signal for the chip. The chip needs 3.3V.
The trackpad connector has a 3.3V line and one 18V line. There's also a 5V rail that doesn't seem connected to the rest of the circuit, maybe used on some other trackpad models. I rushed through it and ended up using a 3.3V linear reg. After a closer look at the PCB I figured out there's a 5Vin regulator that outputs 3.3V directly to the rail the trackpad chip is on, and also passes 5V to the onboard 18V boost reg. So theoretically you could get away with just the connector wires, no other IC. I'll test this next time I get the chance, since I already removed a transistor so I can insert 3.3V into that rail, and I can't be bothered to put it back, the sucker is too small and has a weird footprint.
In the following photo you can see the transistor:



And in this photo a closeup of the pad behind the transistor (pink rectangle). Green is a GND pad that you can see unpopulated in the previous photo. Yellow is the 3.3V pad, where you inject the 3.3V from the external reg.



Apart from power I had to pull up one enable pin for the chip, and I also pulled down another SMC wake line, not sure if the last one is needed or not.
After I connected the USB cable I saw the system recognized it:
Bus 001 Device 006: ID 05ac:0252 Apple, Inc. Internal Keyboard/Trackpad (ANSI)
And seems to be working just fine. I didn't need anything else in Linux, two finger scroll works great!
In Windows 10 I first installed the Bootcamp trackpad drivers, so I don't know if it's working without them, or not. I suppose it should work without them as well.



After some careful consideration I decided I don't need the whole PCB so I performed an old medieval parting ritual:




All needed parts are on that part of the PCB, including the 5Vin reg that should give all the needed power rails. The only issue with it is that that IC is very close to the edge of the PCB where the parting ritual was applied. So you might clip some internal lines. I filed the PCB edge where it was cut, revealing I think around 12 layers. take care to not short anything, I just YOLO'd it.

I injected the 5V from USB into the input of the 18V boost reg. The input line has a small value resistor in series, I removed it and added a wire instead. Pink is the resistor I removed, green shows the possible pads you can tap into. That cap has one side on the input of reg.



And a photo of the chip itself that controls the trackpad/keyboard. Pink rectangles are where the USB data lines series resistors were located. I cut the traces going down so I wouldn't connect to the rest of the circuit, not needed if you can finely solder the wires on the upper pads of both resistors. Green is the enable pad for the chip, and yellow is where a low value resistor was. It connects the chip to the 3.3V rail. I initially removed that resistor, now I made a bridge across both pads and connected the enable wire on it.



All that's needed now is to design and 3D print a case for it. I also need to make a small PCB with the USB connector and the 3.3V reg. But theoretically I should have been able to only use the USB 5Vin, just that it's too late to go that route now for my board. The only downside of going that route is that more chips might be powered on the PCB, and that would enable more rails making for extra unneeded power consumption. Or you can remove the extra chips that are not needed, tho that's extra work.
The resulting board is much smaller than the trackpad itself, that should allow for a slim case design.



Forgot to mention that the keyboard works as well, but I'm not using it.
If anyone else wants to try this I will try and help and maybe post better pictures for all connections.
« Last Edit: July 22, 2021, 06:36:21 pm by bob808 »
 
The following users thanked this post: SeanB, robert.rozee, yuri624, XForce

Offline yuri624

  • Newbie
  • Posts: 4
  • Country: de
Re: Making a standalone USB trackpad from Macbook Pro (mid-2012) trackpad.
« Reply #1 on: December 22, 2021, 04:04:59 pm »
Hey mate, great job. I wish I had seen your post earlier. I did the same with the trackpad of a Macbook Pro 2010 (I think).

Does your trackpad work when you plug it into an Android device? You could really help me out if you tried, if possible.

Mine works everywhere... Windows, Linux, MacOS... native and in virtual machines. On my Samsung Galaxy S8 (Android 10), Lenovo P11 Pro Tablet (Android 11), desktop pc (Android-x86) the trackpad is just dead. When I use Android-x86 inside a virtual machine..... the trackpad works just fine including all gestures.

Thanks in advance for your time if you could test it. Cheers.
 

Online amyk

  • Super Contributor
  • ***
  • Posts: 8272
Re: Making a standalone USB trackpad from Macbook Pro (mid-2012) trackpad.
« Reply #2 on: December 23, 2021, 02:38:48 am »
You can definitely find the schematics if you know where to look. Apple didn't release them, but that doesn't matter for what you want to do.

As for not working in Android, that could just be because whatever drivers are available don't match closely enough.
 

Offline yuri624

  • Newbie
  • Posts: 4
  • Country: de
Re: Making a standalone USB trackpad from Macbook Pro (mid-2012) trackpad.
« Reply #3 on: December 23, 2021, 01:23:10 pm »
You can definitely find the schematics if you know where to look. Apple didn't release them, but that doesn't matter for what you want to do.

As for not working in Android, that could just be because whatever drivers are available don't match closely enough.

I do have the schematics (which helped in doing this in the first place).

The problem is that:
I take an Android-x86 image and boot off of it directly -> Trackpad dead (same on Android 10 + 11 devices natively)
I take the same Android-x86 image and run it in a VM -> Trackpad works with all gestures flawlessly

So the drivers are there. It's "Apple USB BCM5974 (Macbook Air and Penryn Macbook Pro) multitouch driver" in the file "bcm5974.c".
The sourcecode for the driver is here (and seems to be implemented since 2013): https://android.googlesource.com/kernel/goldfish/+/android-goldfish-3.4/drivers/input/mouse/bcm5974.c
 

Offline bob808Topic starter

  • Frequent Contributor
  • **
  • Posts: 281
  • Country: 00
Re: Making a standalone USB trackpad from Macbook Pro (mid-2012) trackpad.
« Reply #4 on: December 31, 2021, 12:52:34 pm »
If I find the OTG dongle I'll try it out on my phone. Didn't yet get to design&print a case for it.
 

Online amyk

  • Super Contributor
  • ***
  • Posts: 8272
Re: Making a standalone USB trackpad from Macbook Pro (mid-2012) trackpad.
« Reply #5 on: December 31, 2021, 11:54:42 pm »
I take an Android-x86 image and boot off of it directly -> Trackpad dead (same on Android 10 + 11 devices natively)
I take the same Android-x86 image and run it in a VM -> Trackpad works with all gestures flawlessly
Unless you're passing through the USB device (and HID devices are usually not easy to pass through, because you'd easily lose control of the host) this is almost certainly a driver problem. If you're running an OS in a VM, the devices it sees are virtual ones, which can be completely different from the actual hardware.
 

Offline yuri624

  • Newbie
  • Posts: 4
  • Country: de
If I find the OTG dongle I'll try it out on my phone. Didn't yet get to design&print a case for it.

Cheers mate, tried it yet by any luck?


I take an Android-x86 image and boot off of it directly -> Trackpad dead (same on Android 10 + 11 devices natively)
I take the same Android-x86 image and run it in a VM -> Trackpad works with all gestures flawlessly
Unless you're passing through the USB device (and HID devices are usually not easy to pass through, because you'd easily lose control of the host) this is almost certainly a driver problem. If you're running an OS in a VM, the devices it sees are virtual ones, which can be completely different from the actual hardware.

So after some pause and a lot more headache I randomly found out that.... using Android_x86:
- Booting Android, then plugging the device in: Keyboard works, Trackpad doesn't
- Plug the device in, then boot Android: Keyboard works, Trackpad works!
   (when unplugging and replugging it, the Trackpad stops working again)

So it's not really a driver problem? And it's also "natively" supporting the drivers, but only if I connect it before booting.
This is for Android_x86 only, my phone sadly does not care (otherwise my issue would kind of be solved) and it won't work even when connecting it before the boot, probably because the usb-c to hdmi/usb/charging adapter gets activated only after Android already completed the boot process.

Any help would be appreciated.
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4531
  • Country: au
    • send complaints here
So after some pause and a lot more headache I randomly found out that.... using Android_x86:
- Booting Android, then plugging the device in: Keyboard works, Trackpad doesn't
- Plug the device in, then boot Android: Keyboard works, Trackpad works!
   (when unplugging and replugging it, the Trackpad stops working again)

....This is for Android_x86 only
Its a problem of Android lacking suitable drivers as already mentioned. When you boot a "PC" it might be doing USB legacy emulation so the OS never sees the complexity or needs drivers.
 

Online amyk

  • Super Contributor
  • ***
  • Posts: 8272
There are tools, mainly Linux-based that will let you dump out the USB descriptors for the device (even if there are no drivers available). Getting that information would be a good first step to figuring out why it doesn't work and how to make it work.
 

Offline yuri624

  • Newbie
  • Posts: 4
  • Country: de
Its a problem of Android lacking suitable drivers as already mentioned. When you boot a "PC" it might be doing USB legacy emulation so the OS never sees the complexity or needs drivers.

The driver is "Apple USB BCM5974 (Macbook Air and Penryn Macbook Pro) multitouch driver" in the file "bcm5974.c".
The sourcecode for the driver is here (and seems to be implemented since 2013): https://android.googlesource.com/kernel/goldfish/+/android-goldfish-3.4/drivers/input/mouse/bcm5974.c
If the module is really present or not on the native Android devices, I don't know. When using lsmod on my rooted Galaxy S10+ it shows... zero.. modules loaded. On Android_x86 there are easily 30-40 modules loaded.


There are tools, mainly Linux-based that will let you dump out the USB descriptors for the device (even if there are no drivers available). Getting that information would be a good first step to figuring out why it doesn't work and how to make it work.

I got myself "Free Device Monitoring Studio" for Windows, this does what's needed I guess.


The first Touchpad shows:
Code: [Select]
Touchpad (Internal Keyboard/Trackpad (ISO))

Device Descriptor:
----------------------------------------------
This device is part of a composite device.

Connection Information
 Port: 2
 Speed: Full Speed
 Device address: 6
 Open pipes: 3
 Connection status: Device connected

Device Descriptor
 USB version: 2.0
 Device class: 0x0 - (Defined at Interface level)
 Device subclass: 0x0 - Unknown
 Device protocol: 0x0 - Unknown
 Control pipe max size: 8 bytes
 Vendor ID: 0x5ac (Apple, Inc.)
 Product ID: 0x246 (Internal Keyboard/Trackpad (ISO))
 Product version: 1.8
 Manufacturer: Apple Inc.
 Product: Touchpad
 Serial Number: Not specified
 Configurations: 1



Configuration Descriptor:
----------------------------------------------
descriptors[0] = "Configuration Descriptor"
bLength = 9
bDescriptorType = USB_CONFIGURATION_DESCRIPTOR_TYPE (2)
wTotalLength = 34
bNumInterfaces = 1
bConfigurationValue = 1
iConfiguration = 0
Reserved = 0
SupportsRemoteWakeup = 1
SelfPowered = 0
PoweredByBus = 1
MaxPower = 0x14 -> 40 mA

descriptors[1] = "Interface Descriptor"
bLength = 9
bDescriptorType = USB_INTERFACE_DESCRIPTOR_TYPE (4)
bInterfaceNumber = 1
bAlternateSetting = 0
bNumEndpoints = 1
bInterfaceClass = UsbHID (3)
bInterfaceSubClass = 0
bInterfaceProtocol = 0
iInterface = 4

descriptors[2] = "HID Descriptor"
bLength = 9
bDescriptorType = HID_HID_DESCRIPTOR_TYPE (33)
bcdHID = 1.11
bCountry = NotDefined (0)
bNumDescriptors = 1
reports = 
reports[0] = 
bReportType = 34
wReportLength = 27
raw =  7, 5, 129, 3, 64… 



HID Descriptor:
----------------------------------------------
This device is part of a composite device.

HID Descriptor
Usage Page: 65280 (Vendor Specific)
Usage: 1 (Unknown)
Collection
Usage Page: 65280 (Vendor Specific)
Usage: 1 (Unknown)
Logical Minimum: 0
Logical Maximum: 255
Report ID: 68
Report Size: 8
Report Count: 511
Input: 0 (Data,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

End Collection


The second Touchpad:

Code: [Select]
Device Descriptor:
----------------------------------------------
This device is part of a composite device.

Connection Information
 Port: 2
 Speed: Full Speed
 Device address: 6
 Open pipes: 3
 Connection status: Device connected

Device Descriptor
 USB version: 2.0
 Device class: 0x0 - (Defined at Interface level)
 Device subclass: 0x0 - Unknown
 Device protocol: 0x0 - Unknown
 Control pipe max size: 8 bytes
 Vendor ID: 0x5ac (Apple, Inc.)
 Product ID: 0x246 (Internal Keyboard/Trackpad (ISO))
 Product version: 1.8
 Manufacturer: Apple Inc.
 Product: Touchpad
 Serial Number: Not specified
 Configurations: 1



Configuration Descriptor:
----------------------------------------------
descriptors[0] = "Configuration Descriptor"
bLength = 9
bDescriptorType = USB_CONFIGURATION_DESCRIPTOR_TYPE (2)
wTotalLength = 34
bNumInterfaces = 1
bConfigurationValue = 1
iConfiguration = 0
Reserved = 0
SupportsRemoteWakeup = 1
SelfPowered = 0
PoweredByBus = 1
MaxPower = 0x14 -> 40 mA

descriptors[1] = "Interface Descriptor"
bLength = 9
bDescriptorType = USB_INTERFACE_DESCRIPTOR_TYPE (4)
bInterfaceNumber = 2
bAlternateSetting = 0
bNumEndpoints = 1
bInterfaceClass = UsbHID (3)
bInterfaceSubClass = 1
bInterfaceProtocol = 2
iInterface = 4

descriptors[2] = "HID Descriptor"
bLength = 9
bDescriptorType = HID_HID_DESCRIPTOR_TYPE (33)
bcdHID = 1.11
bCountry = NotDefined (0)
bNumDescriptors = 1
reports = 
reports[0] = 
bReportType = 34
wReportLength = 52
raw =  7, 5, 132, 3, 8… 
 



HID Descriptor:
----------------------------------------------
This device is part of a composite device.

HID Descriptor
Usage Page: 1 (Generic Desktop Controls)
Usage: 2 (Mouse)
Collection
Usage: 1 (Pointer)
Collection
Usage Page: 9 (Buttons)
Usages (1-3): Button 1 (Primary), Button 2 (Secondary), Button 3 (Tertiary)
Logical Minimum: 0
Logical Maximum: 1
Report ID: 2
Report Count: 3
Report Size: 1
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Report Count: 1
Report Size: 5
Input: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage Page: 1 (Generic Desktop Controls)
Usage: 48 (Direction-X)
Usage: 49 (Direction-Y)
Logical Minimum: -127
Logical Maximum: 127
Report Size: 8
Report Count: 2
Input: 6 (Data,Variable,Relative,No Wrap,Linear,Preferred State,No Null Position)

End Collection
End Collection



And the keyboard (although irrelevant I think as it works normal)

Code: [Select]
Apple Internal Keyboard (Internal Keyboard/Trackpad (ISO))

Device Descriptor:
----------------------------------------------
This device is part of a composite device.

Connection Information
 Port: 2
 Speed: Full Speed
 Device address: 6
 Open pipes: 3
 Connection status: Device connected

Device Descriptor
 USB version: 2.0
 Device class: 0x0 - (Defined at Interface level)
 Device subclass: 0x0 - Unknown
 Device protocol: 0x0 - Unknown
 Control pipe max size: 8 bytes
 Vendor ID: 0x5ac (Apple, Inc.)
 Product ID: 0x246 (Internal Keyboard/Trackpad (ISO))
 Product version: 1.8
 Manufacturer: Apple Inc.
 Product: Apple Internal Keyboard
 Serial Number: Not specified
 Configurations: 1



Configuration Descriptor:
----------------------------------------------
descriptors[0] = "Configuration Descriptor"
bLength = 9
bDescriptorType = USB_CONFIGURATION_DESCRIPTOR_TYPE (2)
wTotalLength = 34
bNumInterfaces = 1
bConfigurationValue = 1
iConfiguration = 0
Reserved = 0
SupportsRemoteWakeup = 1
SelfPowered = 0
PoweredByBus = 1
MaxPower = 0x14 -> 40 mA

descriptors[1] = "Interface Descriptor"
bLength = 9
bDescriptorType = USB_INTERFACE_DESCRIPTOR_TYPE (4)
bInterfaceNumber = 0
bAlternateSetting = 0
bNumEndpoints = 1
bInterfaceClass = UsbHID (3)
bInterfaceSubClass = 1
bInterfaceProtocol = 1
iInterface = 3

descriptors[2] = "HID Descriptor"
bLength = 9
bDescriptorType = HID_HID_DESCRIPTOR_TYPE (33)
bcdHID = 1.11
bCountry = International (13)
bNumDescriptors = 1
reports = 
reports[0] = 
bReportType = 34
wReportLength = 156
raw =  7, 5, 131, 3, 10… 




HID Descriptor:
----------------------------------------------
This device is part of a composite device.

HID Descriptor
Usage Page: 1 (Generic Desktop Controls)
Usage: 6 (Keyboard)
Collection
Report ID: 1
Usage Page: 7 (Keyboard)
Usages (224-231): Control Left, Shift Left, Alt Left, GUI Left, Control Right, Shift Right, Alt Right,
GUI Right
Logical Minimum: 0
Logical Maximum: 1
Report Size: 1
Report Count: 8
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Report Count: 1
Report Size: 8
Input: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Report Count: 5
Report Size: 1
Usage Page: 8 (LEDs)
Usages (1-5): NumLock, CapsLock, Scroll Lock, Compose, Kana
Output: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position,Non Volatile)

Report Count: 1
Report Size: 3
Output: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position,Non Volatile)

Report Count: 6
Report Size: 8
Logical Minimum: 0
Logical Maximum: 255
Usage Page: 7 (Keyboard)
Usages (0-255): No Event, Keyboard ErrorRollOver, Keyboard POSTfail, Keyboard Error Undefined, A,
B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
1 and ! (One and Exclamation), 2 and @ (2 and at), 3 and # (3 and Hash), 4 and $ (4 and Dollar Sign),
5 and % (5 and Percent Sign), 6 and ^ (6 and circumflex), 7 and & (Seven and Ampersand),
8 and * (Eight and asterisk), 9 and ( (Nine and Parenthesis Left), 0 and ) (Zero and Parenthesis Right),
Return (Enter), Escape, Delete (Backspace), Tab, Space Bar, - and _ (Minus and underscore),
= and + (Equal and Plus), [ and { (Bracket and Braces Left), ] and } (Bracket and Braces Right),
\ and | (Backslash and Bar), # and ~ (Hash and Tilde, Non-US Keyboard near right shift),
; and : (Semicolon and Colon), � and " (Accent Acute and Double Quotes),
` and ~ (Accent Grace and Tilde), , and < (Comma and Less), . and > (Period and Greater),
/ and ? (Slash and Question Mark), Caps Lock, F1, F2, F3, F4, F5, F6, F7, F8,
F9, F10, F11, F12, Print Screen, Scroll Lock, Pause, Insert, Home, Page Up,
Delete Forward (without Changing Position), End, Page Down, Right Arrow, Left Arrow,
Down Arrow, Up Arrow, Num Lock and Clear, Keypad / (Division Sign), Keypad * (Multiplication Sign),
Keypad - (Subtraction Sign), Keypad + (Addition Sign), Keypad Enter, Keypad 1 and END,
Keypad 2 and Down Arrow, Keypad 3 and Page Down, Keypad 4 and Left Arrow, Keypad 5 (Tactilei Raised),
Unknown, Keypad 6 and Right Arrow, Keypad 7 and Home, Keypad 8 and Up Arrow,
Keypad 8 and Page Up, Keypad . (decimal delimiter) and Delete, \ and | (Backslash and Bar, UK and Non-US Keyboard near left shift),
Keyboard Application (Windows Key for Win95 or Compose), Power (not a key),
Keypad = (Equal Sign), F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23,
F24, Execute, Help, Menu, Select, Stop, Again, Undo, Cut, Copy, Paste, Find,
Mute, Volume Up, Volume Down, Locking Caps Lock, Locking Num Lock, Locking Scroll Lock,
Keypad Comma, Keypad Equal Sign (AS/400), International 1 (PC98), International 2 (PC98),
International 3 (PC98), International 4 (PC98), International 5 (PC98), International 6 (PC98),
International 7 (Toggle Single/Double Byte Mode), International 8, International 9,
LANG 1 (Hangul/English Toggle, Korea), LANG 2 (Hanja Conversion, Korea), LANG 3 (Katakana, Japan),
LANG 4 (Hiragana, Japan), LANG 5 (Zenkaku/Hankaku, Japan), LANG 6, LANG 7,
LANG 8, LANG 9, Alternate Erase, SysReq/Attention, Cancel, Clear, Prior, Return,
Separator, Out, Open, Clear/Again, CrSel/Props, ExSel, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Control Left, Shift Left, Alt Left, GUI Left, Control Right,
Shift Right, Alt Right, GUI Right, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown
Input: 0 (Data,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage Page: 12 (Consumer)
Report Size: 1
Report Count: 1
Usage: 184 (Eject)
Logical Minimum: 0
Logical Maximum: 1
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage Page: 255 (Vendor Specific)
Usage: 3 (Unknown)
Report Size: 7
Report Count: 1
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

End Collection
Usage Page: 12 (Consumer)
Usage: 1 (Consumer Control)
Collection
Report ID: 82
Logical Minimum: 0
Logical Maximum: 1
Report Size: 1
Report Count: 1
Usage: 205 (Play/Pause)
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage: 179 (Fast Forward)
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage: 180 (Rewind)
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage: 181 (Scan Next Track)
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage: 182 (Scan Previous Track)
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Input: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Input: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Input: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Report ID: 9
Logical Minimum: 0
Logical Maximum: 1
Report Size: 8
Report Count: 1
Usage Page: 65281 (Vendor Specific)
Usage: 11 (Unknown)
Feature: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Report Size: 8
Report Count: 2
Feature: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

End Collection



The USB Controller seems to have listed everything from the above combined I guess:

Code: [Select]
USB-Controller

Apple Internal Keyboard / Trackpad (Internal Keyboard/Trackpad (ISO))

Device Descriptor:
----------------------------------------------
Connection Information
 Port: 2
 Speed: Full Speed
 Device address: 6
 Open pipes: 3
 Connection status: Device connected

Device Descriptor:
 USB version: 2.0
 Device class: 0x0 - (Defined at Interface level)
 Device subclass: 0x0 - Unknown
 Device protocol: 0x0 - Unknown
 Control pipe max size: 8 bytes
 Vendor ID: 0x5ac (Apple, Inc.)
 Product ID: 0x246 (Internal Keyboard/Trackpad (ISO))
 Product version: 1.8
 Manufacturer: Apple Inc.
 Product: Apple Internal Keyboard / Trackpad
 Serial Number: Not specified
 Configurations: 1

Configuration Descriptor:
----------------------------------------------
descriptors[0] = "Configuration Descriptor"
bLength = 9
bDescriptorType = USB_CONFIGURATION_DESCRIPTOR_TYPE (2)
wTotalLength = 84
bNumInterfaces = 3
bConfigurationValue = 1
iConfiguration = 0
Reserved = 0
SupportsRemoteWakeup = 1
SelfPowered = 0
PoweredByBus = 1
MaxPower = 0x14 -> 40 mA

descriptors[1] = "Interface Descriptor"
bLength = 9
bDescriptorType = USB_INTERFACE_DESCRIPTOR_TYPE (4)
bInterfaceNumber = 0
bAlternateSetting = 0
bNumEndpoints = 1
bInterfaceClass = UsbHID (3)
bInterfaceSubClass = 1
bInterfaceProtocol = 1
iInterface = 3

descriptors[2] = "HID Descriptor"
bLength = 9
bDescriptorType = HID_HID_DESCRIPTOR_TYPE (33)
bcdHID = 1.11
bCountry = International (13)
bNumDescriptors = 1
reports = 
reports[0] = 
bReportType = 34
wReportLength = 156
raw =  7, 5, 131, 3, 10… 


HID Descriptor:
----------------------------------------------
HID Descriptor
Usage Page: 1 (Generic Desktop Controls)
Usage: 6 (Keyboard)
Collection
Report ID: 1
Usage Page: 7 (Keyboard)
Usages (224-231): Control Left, Shift Left, Alt Left, GUI Left, Control Right, Shift Right, Alt Right,
GUI Right
Logical Minimum: 0
Logical Maximum: 1
Report Size: 1
Report Count: 8
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Report Count: 1
Report Size: 8
Input: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Report Count: 5
Report Size: 1
Usage Page: 8 (LEDs)
Usages (1-5): NumLock, CapsLock, Scroll Lock, Compose, Kana
Output: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position,Non Volatile)

Report Count: 1
Report Size: 3
Output: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position,Non Volatile)

Report Count: 6
Report Size: 8
Logical Minimum: 0
Logical Maximum: 255
Usage Page: 7 (Keyboard)
Usages (0-255): No Event, Keyboard ErrorRollOver, Keyboard POSTfail, Keyboard Error Undefined, A,
B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
1 and ! (One and Exclamation), 2 and @ (2 and at), 3 and # (3 and Hash), 4 and $ (4 and Dollar Sign),
5 and % (5 and Percent Sign), 6 and ^ (6 and circumflex), 7 and & (Seven and Ampersand),
8 and * (Eight and asterisk), 9 and ( (Nine and Parenthesis Left), 0 and ) (Zero and Parenthesis Right),
Return (Enter), Escape, Delete (Backspace), Tab, Space Bar, - and _ (Minus and underscore),
= and + (Equal and Plus), [ and { (Bracket and Braces Left), ] and } (Bracket and Braces Right),
\ and | (Backslash and Bar), # and ~ (Hash and Tilde, Non-US Keyboard near right shift),
; and : (Semicolon and Colon), � and " (Accent Acute and Double Quotes),
` and ~ (Accent Grace and Tilde), , and < (Comma and Less), . and > (Period and Greater),
/ and ? (Slash and Question Mark), Caps Lock, F1, F2, F3, F4, F5, F6, F7, F8,
F9, F10, F11, F12, Print Screen, Scroll Lock, Pause, Insert, Home, Page Up,
Delete Forward (without Changing Position), End, Page Down, Right Arrow, Left Arrow,
Down Arrow, Up Arrow, Num Lock and Clear, Keypad / (Division Sign), Keypad * (Multiplication Sign),
Keypad - (Subtraction Sign), Keypad + (Addition Sign), Keypad Enter, Keypad 1 and END,
Keypad 2 and Down Arrow, Keypad 3 and Page Down, Keypad 4 and Left Arrow, Keypad 5 (Tactilei Raised),
Unknown, Keypad 6 and Right Arrow, Keypad 7 and Home, Keypad 8 and Up Arrow,
Keypad 8 and Page Up, Keypad . (decimal delimiter) and Delete, \ and | (Backslash and Bar, UK and Non-US Keyboard near left shift),
Keyboard Application (Windows Key for Win95 or Compose), Power (not a key),
Keypad = (Equal Sign), F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23,
F24, Execute, Help, Menu, Select, Stop, Again, Undo, Cut, Copy, Paste, Find,
Mute, Volume Up, Volume Down, Locking Caps Lock, Locking Num Lock, Locking Scroll Lock,
Keypad Comma, Keypad Equal Sign (AS/400), International 1 (PC98), International 2 (PC98),
International 3 (PC98), International 4 (PC98), International 5 (PC98), International 6 (PC98),
International 7 (Toggle Single/Double Byte Mode), International 8, International 9,
LANG 1 (Hangul/English Toggle, Korea), LANG 2 (Hanja Conversion, Korea), LANG 3 (Katakana, Japan),
LANG 4 (Hiragana, Japan), LANG 5 (Zenkaku/Hankaku, Japan), LANG 6, LANG 7,
LANG 8, LANG 9, Alternate Erase, SysReq/Attention, Cancel, Clear, Prior, Return,
Separator, Out, Open, Clear/Again, CrSel/Props, ExSel, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Control Left, Shift Left, Alt Left, GUI Left, Control Right,
Shift Right, Alt Right, GUI Right, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown, Unknown,
Unknown
Input: 0 (Data,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage Page: 12 (Consumer)
Report Size: 1
Report Count: 1
Usage: 184 (Eject)
Logical Minimum: 0
Logical Maximum: 1
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage Page: 255 (Vendor Specific)
Usage: 3 (Unknown)
Report Size: 7
Report Count: 1
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

End Collection
Usage Page: 12 (Consumer)
Usage: 1 (Consumer Control)
Collection
Report ID: 82
Logical Minimum: 0
Logical Maximum: 1
Report Size: 1
Report Count: 1
Usage: 205 (Play/Pause)
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage: 179 (Fast Forward)
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage: 180 (Rewind)
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage: 181 (Scan Next Track)
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage: 182 (Scan Previous Track)
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Input: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Input: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Input: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Report ID: 9
Logical Minimum: 0
Logical Maximum: 1
Report Size: 8
Report Count: 1
Usage Page: 65281 (Vendor Specific)
Usage: 11 (Unknown)
Feature: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Report Size: 8
Report Count: 2
Feature: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

End Collection
HID Descriptor
Usage Page: 65280 (Vendor Specific)
Usage: 1 (Unknown)
Collection
Usage Page: 65280 (Vendor Specific)
Usage: 1 (Unknown)
Logical Minimum: 0
Logical Maximum: 255
Report ID: 68
Report Size: 8
Report Count: 511
Input: 0 (Data,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

End Collection
HID Descriptor
Usage Page: 1 (Generic Desktop Controls)
Usage: 2 (Mouse)
Collection
Usage: 1 (Pointer)
Collection
Usage Page: 9 (Buttons)
Usages (1-3): Button 1 (Primary), Button 2 (Secondary), Button 3 (Tertiary)
Logical Minimum: 0
Logical Maximum: 1
Report ID: 2
Report Count: 3
Report Size: 1
Input: 2 (Data,Variable,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Report Count: 1
Report Size: 5
Input: 1 (Constant,Array,Absolute,No Wrap,Linear,Preferred State,No Null Position)

Usage Page: 1 (Generic Desktop Controls)
Usage: 48 (Direction-X)
Usage: 49 (Direction-Y)
Logical Minimum: -127
Logical Maximum: 127
Report Size: 8
Report Count: 2
Input: 6 (Data,Variable,Relative,No Wrap,Linear,Preferred State,No Null Position)

End Collection
End Collection



On Windows, the Touchpad with usage page 65280 doesn't do anything without Apple drivers installed. The second touchpad is used as standard and functions as a mouse (move mouse, click with physical button).

On Ubuntu it works without installing additional drivers (same for MacOS but that's obvious I guess).

In my pc BIOS it works as a plain mouse.

On Android_x86 it works normal when it's plugged in before starting the OS, when plugged in while it's running only the keyboard works but no sign on the trackpad (this puzzles me, why does a simple re-plug break functionality that is there and why does it only affect the touchpad and not the keyboard?).

On native Android it's dead all the time, which puzzles me as well. Looking at the HID descriptor from the second touchpad, shouldn't it fall back to using it as a normal mouse in case the multitouch driver for the BCM5974 isn't loaded/present (like the BIOS does and like Windows does without the driver installed)?


Thanks a lot already for your time... also, should I open a new thread for this?
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4531
  • Country: au
    • send complaints here
In my pc BIOS it works as a plain mouse.

On Android_x86 it works normal when it's plugged in before starting the OS, when plugged in while it's running only the keyboard works but no sign on the trackpad (this puzzles me, why does a simple re-plug break functionality that is there and why does it only affect the touchpad and not the keyboard?).
This is the USB emulation, the bios is likely making it appear as a generic mouse.

On native Android it's dead all the time, which puzzles me as well. Looking at the HID descriptor from the second touchpad, shouldn't it fall back to using it as a normal mouse in case the multitouch driver for the BCM5974 isn't loaded/present (like the BIOS does and like Windows does without the driver installed)?
You need to get the USB enumeration/tree and driver details on the android platform, you know it works on windows (and added a huge pile of junk to the forum about that) but you keep avoiding looking into what is happening on android. It may not have drivers for any of those descriptors.

Thanks a lot already for your time... also, should I open a new thread for this?
Not when you aren't listening or adding anything new.
 

Offline Ags1677

  • Newbie
  • Posts: 1
  • Country: dk
You do know this information is worth gold? You should totally make a YouTube video and/or instructables on this.

I was looking at the schematic and it looks like the chip also controls stuff like Bluetooth and IR?
Wondering if its possible that also would work through the usb.

I’m planning on using mine as a KVM console.

Bonus question: Does anyone know of a LCD/LVDS controller with the cable connector from the motherboard? So I don’t have to disassemble the lcd to replace the cable?
 

Offline XForce

  • Newbie
  • Posts: 2
  • Country: ru
Re: Making a standalone USB trackpad from Macbook Pro (mid-2012) trackpad.
« Reply #12 on: February 02, 2023, 09:48:10 am »
Hi guys! Maybe there is an easier way to connect the trackpad and keyboard? Without motherboard cutting  :D
 
The following users thanked this post: renan.ramos


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf