by ndesaulniers · 10y ago · 0 comments
1. What's the __1e6 alignment? [0] I've never heard of that.
2. How is the driver author going about writing that driver? Some of the comments seem to allude to analyzing what the Windows driver is doing. Do you think they're disassembling the Windows driver and trying to re-implement a Linux compatible driver in C? I don't see how anyone could implement a driver like this off the bat without some data sheet or existing code to look at.
Edit: thanks to people pointing out it's __le16, not __1e6. I need to change my font; even now I can barely tell the 1 and l apart.
[0] https://github.com/cb22/macbook12-spi-driver/blob/master/app...
Little endian 16 bit
As for the driver itself, the spi interfaces are not too hard to understand. It's unlikely anyone is disassembling anything.
The normal way to figure out the packets the touchpad uses are to look at the datasheets/etc you can find on whoever made the touchpad.
In this case, it's a bcm5974, and if you look at that driver, you'll see the packet format is the same.
Otherwise, you write a packet dumper and start pushing things
[0] https://github.com/cb22/macbook12-spi-driver/pull/1#issuecom...
[1] https://github.com/cb22/macbook12-spi-driver/issues/3#issuec...