Closed PJungkamp closed 2 years ago
Code looks good to me. Couple of style issues though and missing punctuation in comments (small things, really). Can you run checkpatch (./scripts/checkpatch.pl --strict <patchfile>
from kernel source root directory, use git format-patch -1
to get a patch) and address those remarks?
After that I think you could also try rebasing (needs a rebase due to the typecover backlight patch) and submitting it upstream.
Should I rebase against a revision before the backlight patch was applied?
I modified the code the backlight patch introduced since it fit the problem, so I depend on its presence.
(I changed get_type_cover_backlight_field(...)
to get_type_cover_field(...)
since a field search is needed for both patches)
I'll correct the formatting within the next few days.
Should I rebase against a revision before the backlight patch was applied?
For upstreaming, yes. For the PR here I think it's better/easier if you keep it as-is.
I've rebased onto 5.17-surface-devel
and finally fixed the formatting issues.
I'll open a pull request for the 5.17-surface-devel
branch and close this one.
The Surface Pro Type Cover has several non standard HID usages in it's hid report descriptor. I noticed that, upon folding the typecover back, a vendor specfic range of 4 32 bit integer hid usages is transmitted. Only the first byte of the message seems to convey reliable information about the keyboard state.
0x22 => Normal (keys enabled) 0x33 => Folded back (keys disabled) 0x53 => Rotated left/right side up (keys disabled) 0x13 => Cover closed (keys disabled) 0x43 => Folded back and Tablet upside down (keys disabled) This list may not be exhaustive.
The tablet mode switch will be disabled for a value of 0x22 and enabled on any other value.