All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Chen <johnchen902@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Rohit Pidaparthi <rohitpid@gmail.com>,
	RicardoEPRodrigues <ricardo.e.p.rodrigues@gmail.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	John Chen <johnchen902@gmail.com>
Subject: [PATCH 0/4] HID: add Apple Magic Mouse 2 support
Date: Sat, 27 Mar 2021 21:05:04 +0800	[thread overview]
Message-ID: <20210327130508.24849-1-johnchen902@gmail.com> (raw)

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

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      |  11 +++
 drivers/hid/hid-magicmouse.c | 156 ++++++++++++++++++++++++++++-------
 include/linux/hid.h          |   3 +
 5 files changed, 140 insertions(+), 32 deletions(-)

-- 
2.31.0


             reply	other threads:[~2021-03-27 13:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-27 13:05 John Chen [this message]
2021-03-27 13:05 ` [PATCH 1/4] HID: magicmouse: add Apple Magic Mouse 2 support John Chen
2021-03-27 13:05 ` [PATCH 2/4] HID: magicmouse: fix 3 button emulation of Mouse 2 John Chen
2021-03-27 13:05 ` [PATCH 3/4] HID: magicmouse: fix reconnection of Magic " John Chen
2021-03-27 13:05 ` [PATCH 4/4] HID: input: map battery capacity (00850065) John Chen
2021-03-27 14:14   ` Pochang Chen
2021-03-27 17:22   ` kernel test robot
2021-03-27 17:22     ` kernel test robot
2021-03-27 17:50   ` kernel test robot
2021-03-27 17:50     ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210327130508.24849-1-johnchen902@gmail.com \
    --to=johnchen902@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ricardo.e.p.rodrigues@gmail.com \
    --cc=rohitpid@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.