Skip to content

Hid: add Apple Magic Mouse 2 support

John Chen linux-input 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 2 repliesIn review
  2. v14 patches 1 replySuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4HID: magicmouse: add Apple Magic Mouse 2 supportdrivers/hid/hid-ids.h drivers/hid/hid-magicmouse.c+49 -51 reply
2/4HID: magicmouse: fix 3 button emulation of Mouse 2drivers/hid/hid-magicmouse.c+16 -01 reply
3/4HID: magicmouse: fix reconnection of Magic Mouse 2drivers/hid/hid-magicmouse.c+63 -300 replies
4/4HID: input: map battery capacity (00850065)drivers/hid/hid-debug.c drivers/hid/hid-input.c include/linux/hid.h+20 -60 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by.

PatchRohit PidaparthiRicardoEPRodrigues
1/4Co-authored-by Co-authored-by
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] Hid: add Apple Magic Mouse 2 support

The HID descriptor of Magic Mouse 2 contains BTN_LEFT, BTN_RIGHT, REL_X, REL_Y, whether it's charging, whether it's fully charged, and battery capacity.

$ xxd -p report_descriptor
05010902a101851205091901290215002501950275018102950175068103
05010901a1001601f826ff073601fb46ff046513550d0930093175109502
8106750895028101c00602ff09558555150026ff0075089540b1a2c00600
ff0914a10185900584750195031500250109610585094409468102950581
0175089501150026ff0009658102c000

As hidinput can handle the BTNs and RELs, the Magic Mouse 2 already functions as a basic mouse. Nevertheless, It should be reasonable to extend hid-magicmouse to support Magic Mouse 2 as well. Furthermore, hidinput is patched to handle the battery capacity.

This work is based on Recardo's, which is in turned based on Rohitpid's. Their GitHub repositories are linked below:
https://github.com/RicardoEPRodrigues/magicmouse-hid
https://github.com/rohitpid/Linux-Magic-Trackpad-2-Driver

Change v1->v2: An extra parameter is passed to hidinput_setup_battery instead of directly modifying battery_{min,max}.

John Chen (4):
HID: magicmouse: add Apple Magic Mouse 2 support
HID: magicmouse: fix 3 button emulation of Mouse 2
HID: magicmouse: fix reconnection of Magic Mouse 2
HID: input: map battery capacity (00850065)

 drivers/hid/hid-debug.c      |   1 +
 drivers/hid/hid-ids.h        |   1 +
 drivers/hid/hid-input.c      |  22 +++--
 drivers/hid/hid-magicmouse.c | 156 ++++++++++++++++++++++++++++-------
 include/linux/hid.h          |   3 +
 5 files changed, 145 insertions(+), 38 deletions(-)
Signature · 1 line
2.31.0