Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes and message structure detailing #56

Merged
merged 7 commits into from
Jan 4, 2018

Conversation

roadrunner2
Copy link
Contributor

Sorry for putting several things in one pull request, but there were conflicts when I tried to separate them out.

The big one here is 042729a, the long promised clarification of various fields in, and overall structure of the messages. There are still many unknowns, but I think at least the high level message/packet structures are clear now. The commits following that then capitalize on these structures, and in particular the last commit finally fixes the errors when more than 6 fingers are pressed (tested up to all 11 fingers...).

The write_active flag was not being cleared, making the module
unremovable unless a subsequent write command succeeded. And similarly
if this happened during a drain the notification was never sent. So
perform a full cleanup after an error.
And for good measure clear all flags and state on resume.
This is mainly for new hardware, where we don't have the dimensions of
the touchpad yet - with this users can explicitly set the dimensions
until such time as they have been added to the internal list.
More fields in the spi packet(s) have been identified, and the
structures reworked accordingly. In particular several fields in the
overall header of the spi packet, as well the message header have been
clarified. However, a number of fields are still unknown or have "magic"
values; and perforce there's some random guesswork such as whether
something is two 1-byte fields or a single 2-byte field.

This lays the groundwork for improving the packet handling in the next
commits.
This makes the commands a little less magical.
With this we now properly report all 11 fingers on MacBook Pro's (and
possibly some newer MacBook's).
@cb22
Copy link
Owner

cb22 commented Jan 4, 2018

Great work @roadrunner2! It's really neat how those structures make everything so much less opaque.

No more \x40\x02\x00\x00\x00\x00\x0C\x00\x52\x02\x00\x00\x02\x00\x02\x00\x02\x01\x7B\x11\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x23\xAB!

@cb22 cb22 merged commit c98c672 into cb22:master Jan 4, 2018
@roadrunner2 roadrunner2 deleted the fixes-and-message-structure-detailing branch January 12, 2018 08:54
@l1k
Copy link
Contributor

l1k commented Mar 14, 2018

Seeing this only now, it's seriously beautiful work. You guys probably shouldn't hold off on upstreaming because of some remaining nits, I think the quality is already much better than a lot of other stuff in the kernel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants