linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Hid: add Apple Magic Mouse 2 support
@ 2021-03-30 11:33 John Chen
  2021-03-30 11:33 ` [PATCH v2 1/4] HID: magicmouse: " John Chen
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: John Chen @ 2021-03-30 11:33 UTC (permalink / raw)
  To: linux-input
  Cc: Rohit Pidaparthi, RicardoEPRodrigues, Jiri Kosina,
	Benjamin Tissoires, John Chen

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(-)

-- 
2.31.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-07 11:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30 11:33 [PATCH v2 0/4] Hid: add Apple Magic Mouse 2 support John Chen
2021-03-30 11:33 ` [PATCH v2 1/4] HID: magicmouse: " John Chen
2021-04-05 17:30   ` Felix Hädicke
2021-03-30 11:33 ` [PATCH v2 2/4] HID: magicmouse: fix 3 button emulation of Mouse 2 John Chen
2021-04-07 11:15   ` Jiri Kosina
2021-03-30 11:33 ` [PATCH v2 3/4] HID: magicmouse: fix reconnection of Magic " John Chen
2021-03-30 11:33 ` [PATCH v2 4/4] HID: input: map battery capacity (00850065) John Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).